Re: [PATCH v2] gadget/mass_storage: remove >= 0 check for unsigned type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On 03-12-2012 18:32, Sebastian Andrzej Siewior wrote:
>> | In file included from drivers/usb/gadget/acm_ms.c:43:
>> | f_mass_storage.c:2199:18: warning: comparison of unsigned expression >= 0 is always true  [-Wtautological-compare]
>> |         if (common->lun >= 0 && common->lun < common->nluns)
>> |             ~~~~~~~~~~~ ^  ~
>
>> common->lun is defined as "unsigned int" so its value is always >= 0.
>> It is assigned via cbw->Lun which is defined as u8 so it is also not
>> abused as -1.
>
>> [mina86@xxxxxxxxxx: make lun unsigned int and use %u in DBG() macro for it]
>> Acked-by: Michal Nazarewicz <mina86@xxxxxxxxxx>

On Tue, Dec 04 2012, Sergei Shtylyov <sshtylyov@xxxxxxxxxx> wrote:
>     Michal, shouldn't you rather sign off on the patch if it includes a chunk 
> from you anyway?

Makes sense I guess, I'm fine either way:

Signed-off-by: Michal Nazarewicz <mina86@xxxxxxxxxx>

>> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@xxxxxxxxxx>--------------ooO--(_)--Ooo--

Attachment: pgpip6kKkIoSG.pgp
Description: PGP signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux