Linus Torvalds writes: (Summary)
So what I find distasteful here is how sysfs has these "helper" macros
that are clearly designed to over-share.
that are clearly designed to over-share.
The __ATTR macro is a lot more complicated to use than the __ATTR_RO/WO/RW macros, but those macros end up giving everybody read access (ok, not the WO one)
access (ok, not the WO one)
So honestly, I think the "helper" functions should be deprecated simply because they basically encourage people to make everything world-readable.
world-readable.
Which is why most of sysfs is world-readable, whether it makes sense or not.
that are clearly designed to over-share.
The __ATTR macro is a lot more complicated to use than the __ATTR_RO/WO/RW macros, but those macros end up giving everybody read access (ok, not the WO one)
access (ok, not the WO one)
So honestly, I think the "helper" functions should be deprecated simply because they basically encourage people to make everything world-readable.
world-readable.
Which is why most of sysfs is world-readable, whether it makes sense or not.