Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] Driver core: Documentation: fix whitespace between parameters

Fix whitespace after comma between parameters.

Signed-off-by: Jan Veldeman <Jan.Veldeman@advalvas.be>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Jan Veldeman and committed by
Greg Kroah-Hartman
f8d825bf 9a8af6b3

+13 -13
+13 -13
Documentation/filesystems/sysfs.txt
··· 90 90 91 91 It also defines this helper for defining device attributes: 92 92 93 - #define DEVICE_ATTR(_name,_mode,_show,_store) \ 93 + #define DEVICE_ATTR(_name, _mode, _show, _store) \ 94 94 struct device_attribute dev_attr_##_name = { \ 95 95 .attr = {.name = __stringify(_name) , .mode = _mode }, \ 96 96 .show = _show, \ ··· 99 99 100 100 For example, declaring 101 101 102 - static DEVICE_ATTR(foo,0644,show_foo,store_foo); 102 + static DEVICE_ATTR(foo, 0644, show_foo, store_foo); 103 103 104 104 is equivalent to doing: 105 105 ··· 121 121 show and store methods of the attribute owners. 122 122 123 123 struct sysfs_ops { 124 - ssize_t (*show)(struct kobject *, struct attribute *,char *); 125 - ssize_t (*store)(struct kobject *,struct attribute *,const char *); 124 + ssize_t (*show)(struct kobject *, struct attribute *, char *); 125 + ssize_t (*store)(struct kobject *, struct attribute *, const char *); 126 126 }; 127 127 128 128 [ Subsystems should have already defined a struct kobj_type as a ··· 137 137 138 138 To illustrate: 139 139 140 - #define to_dev_attr(_attr) container_of(_attr,struct device_attribute,attr) 140 + #define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr) 141 141 #define to_dev(d) container_of(d, struct device, kobj) 142 142 143 143 static ssize_t ··· 148 148 ssize_t ret = 0; 149 149 150 150 if (dev_attr->show) 151 - ret = dev_attr->show(dev,buf); 151 + ret = dev_attr->show(dev, buf); 152 152 return ret; 153 153 } 154 154 ··· 216 216 217 217 static ssize_t show_name(struct device *dev, struct device_attribute *attr, char *buf) 218 218 { 219 - return sprintf(buf,"%s\n",dev->name); 219 + return snprintf(buf, PAGE_SIZE, "%s\n", dev->name); 220 220 } 221 221 222 222 static ssize_t store_name(struct device * dev, const char * buf) 223 223 { 224 - sscanf(buf,"%20s",dev->name); 225 - return strlen(buf); 224 + sscanf(buf, "%20s", dev->name); 225 + return strnlen(buf, PAGE_SIZE); 226 226 } 227 227 228 - static DEVICE_ATTR(name,S_IRUGO,show_name,store_name); 228 + static DEVICE_ATTR(name, S_IRUGO, show_name, store_name); 229 229 230 230 231 231 (Note that the real implementation doesn't allow userspace to set the ··· 290 290 291 291 Declaring: 292 292 293 - DEVICE_ATTR(_name,_str,_mode,_show,_store); 293 + DEVICE_ATTR(_name, _str, _mode, _show, _store); 294 294 295 295 Creation/Removal: 296 296 ··· 310 310 311 311 Declaring: 312 312 313 - BUS_ATTR(_name,_mode,_show,_store) 313 + BUS_ATTR(_name, _mode, _show, _store) 314 314 315 315 Creation/Removal: 316 316 ··· 331 331 332 332 Declaring: 333 333 334 - DRIVER_ATTR(_name,_mode,_show,_store) 334 + DRIVER_ATTR(_name, _mode, _show, _store) 335 335 336 336 Creation/Removal: 337 337