lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 13 Feb 2017 17:00:40 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     walter harms <wharms@....de>
Cc:     Timur Tabi <timur@...eaurora.org>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [patch net-next] net: qcom/emac: fix a sizeof() typo

On Mon, Feb 13, 2017 at 12:55:03PM +0100, walter harms wrote:
> 
> 
> Am 13.02.2017 12:00, schrieb Dan Carpenter:
> > We had intended to say "sizeof(u32)" but the "u" is missing.
> > Fortunately, sizeof(32) is also 4, so the original code still works.
> > 
> > Fixes: c4e7beea2192 ("net: qcom/emac: add ethtool support for reading hardware registers")
> > Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
> > 
> > diff --git a/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c b/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c
> > index 0d9945fb79be..bbe24639aa5a 100644
> > --- a/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c
> > +++ b/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c
> > @@ -227,7 +227,7 @@ static void emac_get_regs(struct net_device *netdev,
> >  
> >  static int emac_get_regs_len(struct net_device *netdev)
> >  {
> > -	return EMAC_MAX_REG_SIZE * sizeof(32);
> > +	return EMAC_MAX_REG_SIZE * sizeof(u32);
> >  }
> >  
> 
> 
> We have a function where the argument is ignored and the rest is const ?
> 
> emac_ethtool_get_regs_len seems the only user. So it would be fairly easy to
> move that into that function.

It's not the only user.  We have to pass netdev because it's used as a
function pointer.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux - Powered by OpenVZ