[PATCH 04/12] mtd: move mtd_oob_mode_t to shared kernel/user space

Brian Norris computersforpeace at gmail.com
Tue Sep 13 18:29:50 EDT 2011


On Sun, Sep 11, 2011 at 8:28 AM, Artem Bityutskiy <dedekind1 at gmail.com> wrote:
> On Sun, 2011-09-11 at 14:57 +0300, Artem Bityutskiy wrote:
>> It is good to use __u8 in ioctls for this field.
>>
>> But for internal usage there is no need to make it uint8_t, just use
>> 'int' instead. All modern CPUs will anyway reserve 32 bits for this.
>>
>> And unnecessary usage of the 8-bits restriction only imposes more
>> unnecessary limitations to the compiler/CPU. Using 'int' is instead
>> making CPU/compiler use the native integer type.

Thanks, good suggestion. I think I considered this issue but not very
thoroughly. My only reason for uint8_t here was just to prevent the
temptation to use all 32 bits of the field. But there's no way we'd
use 32 bits for a enumerated mode, i.e., we'd need to have more than
256 modes to run into this issue... I think we'd be having other more
important issues if we get there :)

> I've actually amended your patch and used 'unsigned int mode' instead,
> and pushed to my three. Please, complain and send new versions if you do
> not like that.

No complaint.

Brian



More information about the linux-mtd mailing list