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

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

 



Hello.

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>

Michal, shouldn't you rather sign off on the patch if it includes a chunk from you anyway?

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
---
v1..v2: add Michal's chunk which converts lun to unsigned int

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux