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: <CAP6odji5mepZDe3EHWFJjDrrhjCq2HjMb-_Cf-=Qm8oFOJyyhg@mail.gmail.com>
Date:	Thu, 23 Jan 2014 08:46:18 -0800
From:	Grant Grundler <grantgrundler@...il.com>
To:	Dan Carpenter <dan.carpenter@...cle.com>
Cc:	Grant Grundler <grundler@...isc-linux.org>,
	"open list:TULIP NETWORK DRI..." <netdev@...r.kernel.org>,
	"David S. Miller" <davem@...emloft.net>,
	kernel-janitors@...r.kernel.org
Subject: Re: [patch] tulip: cleanup by using ARRAY_SIZE()

On Thu, Jan 23, 2014 at 12:26 AM, Dan Carpenter
<dan.carpenter@...cle.com> wrote:
> In this situation then ARRAY_SIZE() and sizeof() are the same, but we're
> really dealing with array indexes and not byte offsets so ARRAY_SIZE()
> is cleaner.

Yup.

> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>

Acked-by: Grant Grundler <grundler@...isc-linux.org>

cheers
grant
>
> diff --git a/drivers/net/ethernet/dec/tulip/media.c b/drivers/net/ethernet/dec/tulip/media.c
> index 0d0ba725341a..dcf21a36a9cf 100644
> --- a/drivers/net/ethernet/dec/tulip/media.c
> +++ b/drivers/net/ethernet/dec/tulip/media.c
> @@ -457,7 +457,7 @@ void tulip_find_mii(struct net_device *dev, int board_idx)
>         /* Find the connected MII xcvrs.
>            Doing this in open() would allow detecting external xcvrs later,
>            but takes much time. */
> -       for (phyn = 1; phyn <= 32 && phy_idx < sizeof (tp->phys); phyn++) {
> +       for (phyn = 1; phyn <= 32 && phy_idx < ARRAY_SIZE(tp->phys); phyn++) {
>                 int phy = phyn & 0x1f;
>                 int mii_status = tulip_mdio_read (dev, phy, MII_BMSR);
>                 if ((mii_status & 0x8301) == 0x8001 ||
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ