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: <1170784337.3688.18.camel@localhost>
Date:	Tue, 06 Feb 2007 09:52:17 -0800
From:	Joe Perches <joe@...ches.com>
To:	"Ahmed S. Darwish" <darwish.07@...il.com>
Cc:	kkeil@...e.de, kai.germaschewski@....de,
	linux-kernel@...r.kernel.org, isdn4linux@...tserv.isdn4linux.de
Subject: Re: [PATCH 2.6.20] isdn-capi: Use ARRAY_SIZE macro when appropriate

On Tue, 2007-02-06 at 18:04 +0200, Ahmed S. Darwish wrote:
> A patch to use ARRAY_SIZE macro already defined in kernel.h
> Signed-off-by: Ahmed S. Darwish <darwish.07@...il.com>
> ---
> diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
> index d22c022..3804591 100644
> --- a/drivers/isdn/capi/capi.c
> +++ b/drivers/isdn/capi/capi.c
> @@ -1456,7 +1456,7 @@ static struct procfsentries {
>  
>  static void __init proc_init(void)
>  {
> -    int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]);
> +    int nelem = ARRAY_SIZE(procfsentries);
>      int i;
>  
>      for (i=0; i < nelem; i++) {

For these patches, perhaps you can eliminate the temporary
variable and change the loop to the more common form of

	for (i = 0; i < ARRAY_SIZE(array); i++) {


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ