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]
Message-ID: <7d81d0f7a24a4349a53cd77f9e42ee4a@realtek.com>
Date: Mon, 6 May 2024 02:39:50 +0000
From: Justin Lai <justinlai0215@...ltek.com>
To: Simon Horman <horms@...nel.org>
CC: "kuba@...nel.org" <kuba@...nel.org>,
        "davem@...emloft.net"
	<davem@...emloft.net>,
        "edumazet@...gle.com" <edumazet@...gle.com>,
        "pabeni@...hat.com" <pabeni@...hat.com>,
        "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>,
        "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>,
        "andrew@...n.ch" <andrew@...n.ch>,
        "jiri@...nulli.us" <jiri@...nulli.us>,
        Ping-Ke Shih <pkshih@...ltek.com>, Larry Chiu <larry.chiu@...ltek.com>
Subject: RE: [PATCH net-next v17 02/13] rtase: Implement the .ndo_open function

> On Fri, May 03, 2024 at 10:19:05AM +0000, Justin Lai wrote:
> > > On Thu, May 02, 2024 at 05:18:36PM +0800, Justin Lai wrote:
> > > > Implement the .ndo_open function to set default hardware settings
> > > > and initialize the descriptor ring and interrupts. Among them,
> > > > when requesting irq, because the first group of interrupts needs
> > > > to process more events, the overall structure will be different
> > > > from other groups of interrupts, so it needs to be processed separately.
> > > >
> > > > Signed-off-by: Justin Lai <justinlai0215@...ltek.com>
> > >
> > > Hi Justin,
> > >
> > > some minor feedback from my side.
> > >
> > > > +static int rtase_open(struct net_device *dev) {
> > > > +     struct rtase_private *tp = netdev_priv(dev);
> > > > +     struct rtase_int_vector *ivec = &tp->int_vector[0];
> > > > +     const struct pci_dev *pdev = tp->pdev;
> > > > +     u16 i, j;
> > > > +     int ret;
> > >
> > > nit: please use reverse xmas tree order - longest line to shortest -
> > >      for local variable declarations in new Networking code.
> > >
> > Hi Simon,
> > This is partly because ivec needs to use tp for initialization, so tp
> > is placed in front of ivec, causing this situation.
> 
> Thanks Justin,
> 
> Understood.
> 
> Had I noticed that I probably wouldn't have commented as I did above.
> But, FWIIW, in such cases my suggestion would be to separate the declaration
> from the assignment.
> 
> Something like this:
> 
>         struct rtase_private *tp = netdev_priv(dev);
>         const struct pci_dev *pdev = tp->pdev;
>         struct rtase_int_vector *ivec;
>         u16 i, j;
>         int ret;
> 
>         ivec = &tp->int_vector[0];

OK, I understand, thank you for your suggestion.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ