Staging: gdm72xx: make "len" unsigned
We had an underflow bug here and I think I fixed it but we may as
well be proactive and make "len" unsigned to be double sure.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff --git a/drivers/staging/gdm72xx/gdm_usb.c b/drivers/staging/gdm72xx/gdm_usb.c
index f81129d..7a51922 100644
--- a/drivers/staging/gdm72xx/gdm_usb.c
+++ b/drivers/staging/gdm72xx/gdm_usb.c
@@ -284,7 +284,7 @@
spin_unlock_irqrestore(&tx->lock, flags);
}
-static int gdm_usb_send(void *priv_dev, void *data, int len,
+static int gdm_usb_send(void *priv_dev, void *data, size_t len,
void (*cb)(void *data), void *cb_data)
{
struct usbwm_dev *udev = priv_dev;
@@ -341,7 +341,7 @@
usb_fill_bulk_urb(t->urb, usbdev, usb_sndbulkpipe(usbdev, 1), t->buf,
len + padding, gdm_usb_send_complete, t);
- dev_dbg(&usbdev->dev, "usb_send: %*ph\n", len + padding, t->buf);
+ dev_dbg(&usbdev->dev, "usb_send: %*ph\n", (int)len + padding, t->buf);
#ifdef CONFIG_WIMAX_GDM72XX_USB_PM
if (usbdev->state & USB_STATE_SUSPENDED) {
@@ -460,7 +460,7 @@
}
static int gdm_usb_receive(void *priv_dev,
- void (*cb)(void *cb_data, void *data, int len),
+ void (*cb)(void *cb_data, void *data, size_t len),
void *cb_data)
{
struct usbwm_dev *udev = priv_dev;
diff --git a/drivers/staging/gdm72xx/gdm_usb.h b/drivers/staging/gdm72xx/gdm_usb.h
index d864928..1456da0 100644
--- a/drivers/staging/gdm72xx/gdm_usb.h
+++ b/drivers/staging/gdm72xx/gdm_usb.h
@@ -49,7 +49,7 @@
struct rx_cxt *rx_cxt;
struct urb *urb;
u8 *buf;
- void (*callback)(void *cb_data, void *data, int len);
+ void (*callback)(void *cb_data, void *data, size_t len);
void *cb_data;
};
diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c
index 2ee6a39..d29b32e 100644
--- a/drivers/staging/gdm72xx/gdm_wimax.c
+++ b/drivers/staging/gdm72xx/gdm_wimax.c
@@ -695,7 +695,7 @@
}
}
-static void rx_complete(void *arg, void *data, int len)
+static void rx_complete(void *arg, void *data, size_t len)
{
struct nic *nic = arg;
@@ -703,7 +703,7 @@
gdm_wimax_rcv_with_cb(nic, rx_complete, nic);
}
-static void prepare_rx_complete(void *arg, void *data, int len)
+static void prepare_rx_complete(void *arg, void *data, size_t len)
{
struct nic *nic = arg;
int ret;
diff --git a/drivers/staging/gdm72xx/gdm_wimax.h b/drivers/staging/gdm72xx/gdm_wimax.h
index 3330cd79..ed12813 100644
--- a/drivers/staging/gdm72xx/gdm_wimax.h
+++ b/drivers/staging/gdm72xx/gdm_wimax.h
@@ -26,10 +26,10 @@
struct phy_dev {
void *priv_dev;
struct net_device *netdev;
- int (*send_func)(void *priv_dev, void *data, int len,
+ int (*send_func)(void *priv_dev, void *data, size_t len,
void (*cb)(void *cb_data), void *cb_data);
int (*rcv_func)(void *priv_dev,
- void (*cb)(void *cb_data, void *data, int len),
+ void (*cb)(void *cb_data, void *data, size_t len),
void *cb_data);
};