ipw2200: Fix permissions setted by DEVICE_ATTR
Subsystems (3)
PATCH 1/1 ipw2200: Fix permissions setted by DEVICE_ATTR
Because xcode_version and rtc only implement the show function and do not provide the store function, so ucode_version and rtc only need the read permission, not need the write permission more.
So, remove the write permission from xcode_version and rtc.
--- drivers/net/wireless/intel/ipw2x00/ipw2200.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/ipw2x00/ipw2200.c +2 -2
@@ -1578,7 +1578,7 @@ static ssize_t show_ucode_version(struct device *d,return sprintf (buf,"0x%08x\n" , tmp); } -static DEVICE_ATTR(ucode_version, 0644, show_ucode_version, NULL); +static DEVICE_ATTR(ucode_version, 0444, show_ucode_version, NULL);static ssize_t show_rtc (struct device *d,struct device_attribute *attr,char *buf)
@@ -1592,7 +1592,7 @@ static ssize_t show_rtc(struct device *d, struct device_attribute *attr,return sprintf (buf,"0x%08x\n" , tmp); } -static DEVICE_ATTR(rtc, 0644, show_rtc, NULL); +static DEVICE_ATTR(rtc, 0444, show_rtc, NULL);/* * Add a device attribute to view/control the delay between eeprom
Signature · 1 line
2.20.1
Quoted 16 lines · Meng Tang
Because
xcode_versionand rtc only implement the show function and do not provide the store function, soucode_versionand rtc only need the read permission, not need the write permission more.So, remove the write permission from
xcode_versionand rtc.Signed-off-by Meng Tang <[email protected]>--- drivers/net/wireless/intel/ipw2x00/ipw2200.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/net/wireless/intel/ipw2x00/ipw2200.c +0
-0
drivers/net/wireless/intel/ipw2x00/ipw2200.c static ssize_t show_ucode_version(struct device *d, · line 1581
Quoted 5 lines
drivers/net/wireless/intel/ipw2x00/ipw2200.c +1
-1@@ -1578,7 +1578,7 @@ static ssize_t show_ucode_version(struct device *d,return sprintf (buf,"0x%08x\n" , tmp); } -static DEVICE_ATTR(ucode_version, 0644, show_ucode_version, NULL); +static DEVICE_ATTR(ucode_version, 0444, show_ucode_version, NULL);
DEVICE_ATTR_RO() exists to make this more obvious. But it looks like you would need to rename the show_ucode_version() to ucode_version_show() in order to use it.
Andrew
Stanislav Yakovlev
maintainerQuoted 5 lines · Meng Tang
Because
xcode_versionand rtc only implement the show function and do not provide the store function, soucode_versionand rtc only need the read permission, not need the write permission more.
Quoted 7 lines
So, remove the write permission from
xcode_versionand rtc.Signed-off-by Meng Tang <[email protected]>--- drivers/net/wireless/intel/ipw2x00/ipw2200.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Looks fine, thanks!
Stanislav.