cfg80211 debugfs: Cleanup some checkpatch issues
Subsystems (3)
PATCH 1/1 cfg80211 debugfs: Cleanup some checkpatch issues
This fixes the checkpatch.pl warnings:
* Macros should not use a trailing semicolon.
* Spaces required around that '='.
* Symbolic permissions 'S_IRUGO' are not preferred.
* Macro argument reuse 'buflen' - possible side-effects
--- net/wireless/debugfs.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
net/wireless/debugfs.c +8 -7
@@ -17,11 +17,12 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \size_t count,loff_t *ppos) \ { \ -struct wiphy *wiphy= file->private_data; \ -char buf[buflen]; \ +struct wiphy *wiphy = file->private_data; \ +int __buflen =__builtin_constant_p (buflen) ? buflen :-1 ; \ +char buf[__buflen]; \int res; \ \ - res = scnprintf(buf, buflen, fmt "\n", ##value); \ + res = scnprintf(buf, __buflen, fmt "\n", ##value); \return simple_read_from_buffer (userbuf, count, ppos, buf, res); \ } \ \
@@ -29,14 +30,14 @@ static const struct file_operations name## _ops = { \ .read = name## _read, \ .open = simple_open, \ .llseek = generic_file_llseek, \ -}; +}DEBUGFS_READONLY_FILE (rts_threshold,20 ,"%d" , - wiphy->rts_threshold) + wiphy->rts_threshold);DEBUGFS_READONLY_FILE (fragmentation_threshold,20 ,"%d" , wiphy->frag_threshold);DEBUGFS_READONLY_FILE (short_retry_limit,20 ,"%d" , - wiphy->retry_short) + wiphy->retry_short);DEBUGFS_READONLY_FILE (long_retry_limit,20 ,"%d" , wiphy->retry_long);
@@ -103,7 +104,7 @@ static const struct file_operations ht40allow_map_ops = { };#define DEBUGFS_ADD (name) \ - debugfs_create_file(#name, S_IRUGO, phyd, &rdev->wiphy, &name## _ops); + debugfs_create_file(#name, 0444, phyd, &rdev->wiphy, &name## _ops)void cfg80211_debugfs_rdev_add (struct cfg80211_registered_device *rdev) {
Signature · 1 line
2.7.4
Quoted 4 lines · Pichugin Dmitry
This fixes the checkpatch.pl warnings:
* Macros should not use a trailing semicolon.
* Spaces required around that '='.
* Symbolic permissions 'S_IRUGO' are not preferred.
OK
Quoted 1 line
* Macro argument reuse 'buflen' - possible side-effects
Not all checkpatch messages need fixing.
This is one of them.
net/wireless/debugfs.c
Quoted 1 line
net/wireless/debugfs.c +0
-0
[]
net/wireless/debugfs.c line 22
Quoted 9 lines
net/wireless/debugfs.c +3
-2@@ -17,11 +17,12 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \size_t count,loff_t *ppos) \ { \ -struct wiphy *wiphy= file->private_data; \ -char buf[buflen]; \ +struct wiphy *wiphy = file->private_data; \ +int __buflen =__builtin_constant_p (buflen) ? buflen :-1 ; \ +char buf[__buflen]; \
That's rather an odd change too
Quoted 15 lines · Joe Perches
Quoted 4 lines · Pichugin Dmitry
This fixes the checkpatch.pl warnings:
* Macros should not use a trailing semicolon.
* Spaces required around that '='.
* Symbolic permissions 'S_IRUGO' are not preferred.OK
Quoted 1 line
* Macro argument reuse 'buflen' - possible side-effects
Not all checkpatch messages need fixing.
This is one of them.net/wireless/debugfs.c
Quoted 1 line
net/wireless/debugfs.c +0
-0[]
Quoted 12 lines
net/wireless/debugfs.c line 22
Quoted 9 lines
net/wireless/debugfs.c +3
-2@@ -17,11 +17,12 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \size_t count,loff_t *ppos) \ { \ -struct wiphy *wiphy= file->private_data; \ -char buf[buflen]; \ +struct wiphy *wiphy = file->private_data; \ +int __buflen =__builtin_constant_p (buflen) ? buflen :-1 ; \ +char buf[__buflen]; \That's rather an odd change too
OK. I will update the patch.
Best Regards,
Dmitriy.
Johannes Berg
maintainerQuoted 5 lines · Pichugin Dmitry
This fixes the checkpatch.pl warnings:
* Macros should not use a trailing semicolon.
* Spaces required around that '='.
* Symbolic permissions 'S_IRUGO' are not preferred.
* Macro argument reuse 'buflen' - possible side-effects
I really see no point in any of this.
johannes
Quoted 8 lines · Johannes Berg
Quoted 5 lines · Pichugin Dmitry
This fixes the checkpatch.pl warnings:
* Macros should not use a trailing semicolon.
* Spaces required around that '='.
* Symbolic permissions 'S_IRUGO' are not preferred.
* Macro argument reuse 'buflen' - possible side-effectsI really see no point in any of this.
Look at the uses of DEBUGFS_READONLY_FILE and
see if they are consistent before and after.
DEBUGFS_READONLY_FILE(rts_threshold, 20, "%d",
- wiphy->rts_threshold)
+ wiphy->rts_threshold);
DEBUGFS_READONLY_FILE(fragmentation_threshold, 20, "%d",
wiphy->frag_threshold);
DEBUGFS_READONLY_FILE(short_retry_limit, 20, "%d",
- wiphy->retry_short)
+ wiphy->retry_short);
DEBUGFS_READONLY_FILE(long_retry_limit, 20, "%d",
wiphy->retry_long);