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: <82faac5b0706110525s56bade43rb24619b54687770d@mail.gmail.com>
Date:	Mon, 11 Jun 2007 22:25:31 +1000
From:	"Darren Jenkins" <darrenrjenkins@...il.com>
To:	"Andi Drebes" <lists-receive@...grammierforen.de>
Cc:	"Jan-Benedict Glaw" <jbglaw@...-owl.de>,
	kernel-janitors@...ts.osdl.org,
	linux-kernel <linux-kernel@...r.kernel.org>,
	"Karsten Keil" <kkeil@...e.de>
Subject: Re: [KJ] Re: [PATCH] drivers/isdn/hisax: ARRAY_SIZE instead of sizeof

G'day Andi,

On 6/11/07, Andi Drebes <lists-receive@...grammierforen.de> wrote:

> > I'd suggest to not use another define, but use ARRAY_SIZE(foo)
> > _instead of_ eg. FNCOUNT.
> I thought of this, too, but I tried to keep things consistent. Let me
> explain that a little bit more in detail. If you have a look at the files
> in drivers/isdn/hisax then you will see that a lot of array size definitions
> are assigned to preprocessor macros. So I thought removing just one
> of the macros while the other continue to exist would make the code
> a little bit more inconsistent. However, one might disagree about that.
> So here's another patch that includes the changes from the original patch
> and removes the FNCOUNT preprocessor definition. Perhaps the original
> authors of the files should decide wether they want to keep it or not.

I think what was meant here was to remove _all_ the macros that you
assigned to the ARRAY_SIZE() macro.


If you look at the two advantages replacing code with the ARRAY_SIZE()
macro has;
1. More readable/consistent code.
2. Faster compile times, because of less macros being defined.

If you were to simply redefine other macro's to be an ARRAY_SIZE()
macro, the code will still contain the original macro's that people
will have to look up, so would _not_ be more readable/consistent and
you now have two stages of macro replacement, so the code will
actually take _longer_ to compile.

So to get the benefit of this change you have to _remove_ all the
macros that are somehow equivalent to ARRAY_SIZE(), and replace their
use in the code, with an appropriate ARRAY_SIZE() usage.

Darren J.
-
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