[PATCH] staging: wlan-ng: Fix sparse warnings about endianness
Fixed sparse warnings about endianness. E.g.: warning: cast to restricted __le16 Signed-off-by: Eric Salem --- drivers/staging/wlan-ng/hfa384x.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h index 60caf9c3..5f1851c 100644 --- a/drivers/staging/wlan-ng/hfa384x.h +++ b/drivers/staging/wlan-ng/hfa384x.h @@ -1388,13 +1388,13 @@ static inline int hfa384x_drvr_getconfig16(struct hfa384x *hw, u16 rid, void *va result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(u16)); if (result == 0) - *((u16 *)val) = le16_to_cpu(*((u16 *)val)); + le16_to_cpus(val); return result; } static inline int hfa384x_drvr_setconfig16(struct hfa384x *hw, u16 rid, u16 val) { - u16 value = cpu_to_le16(val); + __le16 value = cpu_to_le16(val); return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value)); } -- 2.9.3
[PATCH v2] staging: most: hdm-usb: Fix mismatch between types used in sizeof operator
Fixed mismatch between types used in sizeof operator. Signed-off-by: Eric Salem --- drivers/staging/most/hdm-usb/hdm_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c b/drivers/staging/most/hdm-usb/hdm_usb.c index 8a6da16..01e3a31 100644 --- a/drivers/staging/most/hdm-usb/hdm_usb.c +++ b/drivers/staging/most/hdm-usb/hdm_usb.c @@ -145,7 +145,7 @@ static void wq_netinfo(struct work_struct *wq_obj); static inline int drci_rd_reg(struct usb_device *dev, u16 reg, u16 *buf) { int retval; - __le16 *dma_buf = kzalloc(sizeof(__le16), GFP_KERNEL); + __le16 *dma_buf = kzalloc(sizeof(*dma_buf), GFP_KERNEL); u8 req_type = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; if (!dma_buf) @@ -154,7 +154,7 @@ static inline int drci_rd_reg(struct usb_device *dev, u16 reg, u16 *buf) retval = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), DRCI_READ_REQ, req_type, 0x, -reg, dma_buf, sizeof(u16), 5 * HZ); +reg, dma_buf, sizeof(*dma_buf), 5 * HZ); *buf = le16_to_cpu(*dma_buf); kfree(dma_buf); -- 2.9.3 On 01/10/2017 10:40 AM, Greg KH wrote: > On Mon, Jan 09, 2017 at 09:25:56PM -0600, Eric Salem wrote: >> Fixed the following sparse warning: >> >> drivers/staging/most/hdm-usb/hdm_usb.c:158:16: warning: >> cast to restricted __le16 >> >> by correcting the variable's type (also updated sizeof). >> >> Signed-off-by: Eric Salem >> Acked-by: Christian Gromm >> --- >> drivers/staging/most/hdm-usb/hdm_usb.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) > > This patch doesn't apply against linux-next, can you refresh it and > resend? > > thanks, > > greg k-h >
[PATCH] staging: most: hdm-usb: Fix sparse warning cast to restricted __le16
Fixed the following sparse warning: drivers/staging/most/hdm-usb/hdm_usb.c:158:16: warning: cast to restricted __le16 by correcting the variable's type (also updated sizeof). Signed-off-by: Eric Salem --- drivers/staging/most/hdm-usb/hdm_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c b/drivers/staging/most/hdm-usb/hdm_usb.c index d6db0bd..01e3a31 100644 --- a/drivers/staging/most/hdm-usb/hdm_usb.c +++ b/drivers/staging/most/hdm-usb/hdm_usb.c @@ -145,7 +145,7 @@ static void wq_netinfo(struct work_struct *wq_obj); static inline int drci_rd_reg(struct usb_device *dev, u16 reg, u16 *buf) { int retval; - u16 *dma_buf = kzalloc(sizeof(u16), GFP_KERNEL); + __le16 *dma_buf = kzalloc(sizeof(*dma_buf), GFP_KERNEL); u8 req_type = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; if (!dma_buf) @@ -154,7 +154,7 @@ static inline int drci_rd_reg(struct usb_device *dev, u16 reg, u16 *buf) retval = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), DRCI_READ_REQ, req_type, 0x, -reg, dma_buf, sizeof(u16), 5 * HZ); +reg, dma_buf, sizeof(*dma_buf), 5 * HZ); *buf = le16_to_cpu(*dma_buf); kfree(dma_buf); -- 2.9.3
[PATCH v2] Staging: android: fixed permissions style issue
Fixed a coding style issue. Changed symbolic permissions to octal. Signed-off-by: Eric Salem --- drivers/staging/android/lowmemorykiller.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c index 80d7adf..ec3b665 100644 --- a/drivers/staging/android/lowmemorykiller.c +++ b/drivers/staging/android/lowmemorykiller.c @@ -204,10 +204,9 @@ device_initcall(lowmem_init); * not really modular, but the easiest way to keep compat with existing * bootargs behaviour is to continue using module_param here. */ -module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR); -module_param_array_named(adj, lowmem_adj, short, &lowmem_adj_size, -S_IRUGO | S_IWUSR); +module_param_named(cost, lowmem_shrinker.seeks, int, 0644); +module_param_array_named(adj, lowmem_adj, short, &lowmem_adj_size, 0644); module_param_array_named(minfree, lowmem_minfree, uint, &lowmem_minfree_size, -S_IRUGO | S_IWUSR); -module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR); +0644); +module_param_named(debug_level, lowmem_debug_level, uint, 0644); -- 2.7.4 On 09/25/2016 10:00 PM, Joe Perches wrote: > On Sun, 2016-09-25 at 21:47 -0500, Eric Salem wrote: >> Fixed a coding style issue. Changed symbolic permissions to octal. > > If you do these, please shorten the lines where possible. > >> diff --git a/drivers/staging/android/lowmemorykiller.c >> b/drivers/staging/android/lowmemorykiller.c > [] >> @@ -204,10 +204,10 @@ device_initcall(lowmem_init); >> * not really modular, but the easiest way to keep compat with existing >> * bootargs behaviour is to continue using module_param here. >> */ >> -module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR); >> +module_param_named(cost, lowmem_shrinker.seeks, int, 0644); >> module_param_array_named(adj, lowmem_adj, short, &lowmem_adj_size, >> - S_IRUGO | S_IWUSR); >> + 0644); > > module_param_array_named(adj, lowmem_adj, short, &lowmem_adj_size, 0644); > > etc... >
[PATCH] Staging: android: fixed permissions style issue
Fixed a coding style issue. Changed symbolic permissions to octal. Signed-off-by: Eric Salem --- drivers/staging/android/lowmemorykiller.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c index 80d7adf..553a3ee 100644 --- a/drivers/staging/android/lowmemorykiller.c +++ b/drivers/staging/android/lowmemorykiller.c @@ -204,10 +204,10 @@ device_initcall(lowmem_init); * not really modular, but the easiest way to keep compat with existing * bootargs behaviour is to continue using module_param here. */ -module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR); +module_param_named(cost, lowmem_shrinker.seeks, int, 0644); module_param_array_named(adj, lowmem_adj, short, &lowmem_adj_size, -S_IRUGO | S_IWUSR); +0644); module_param_array_named(minfree, lowmem_minfree, uint, &lowmem_minfree_size, -S_IRUGO | S_IWUSR); -module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR); +0644); +module_param_named(debug_level, lowmem_debug_level, uint, 0644); -- 2.7.4