* [PATCH v2] staging: rtlwifi: convert to DEFINE_SHOW_ATTRIBUTE
@ 2018-12-21 15:44 Yangtao Li
2018-12-22 6:49 ` kbuild test robot
2018-12-22 15:00 ` kbuild test robot
0 siblings, 2 replies; 4+ messages in thread
From: Yangtao Li @ 2018-12-21 15:44 UTC (permalink / raw)
To: gregkh, natechancellor, kernelpatch; +Cc: devel, linux-kernel, Yangtao Li
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
v2:
-modify RTL_DEBUGFS_ADD_CORE macro
---
drivers/staging/rtlwifi/debug.c | 23 ++++++-----------------
1 file changed, 6 insertions(+), 17 deletions(-)
diff --git a/drivers/staging/rtlwifi/debug.c b/drivers/staging/rtlwifi/debug.c
index 8999feda29b4..dd1cc27e9544 100644
--- a/drivers/staging/rtlwifi/debug.c
+++ b/drivers/staging/rtlwifi/debug.c
@@ -79,24 +79,13 @@ struct rtl_debugfs_priv {
static struct dentry *debugfs_topdir;
-static int rtl_debug_get_common(struct seq_file *m, void *v)
+static int common_show(struct seq_file *m, void *v)
{
struct rtl_debugfs_priv *debugfs_priv = m->private;
return debugfs_priv->cb_read(m, v);
}
-
-static int dl_debug_open_common(struct inode *inode, struct file *file)
-{
- return single_open(file, rtl_debug_get_common, inode->i_private);
-}
-
-static const struct file_operations file_ops_common = {
- .open = dl_debug_open_common,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(common);
static int rtl_debug_get_mac_page(struct seq_file *m, void *v)
{
@@ -439,7 +428,7 @@ static ssize_t rtl_debugfs_common_write(struct file *filp,
return debugfs_priv->cb_write(filp, buffer, count, loff);
}
-static const struct file_operations file_ops_common_write = {
+static const struct file_operations common_write_fops = {
.owner = THIS_MODULE,
.write = rtl_debugfs_common_write,
.open = simple_open,
@@ -488,7 +477,7 @@ static int rtl_debugfs_open_rw(struct inode *inode, struct file *filp)
int ret = 0;
if (filp->f_mode & FMODE_READ)
- ret = single_open(filp, rtl_debug_get_common, inode->i_private);
+ ret = single_open(filp, common_show, inode->i_private);
else
filp->private_data = inode->i_private;
@@ -509,7 +498,7 @@ static struct rtl_debugfs_priv rtl_debug_priv_phydm_cmd = {
.cb_data = 0,
};
-static const struct file_operations file_ops_common_rw = {
+static const struct file_operations common_rw_fops = {
.owner = THIS_MODULE,
.open = rtl_debugfs_open_rw,
.release = rtl_debugfs_close_rw,
@@ -523,7 +512,7 @@ static const struct file_operations file_ops_common_rw = {
rtl_debug_priv_ ##name.rtlpriv = rtlpriv; \
debugfs_create_file(#name, mode, parent, \
&rtl_debug_priv_ ##name, \
- &file_ops_ ##fopname); \
+ &fopname_ ##fops); \
} while (0)
#define RTL_DEBUGFS_ADD(name) \
--
2.17.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] staging: rtlwifi: convert to DEFINE_SHOW_ATTRIBUTE
2018-12-21 15:44 [PATCH v2] staging: rtlwifi: convert to DEFINE_SHOW_ATTRIBUTE Yangtao Li
@ 2018-12-22 6:49 ` kbuild test robot
2018-12-22 7:54 ` Frank Lee
2018-12-22 15:00 ` kbuild test robot
1 sibling, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2018-12-22 6:49 UTC (permalink / raw)
To: Yangtao Li
Cc: kbuild-all, gregkh, natechancellor, kernelpatch, devel,
Yangtao Li, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 3486 bytes --]
Hi Yangtao,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v4.20-rc7 next-20181221]
[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/Yangtao-Li/staging-rtlwifi-convert-to-DEFINE_SHOW_ATTRIBUTE/20181222-085444
config: i386-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
drivers/staging/rtlwifi/debug.c: In function 'rtl_debug_add_one':
drivers/staging/rtlwifi/debug.c:515:10: error: 'fopname_fops' undeclared (first use in this function); did you mean 'replace_fops'?
&fopname_ ##fops); \
^
>> drivers/staging/rtlwifi/debug.c:519:3: note: in expansion of macro 'RTL_DEBUGFS_ADD_CORE'
RTL_DEBUGFS_ADD_CORE(name, S_IFREG | 0444, common)
^~~~~~~~~~~~~~~~~~~~
drivers/staging/rtlwifi/debug.c:545:2: note: in expansion of macro 'RTL_DEBUGFS_ADD'
RTL_DEBUGFS_ADD(mac_0);
^~~~~~~~~~~~~~~
drivers/staging/rtlwifi/debug.c:515:10: note: each undeclared identifier is reported only once for each function it appears in
&fopname_ ##fops); \
^
>> drivers/staging/rtlwifi/debug.c:519:3: note: in expansion of macro 'RTL_DEBUGFS_ADD_CORE'
RTL_DEBUGFS_ADD_CORE(name, S_IFREG | 0444, common)
^~~~~~~~~~~~~~~~~~~~
drivers/staging/rtlwifi/debug.c:545:2: note: in expansion of macro 'RTL_DEBUGFS_ADD'
RTL_DEBUGFS_ADD(mac_0);
^~~~~~~~~~~~~~~
vim +/RTL_DEBUGFS_ADD_CORE +519 drivers/staging/rtlwifi/debug.c
56bde846 Ping-Ke Shih 2017-08-17 509
56bde846 Ping-Ke Shih 2017-08-17 510 #define RTL_DEBUGFS_ADD_CORE(name, mode, fopname) \
56bde846 Ping-Ke Shih 2017-08-17 511 do { \
56bde846 Ping-Ke Shih 2017-08-17 512 rtl_debug_priv_ ##name.rtlpriv = rtlpriv; \
e206a0d4 Greg Kroah-Hartman 2018-05-29 513 debugfs_create_file(#name, mode, parent, \
e206a0d4 Greg Kroah-Hartman 2018-05-29 514 &rtl_debug_priv_ ##name, \
e8b4e2be Yangtao Li 2018-12-21 @515 &fopname_ ##fops); \
56bde846 Ping-Ke Shih 2017-08-17 516 } while (0)
56bde846 Ping-Ke Shih 2017-08-17 517
56bde846 Ping-Ke Shih 2017-08-17 518 #define RTL_DEBUGFS_ADD(name) \
56bde846 Ping-Ke Shih 2017-08-17 @519 RTL_DEBUGFS_ADD_CORE(name, S_IFREG | 0444, common)
56bde846 Ping-Ke Shih 2017-08-17 520 #define RTL_DEBUGFS_ADD_W(name) \
b55ade19 Larry Finger 2017-08-24 521 RTL_DEBUGFS_ADD_CORE(name, S_IFREG | 0222, common_write)
56bde846 Ping-Ke Shih 2017-08-17 522 #define RTL_DEBUGFS_ADD_RW(name) \
b55ade19 Larry Finger 2017-08-24 523 RTL_DEBUGFS_ADD_CORE(name, S_IFREG | 0666, common_rw)
56bde846 Ping-Ke Shih 2017-08-17 524
:::::: The code at line 519 was first introduced by commit
:::::: 56bde846304ea05d5f8c8de0e3a42627a7a92be6 staging: r8822be: Add existing rtlwifi and rtl_pci parts for new driver
:::::: TO: Ping-Ke Shih <pkshih@realtek.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 66062 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] staging: rtlwifi: convert to DEFINE_SHOW_ATTRIBUTE
2018-12-22 6:49 ` kbuild test robot
@ 2018-12-22 7:54 ` Frank Lee
0 siblings, 0 replies; 4+ messages in thread
From: Frank Lee @ 2018-12-22 7:54 UTC (permalink / raw)
Cc: Greg Kroah-Hartman, Nathan Chancellor, kernelpatch, devel,
Linux Kernel Mailing List
Sorry!!!Please ignore this.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] staging: rtlwifi: convert to DEFINE_SHOW_ATTRIBUTE
2018-12-21 15:44 [PATCH v2] staging: rtlwifi: convert to DEFINE_SHOW_ATTRIBUTE Yangtao Li
2018-12-22 6:49 ` kbuild test robot
@ 2018-12-22 15:00 ` kbuild test robot
1 sibling, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2018-12-22 15:00 UTC (permalink / raw)
To: Yangtao Li
Cc: kbuild-all, gregkh, natechancellor, kernelpatch, devel,
Yangtao Li, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2226 bytes --]
Hi Yangtao,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.20-rc7 next-20181221]
[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/Yangtao-Li/staging-rtlwifi-convert-to-DEFINE_SHOW_ATTRIBUTE/20181222-085444
config: x86_64-randconfig-r0-12221938 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
drivers/staging/rtlwifi/debug.c: In function 'rtl_debug_add_one':
>> drivers/staging/rtlwifi/debug.c:515:10: error: 'fopname_fops' undeclared (first use in this function)
&fopname_ ##fops); \
^
drivers/staging/rtlwifi/debug.c:519:3: note: in expansion of macro 'RTL_DEBUGFS_ADD_CORE'
RTL_DEBUGFS_ADD_CORE(name, S_IFREG | 0444, common)
^~~~~~~~~~~~~~~~~~~~
drivers/staging/rtlwifi/debug.c:545:2: note: in expansion of macro 'RTL_DEBUGFS_ADD'
RTL_DEBUGFS_ADD(mac_0);
^~~~~~~~~~~~~~~
drivers/staging/rtlwifi/debug.c:515:10: note: each undeclared identifier is reported only once for each function it appears in
&fopname_ ##fops); \
^
drivers/staging/rtlwifi/debug.c:519:3: note: in expansion of macro 'RTL_DEBUGFS_ADD_CORE'
RTL_DEBUGFS_ADD_CORE(name, S_IFREG | 0444, common)
^~~~~~~~~~~~~~~~~~~~
drivers/staging/rtlwifi/debug.c:545:2: note: in expansion of macro 'RTL_DEBUGFS_ADD'
RTL_DEBUGFS_ADD(mac_0);
^~~~~~~~~~~~~~~
vim +/fopname_fops +515 drivers/staging/rtlwifi/debug.c
509
510 #define RTL_DEBUGFS_ADD_CORE(name, mode, fopname) \
511 do { \
512 rtl_debug_priv_ ##name.rtlpriv = rtlpriv; \
513 debugfs_create_file(#name, mode, parent, \
514 &rtl_debug_priv_ ##name, \
> 515 &fopname_ ##fops); \
516 } while (0)
517
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31627 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-12-22 19:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-21 15:44 [PATCH v2] staging: rtlwifi: convert to DEFINE_SHOW_ATTRIBUTE Yangtao Li
2018-12-22 6:49 ` kbuild test robot
2018-12-22 7:54 ` Frank Lee
2018-12-22 15:00 ` kbuild test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.