summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-02-22 22:32:21 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-05 14:48:04 -0800
commit3c359f060f47200b1dcdd151edda872a14f62783 (patch)
tree02364251f4daac024957678222696ab9151e9ffc
parent724dfc25f596668ad361ecd562f1a741114500aa (diff)
downloadlinux-3c359f060f47200b1dcdd151edda872a14f62783.tar.bz2
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>
-rw-r--r--drivers/staging/gdm72xx/gdm_usb.c6
-rw-r--r--drivers/staging/gdm72xx/gdm_usb.h2
-rw-r--r--drivers/staging/gdm72xx/gdm_wimax.c4
-rw-r--r--drivers/staging/gdm72xx/gdm_wimax.h4
4 files changed, 8 insertions, 8 deletions
diff --git a/drivers/staging/gdm72xx/gdm_usb.c b/drivers/staging/gdm72xx/gdm_usb.c
index f81129d5f6ef..7a51922b239b 100644
--- a/drivers/staging/gdm72xx/gdm_usb.c
+++ b/drivers/staging/gdm72xx/gdm_usb.c
@@ -284,7 +284,7 @@ static void gdm_usb_send_complete(struct urb *urb)
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 @@ static int gdm_usb_send(void *priv_dev, void *data, int len,
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 void gdm_usb_rcv_complete(struct urb *urb)
}
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 d864928cdf41..1456da0e9281 100644
--- a/drivers/staging/gdm72xx/gdm_usb.h
+++ b/drivers/staging/gdm72xx/gdm_usb.h
@@ -49,7 +49,7 @@ struct usb_rx {
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 2ee6a392173d..d29b32efcfd5 100644
--- a/drivers/staging/gdm72xx/gdm_wimax.c
+++ b/drivers/staging/gdm72xx/gdm_wimax.c
@@ -695,7 +695,7 @@ static void gdm_wimax_transmit_pkt(struct net_device *dev, char *buf, int len)
}
}
-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 @@ static void rx_complete(void *arg, void *data, int len)
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 3330cd798c69..ed12813f1591 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);
};