[PATCH 1/2] gpio: mvebu: add dbg_show function

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Sat Mar 23 12:26:41 EDT 2013


Russell,

On Sat, 23 Mar 2013 15:43:18 +0000, Russell King - ARM Linux wrote:

> I don't think this is a good idea - and it's wrong.  test_bit() operates
> on an array of bits, and needs to be passed an unsigned long pointer.
> blink etc are "u32"s which aren't unsigned long.
> 
> Moreover, what if ngpio becomes greater than 32 (for whatever reason)?
> test_bit(), when used correctly, will access the following word, which
> is probably a bad thing.  The original won't have that behaviour,
> which is safer.

You're right, indeed.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com



More information about the linux-arm-kernel mailing list