[PATCH] usb: core: Use 'unsigned int' for indexes

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

 



From: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>

Use 'unsigned int' for indexes, in order to fix the following build warnings 
with W=1 option:

drivers/usb/core/usb.c: In function 'usb_find_alt_setting':
drivers/usb/core/usb.c:89:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/usb/core/usb.c: In function 'usb_altnum_to_altsetting':
drivers/usb/core/usb.c:159:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
---
 drivers/usb/core/usb.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index f81b925..98248d7 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -75,7 +75,7 @@ struct usb_host_interface *usb_find_alt_setting(
 		unsigned int alt_num)
 {
 	struct usb_interface_cache *intf_cache = NULL;
-	int i;
+	unsigned int i;
 
 	for (i = 0; i < config->desc.bNumInterfaces; i++) {
 		if (config->intf_cache[i]->altsetting[0].desc.bInterfaceNumber
@@ -154,7 +154,7 @@ struct usb_host_interface *usb_altnum_to_altsetting(
 					const struct usb_interface *intf,
 					unsigned int altnum)
 {
-	int i;
+	unsigned int i;
 
 	for (i = 0; i < intf->num_altsetting; i++) {
 		if (intf->altsetting[i].desc.bAlternateSetting == altnum)
-- 
1.7.9.5

--
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