lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 30 Jan 2021 11:22:52 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc:     Alex Elder <elder@...aro.org>, David Miller <davem@...emloft.net>,
        elder@...nel.org, evgreen@...omium.org, bjorn.andersson@...aro.org,
        cpratapa@...eaurora.org,
        Subash Abhinov Kasiviswanathan <subashab@...eaurora.org>,
        Network Development <netdev@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next 9/9] net: ipa: don't disable NAPI in suspend

On Sat, 30 Jan 2021 10:25:16 -0500 Willem de Bruijn wrote:
> > @@ -894,12 +894,16 @@ int gsi_channel_start(struct gsi *gsi, u32 channel_id)
> >         struct gsi_channel *channel = &gsi->channel[channel_id];
> >         int ret;
> >
> > -       /* Enable the completion interrupt */
> > +       /* Enable NAPI and the completion interrupt */
> > +       napi_enable(&channel->napi);
> >         gsi_irq_ieob_enable_one(gsi, channel->evt_ring_id);
> >
> >         ret = __gsi_channel_start(channel, true);
> > -       if (ret)
> > -               gsi_irq_ieob_disable_one(gsi, channel->evt_ring_id);
> > +       if (!ret)
> > +               return 0;
> > +
> > +       gsi_irq_ieob_disable_one(gsi, channel->evt_ring_id);
> > +       napi_disable(&channel->napi);
> >
> >         return ret;
> >  }  
> 
> subjective, but easier to parse when the normal control flow is linear
> and the error path takes a branch (or goto, if reused).

FWIW - fully agreed, I always thought this was part of the kernel
coding style.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ