Skip to contentSkip to conversation

net: cdc_ncm: cleanup a type issue in cdc_ncm_setup()

PATCH Applied Dan Carpenter 2 participants 2 messages Nov 13, 2013 – Nov 14, 2013

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: cdc_ncm: cleanup a type issue in cdc_ncm_setup()

This is harmless but cdc_ncm_setup() returns negative error codes truncated to u8 values. There is only one caller and treats all non-zero returns as errors but doesn't store the the return code. So the code works correctly but it's messy and upsets the static checkers.

drivers/net/usb/cdc_ncm.c +1 -1
index f74786a..e15ec2b 100644
@@ -66,7 +66,7 @@ static void cdc_ncm_tx_timeout_start(struct cdc_ncm_ctx *ctx);
 static enum hrtimer_restart cdc_ncm_tx_timer_cb(struct hrtimer *hr_timer);
 static struct usb_driver cdc_ncm_driver;
 
-static u8 cdc_ncm_setup(struct usbnet *dev)
+static int cdc_ncm_setup(struct usbnet *dev)
 {
 	struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0];
 	struct usb_cdc_ncm_ntb_parameters ncm_parm;
maintainer Applied
#1 lore raw

From: Dan Carpenter <[email protected]>
Date: Wed, 13 Nov 2013 10:42:34 +0300

Quoted 6 lines

This is harmless but cdc_ncm_setup() returns negative error codes truncated to u8 values. There is only one caller and treats all non-zero returns as errors but doesn't store the the return code. So the code works correctly but it's messy and upsets the static checkers.

Applied, thanks Dan.