[PATCH] staging/media: lirc: style fix - replace hard-coded function names
This patch fixes the remaining coding style warnings in the lirc module. It fixes the following checkpatch.pl warning: WARNING: Prefer using '"%s...", __func__' to using 'read', this function's name, in a string >From f11f24667ba6696cb71ac33a67fc0c7d3b4cd542 Mon Sep 17 00:00:00 2001 From: Martin Homuth Date: Sun, 26 Nov 2017 20:14:33 +0100 Subject: [PATCH] lirc: style fix - replace hard-coded function names Instead of hard coding the function name the __func__ variable should be used. Signed-off-by: Martin Homuth --- drivers/staging/media/lirc/lirc_zilog.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/lirc/lirc_zilog.c b/drivers/staging/media/lirc/lirc_zilog.c index 6bd0717bf76e..be68ee652071 100644 --- a/drivers/staging/media/lirc/lirc_zilog.c +++ b/drivers/staging/media/lirc/lirc_zilog.c @@ -888,9 +888,9 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n, unsigned int m; DECLARE_WAITQUEUE(wait, current); - dev_dbg(ir->dev, "read called\n"); + dev_dbg(ir->dev, "%s called\n", __func__); if (n % rbuf->chunk_size) { - dev_dbg(ir->dev, "read result = -EINVAL\n"); + dev_dbg(ir->dev, "%s result = -EINVAL\n", __func__); return -EINVAL; } @@ -949,7 +949,7 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n, retries++; } if (retries >= 5) { -dev_err(ir->dev, "Buffer read failed!\n"); +dev_err(ir->dev, "%s failed!\n", __func__); ret = -EIO; } } @@ -959,7 +959,7 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n, put_ir_rx(rx, false); set_current_state(TASK_RUNNING); - dev_dbg(ir->dev, "read result = %d (%s)\n", ret, + dev_dbg(ir->dev, "%s result = %d (%s)\n", __func__, ret, ret ? "Error" : "OK"); return ret ? ret : written; -- 2.13.6 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8188eu: Fix private WEXT IOCTL calls
Hi Ishraq, Thank you for the patch! Yet something to improve: [auto build test ERROR on staging/staging-testing] [also build test ERROR on v4.14 next-20171124] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/ishraq-i-ashraf-gmail-com/staging-rtl8188eu-Fix-private-WEXT-IOCTL-calls/20171126-052554 config: x86_64-randconfig-n0-11270329 (attached as .config) compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All error/warnings (new ones prefixed by >>): drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_hostapd_sta_flush_pvt': >> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3101:9: error: implicit >> declaration of function 'rtw_sta_flush'; did you mean 'rtw_set_auth'? >> [-Werror=implicit-function-declaration] return rtw_sta_flush(padapter); ^ rtw_set_auth In file included from include/linux/kernel.h:14:0, from include/linux/skbuff.h:17, from include/linux/if_ether.h:23, from include/linux/ieee80211.h:21, from drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:17: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_add_sta_pvt': >> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3133:49: error: 'union >> ' has no member named 'add_sta' DBG_88E("rtw_add_sta(aid =%d) =%pM\n", param->u.add_sta.aid, (param->sta_addr)); ^ include/linux/printk.h:310:34: note: in definition of macro 'pr_info' printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) ^~~ >> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3133:2: note: in expansion of >> macro 'DBG_88E' DBG_88E("rtw_add_sta(aid =%d) =%pM\n", param->u.add_sta.aid, (param->sta_addr)); ^~~ drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3145:23: error: 'union ' has no member named 'add_sta' int flags = param->u.add_sta.flags; ^ drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3146:23: error: 'union ' has no member named 'add_sta' psta->aid = param->u.add_sta.aid; // aid = 1~2007. ^ drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3148:36: error: 'union ' has no member named 'add_sta' memcpy(psta->bssrateset, param->u.add_sta.tx_supp_rates, 16); ^ >> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3151:7: error: 'WLAN_STA_WME' >> undeclared (first use in this function); did you mean 'SCAN_STATE'? if (WLAN_STA_WME&flags) ^~~~ SCAN_STATE drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3151:7: note: each undeclared identifier is reported only once for each function it appears in >> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3160:7: error: 'WLAN_STA_HT' >> undeclared (first use in this function); did you mean 'WLAN_STA_WME'? if (WLAN_STA_HT&flags) { ^~~ WLAN_STA_WME drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3164:20: error: 'union ' has no member named 'add_sta' ¶m->u.add_sta.ht_cap, ^ >> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3173:3: error: implicit >> declaration of function 'update_sta_info_apmode'; did you mean >> 'update_sta_info'? [-Werror=implicit-function-declaration] update_sta_info_apmode(padapter, psta); ^~ update_sta_info drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_del_sta_pvt': >> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3229:14: error: 'struct >> sta_priv' has no member named 'asoc_list_cnt'; did you mean 'asoc_list_lock'? pstapriv->asoc_list_cnt--; ^ asoc_list_lock >> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3230:14: error: implicit >> declaration of function 'ap_free_sta'; did you mean '__kfree_skb'? >> [-Werror=implicit-function-declaration] updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING); ^~~ __kfree_skb >> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3233:3: error: implicit >> declaration of function 'associated_clients_update' >> [-Werror=implicit-function-declarati
[PATCH] staging: pi433: pi433_if.c codestyle fix
This patch fixes the following checkpatch.pl error: ERROR: spaces required around that '>=' (ctx:VxV) #930: FILE: pi433_if.c:930: + for (i--; i>=0; i--) ERROR: spaces required around that '=' (ctx:VxV) #970: FILE: pi433_if.c:970: + for (i=0; i --- drivers/staging/pi433/pi433_if.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index 2a205c6..d806523 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -927,8 +927,7 @@ static int setup_GPIOs(struct pi433_device *device) { retval = PTR_ERR(device->gpiod[i]); /* release already allocated gpios */ - for (i--; i>=0; i--) - { + for (i--; i >= 0; i--) { free_irq(device->irq_num[i], device); gpiod_put(device->gpiod[i]); } @@ -967,7 +966,7 @@ static void free_GPIOs(struct pi433_device *device) { int i; - for (i=0; igpiod[i]) ) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8188eu: Fix private WEXT IOCTL calls
Hi Ishraq, Thank you for the patch! Yet something to improve: [auto build test ERROR on staging/staging-testing] [also build test ERROR on v4.14 next-20171124] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/ishraq-i-ashraf-gmail-com/staging-rtl8188eu-Fix-private-WEXT-IOCTL-calls/20171126-052554 config: x86_64-randconfig-u0-11270543 (attached as .config) compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_hostapd_sta_flush_pvt': >> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3101:9: error: implicit >> declaration of function 'rtw_sta_flush' >> [-Werror=implicit-function-declaration] return rtw_sta_flush(padapter); ^ In file included from include/linux/kernel.h:14:0, from include/linux/skbuff.h:17, from include/linux/if_ether.h:23, from include/linux/ieee80211.h:21, from drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:17: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_add_sta_pvt': drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3133:49: error: 'union ' has no member named 'add_sta' DBG_88E("rtw_add_sta(aid =%d) =%pM\n", param->u.add_sta.aid, (param->sta_addr)); ^ include/linux/printk.h:310:34: note: in definition of macro 'pr_info' printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) ^ drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3133:2: note: in expansion of macro 'DBG_88E' DBG_88E("rtw_add_sta(aid =%d) =%pM\n", param->u.add_sta.aid, (param->sta_addr)); ^ drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3145:23: error: 'union ' has no member named 'add_sta' int flags = param->u.add_sta.flags; ^ drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3146:23: error: 'union ' has no member named 'add_sta' psta->aid = param->u.add_sta.aid; // aid = 1~2007. ^ drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3148:36: error: 'union ' has no member named 'add_sta' memcpy(psta->bssrateset, param->u.add_sta.tx_supp_rates, 16); ^ >> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3151:7: error: 'WLAN_STA_WME' >> undeclared (first use in this function) if (WLAN_STA_WME&flags) ^ drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3151:7: note: each undeclared identifier is reported only once for each function it appears in >> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3160:7: error: 'WLAN_STA_HT' >> undeclared (first use in this function) if (WLAN_STA_HT&flags) { ^ drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3164:20: error: 'union ' has no member named 'add_sta' ¶m->u.add_sta.ht_cap, ^ >> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3173:3: error: implicit >> declaration of function 'update_sta_info_apmode' >> [-Werror=implicit-function-declaration] update_sta_info_apmode(padapter, psta); ^ drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_del_sta_pvt': >> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3229:12: error: 'struct >> sta_priv' has no member named 'asoc_list_cnt' pstapriv->asoc_list_cnt--; ^ >> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3230:14: error: implicit >> declaration of function 'ap_free_sta' [-Werror=implicit-function-declaration] updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING); ^ drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3233:3: error: implicit declaration of function 'associated_clients_update' [-Werror=implicit-function-declaration] associated_clients_update(padapter, updated); ^ drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_set_beacon_pvt': >> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3276:17: error: 'union >> ' has no member named 'bcn_ie' pbuf = param->u.bcn_ie.buf; ^ drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3283:18: error: 'struct sta_priv' has no member named 'max_num_sta' memcpy(&pstapriv->max_num_sta, param->