From: David Miller
> Sent: 16 August 2017 05:24
> From: Subash Abhinov Kasiviswanathan <subas...@codeaurora.org>
> Date: Tue, 15 Aug 2017 22:15:53 -0600
> 
> > +static int rmnet_unregister_real_device(struct net_device *dev)
> > +{
> > +   int config_id = RMNET_LOCAL_LOGICAL_ENDPOINT;
> > +   struct rmnet_logical_ep_conf_s *epconfig_l;
> > +   struct rmnet_phys_ep_conf_s *config;
> > +
> > +   ASSERT_RTNL();
> > +
> > +   netdev_info(dev, "Removing device %s\n", dev->name);
> > +
> > +   if (!rmnet_is_real_dev_registered(dev))
> > +           return -EINVAL;
> > +
> > +   for (; config_id < RMNET_MAX_LOGICAL_EP; config_id++) {
> 
> This loop is so much harder to understand because you initialize
> the loop index several lines above the for() statement.  Just
> initialize it here at the beginning of the for() loop and deal
> with the fact that this will have to therefore be a multi-line
> for() statement the best you can.
...

One way to split the multi-line for() is to put the initialiser
on the immediately preceding line:
        config_id = RMNET_LOCAL_LOGICAL_ENDPOINT;
        for (; config_id < RMNET_MAX_LOGICAL_EP; config_id++) {

        David

Reply via email to