public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel•org>
To: Wolfram Sang <wsa+renesas@sang-engineering•com>
Cc: Geert Uytterhoeven <geert@linux-m68k•org>,
	netdev@vger•kernel.org, linux-renesas-soc@vger•kernel.org,
	Steve Glendinning <steve.glendinning@shawell•net>,
	"David S. Miller" <davem@davemloft•net>,
	Eric Dumazet <edumazet@google•com>,
	Paolo Abeni <pabeni@redhat•com>,
	linux-kernel@vger•kernel.org
Subject: Re: [PATCH net-next] smsc911x: remove superfluous variable init
Date: Tue, 21 Mar 2023 12:27:42 -0700	[thread overview]
Message-ID: <20230321122742.7bd1165f@kernel.org> (raw)
In-Reply-To: <ZBnBZwC9WEoNK0Gp@ninjato>

On Tue, 21 Mar 2023 15:38:31 +0100 Wolfram Sang wrote:
> > >         struct smsc911x_data *pdata = netdev_priv(dev);
> > > -       struct phy_device *phydev = NULL;
> > > +       struct phy_device *phydev;
> > >         int ret;
> > >
> > >         phydev = phy_find_first(pdata->mii_bus);  
> > 
> > Nit: perhaps combine this assignment with the variable declaration?  
> 
> I thought about it but found this version to be easier readable.

+1 

Calling functions which need their return value error-checked as part
of the variable declaration should be against the kernel coding style
IMHO.

  reply	other threads:[~2023-03-21 19:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21 11:47 [PATCH net-next] smsc911x: remove superfluous variable init Wolfram Sang
2023-03-21 14:27 ` Geert Uytterhoeven
2023-03-21 14:38   ` Wolfram Sang
2023-03-21 19:27     ` Jakub Kicinski [this message]
2023-03-22 14:58     ` Paolo Abeni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230321122742.7bd1165f@kernel.org \
    --to=kuba@kernel$(echo .)org \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=geert@linux-m68k$(echo .)org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-renesas-soc@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=steve.glendinning@shawell$(echo .)net \
    --cc=wsa+renesas@sang-engineering$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox