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:   Thu, 5 Jul 2018 13:01:25 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Colin Ian King <colin.king@...onical.com>
Cc:     "David S . Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
        kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: ethernet: sun: remove redundant variables adv and
 lpa

On Thu, Jul 05, 2018 at 10:54:51AM +0100, Colin Ian King wrote:
> On 05/07/18 10:52, Dan Carpenter wrote:
> > On Thu, Jul 05, 2018 at 10:37:32AM +0100, Colin King wrote:
> >> diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
> >> index 88c12474a0c3..2d6b62c6d9ab 100644
> >> --- a/drivers/net/ethernet/sun/niu.c
> >> +++ b/drivers/net/ethernet/sun/niu.c
> >> @@ -1225,17 +1225,13 @@ static int link_status_1g_rgmii(struct niu *np, int *link_up_p)
> >>  
> >>  	bmsr = err;
> >>  	if (bmsr & BMSR_LSTATUS) {
> >> -		u16 adv, lpa;
> >> -
> >>  		err = mii_read(np, np->phy_addr, MII_ADVERTISE);
> >>  		if (err < 0)
> >>  			goto out;
> >> -		adv = err;
> >>  
> >>  		err = mii_read(np, np->phy_addr, MII_LPA);
> >>  		if (err < 0)
> >>  			goto out;
> >> -		lpa = err;
> > 
> > I'm fairly sure we could get rid of the mii_read() calls as well.
> 
> I'm always concerned that removing the reads of H/W registers can affect
> the behavior, so I left those in.

Yeah...  That's true sometimes.  Hence my "fairly sure" equivocation.  I
looked to see if any of the original devs are around and it's been a
while since anyone worked on this driver.

When we remove these warnings it means that there is no chance that
someone will look at the code again and remove the unneeded mii_read()
calls.  I'm 90% sure the reads are unnecessary.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ