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

Configure Feed

Select the types of activity you want to include in your feed.

driver core: bus: mark the struct bus_type for sysfs callbacks as constant

struct bus_type should never be modified in a sysfs callback as there is
nothing in the structure to modify, and frankly, the structure is almost
never used in a sysfs callback, so mark it as constant to allow struct
bus_type to be moved to read-only memory.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Alexandre Bounine <alex.bou9@gmail.com>
Cc: Alison Schofield <alison.schofield@intel.com>
Cc: Ben Widawsky <bwidawsk@kernel.org>
Cc: Dexuan Cui <decui@microsoft.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Harald Freudenberger <freude@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Hu Haowen <src.res@email.cn>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Stuart Yoder <stuyoder@gmail.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: Yanteng Si <siyanteng@loongson.cn>
Acked-by: Ilya Dryomov <idryomov@gmail.com> # rbd
Acked-by: Ira Weiny <ira.weiny@intel.com> # cxl
Reviewed-by: Alex Shi <alexs@kernel.org>
Acked-by: Iwona Winiarska <iwona.winiarska@intel.com>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com> # pci
Acked-by: Wei Liu <wei.liu@kernel.org>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com> # scsi
Link: https://lore.kernel.org/r/20230313182918.1312597-23-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+78 -88
+2 -2
Documentation/driver-api/driver-model/bus.rst
··· 125 125 126 126 struct bus_attribute { 127 127 struct attribute attr; 128 - ssize_t (*show)(struct bus_type *, char * buf); 129 - ssize_t (*store)(struct bus_type *, const char * buf, size_t count); 128 + ssize_t (*show)(const struct bus_type *, char * buf); 129 + ssize_t (*store)(const struct bus_type *, const char * buf, size_t count); 130 130 }; 131 131 132 132 Bus drivers can export attributes using the BUS_ATTR_RW macro that works
+2 -2
Documentation/filesystems/sysfs.rst
··· 373 373 374 374 struct bus_attribute { 375 375 struct attribute attr; 376 - ssize_t (*show)(struct bus_type *, char * buf); 377 - ssize_t (*store)(struct bus_type *, const char * buf, size_t count); 376 + ssize_t (*show)(const struct bus_type *, char * buf); 377 + ssize_t (*store)(const struct bus_type *, const char * buf, size_t count); 378 378 }; 379 379 380 380 Declaring::
+2 -2
Documentation/translations/zh_CN/filesystems/sysfs.txt
··· 329 329 330 330 struct bus_attribute { 331 331 struct attribute attr; 332 - ssize_t (*show)(struct bus_type *, char * buf); 333 - ssize_t (*store)(struct bus_type *, const char * buf, size_t count); 332 + ssize_t (*show)(const struct bus_type *, char * buf); 333 + ssize_t (*store)(const struct bus_type *, const char * buf, size_t count); 334 334 }; 335 335 336 336 声明:
+2 -2
Documentation/translations/zh_TW/filesystems/sysfs.txt
··· 332 332 333 333 struct bus_attribute { 334 334 struct attribute attr; 335 - ssize_t (*show)(struct bus_type *, char * buf); 336 - ssize_t (*store)(struct bus_type *, const char * buf, size_t count); 335 + ssize_t (*show)(const struct bus_type *, char * buf); 336 + ssize_t (*store)(const struct bus_type *, const char * buf, size_t count); 337 337 }; 338 338 339 339 聲明:
+2 -2
arch/powerpc/platforms/pseries/ibmebus.c
··· 267 267 return out; 268 268 } 269 269 270 - static ssize_t probe_store(struct bus_type *bus, const char *buf, size_t count) 270 + static ssize_t probe_store(const struct bus_type *bus, const char *buf, size_t count) 271 271 { 272 272 struct device_node *dn = NULL; 273 273 struct device *dev; ··· 305 305 } 306 306 static BUS_ATTR_WO(probe); 307 307 308 - static ssize_t remove_store(struct bus_type *bus, const char *buf, size_t count) 308 + static ssize_t remove_store(const struct bus_type *bus, const char *buf, size_t count) 309 309 { 310 310 struct device *dev; 311 311 char *path;
+4 -4
arch/powerpc/platforms/pseries/vio.c
··· 1006 1006 /* sysfs bus functions and data structures for CMO */ 1007 1007 1008 1008 #define viobus_cmo_rd_attr(name) \ 1009 - static ssize_t cmo_bus_##name##_show(struct bus_type *bt, char *buf) \ 1009 + static ssize_t cmo_bus_##name##_show(const struct bus_type *bt, char *buf) \ 1010 1010 { \ 1011 1011 return sprintf(buf, "%lu\n", vio_cmo.name); \ 1012 1012 } \ ··· 1015 1015 1016 1016 #define viobus_cmo_pool_rd_attr(name, var) \ 1017 1017 static ssize_t \ 1018 - cmo_##name##_##var##_show(struct bus_type *bt, char *buf) \ 1018 + cmo_##name##_##var##_show(const struct bus_type *bt, char *buf) \ 1019 1019 { \ 1020 1020 return sprintf(buf, "%lu\n", vio_cmo.name.var); \ 1021 1021 } \ ··· 1030 1030 viobus_cmo_pool_rd_attr(excess, size); 1031 1031 viobus_cmo_pool_rd_attr(excess, free); 1032 1032 1033 - static ssize_t cmo_high_show(struct bus_type *bt, char *buf) 1033 + static ssize_t cmo_high_show(const struct bus_type *bt, char *buf) 1034 1034 { 1035 1035 return sprintf(buf, "%lu\n", vio_cmo.high); 1036 1036 } 1037 1037 1038 - static ssize_t cmo_high_store(struct bus_type *bt, const char *buf, 1038 + static ssize_t cmo_high_store(const struct bus_type *bt, const char *buf, 1039 1039 size_t count) 1040 1040 { 1041 1041 unsigned long flags;
+2 -4
drivers/ata/pata_parport/pata_parport.c
··· 554 554 } 555 555 EXPORT_SYMBOL_GPL(pata_parport_unregister_driver); 556 556 557 - static ssize_t new_device_store(struct bus_type *bus, const char *buf, 558 - size_t count) 557 + static ssize_t new_device_store(const struct bus_type *bus, const char *buf, size_t count) 559 558 { 560 559 char port[12] = "auto"; 561 560 char protocol[8] = "auto"; ··· 629 630 /* pata_parport_dev_release will do kfree(pi) */ 630 631 } 631 632 632 - static ssize_t delete_device_store(struct bus_type *bus, const char *buf, 633 - size_t count) 633 + static ssize_t delete_device_store(const struct bus_type *bus, const char *buf, size_t count) 634 634 { 635 635 struct device *dev; 636 636
+4 -4
drivers/base/bus.c
··· 274 274 } 275 275 static DRIVER_ATTR_IGNORE_LOCKDEP(bind, 0200, NULL, bind_store); 276 276 277 - static ssize_t drivers_autoprobe_show(struct bus_type *bus, char *buf) 277 + static ssize_t drivers_autoprobe_show(const struct bus_type *bus, char *buf) 278 278 { 279 279 struct subsys_private *sp = bus_to_subsys(bus); 280 280 int ret; ··· 287 287 return ret; 288 288 } 289 289 290 - static ssize_t drivers_autoprobe_store(struct bus_type *bus, 290 + static ssize_t drivers_autoprobe_store(const struct bus_type *bus, 291 291 const char *buf, size_t count) 292 292 { 293 293 struct subsys_private *sp = bus_to_subsys(bus); ··· 304 304 return count; 305 305 } 306 306 307 - static ssize_t drivers_probe_store(struct bus_type *bus, 307 + static ssize_t drivers_probe_store(const struct bus_type *bus, 308 308 const char *buf, size_t count) 309 309 { 310 310 struct device *dev; ··· 808 808 put_device(dev); 809 809 } 810 810 811 - static ssize_t bus_uevent_store(struct bus_type *bus, 811 + static ssize_t bus_uevent_store(const struct bus_type *bus, 812 812 const char *buf, size_t count) 813 813 { 814 814 struct subsys_private *sp = bus_to_subsys(bus);
+15 -19
drivers/block/rbd.c
··· 491 491 module_param(single_major, bool, 0444); 492 492 MODULE_PARM_DESC(single_major, "Use a single major number for all rbd devices (default: true)"); 493 493 494 - static ssize_t add_store(struct bus_type *bus, const char *buf, size_t count); 495 - static ssize_t remove_store(struct bus_type *bus, const char *buf, 494 + static ssize_t add_store(const struct bus_type *bus, const char *buf, size_t count); 495 + static ssize_t remove_store(const struct bus_type *bus, const char *buf, 496 496 size_t count); 497 - static ssize_t add_single_major_store(struct bus_type *bus, const char *buf, 497 + static ssize_t add_single_major_store(const struct bus_type *bus, const char *buf, 498 498 size_t count); 499 - static ssize_t remove_single_major_store(struct bus_type *bus, const char *buf, 499 + static ssize_t remove_single_major_store(const struct bus_type *bus, const char *buf, 500 500 size_t count); 501 501 static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth); 502 502 ··· 538 538 return is_lock_owner; 539 539 } 540 540 541 - static ssize_t supported_features_show(struct bus_type *bus, char *buf) 541 + static ssize_t supported_features_show(const struct bus_type *bus, char *buf) 542 542 { 543 543 return sprintf(buf, "0x%llx\n", RBD_FEATURES_SUPPORTED); 544 544 } ··· 6967 6967 return ret; 6968 6968 } 6969 6969 6970 - static ssize_t do_rbd_add(struct bus_type *bus, 6971 - const char *buf, 6972 - size_t count) 6970 + static ssize_t do_rbd_add(const char *buf, size_t count) 6973 6971 { 6974 6972 struct rbd_device *rbd_dev = NULL; 6975 6973 struct ceph_options *ceph_opts = NULL; ··· 7079 7081 goto out; 7080 7082 } 7081 7083 7082 - static ssize_t add_store(struct bus_type *bus, const char *buf, size_t count) 7084 + static ssize_t add_store(const struct bus_type *bus, const char *buf, size_t count) 7083 7085 { 7084 7086 if (single_major) 7085 7087 return -EINVAL; 7086 7088 7087 - return do_rbd_add(bus, buf, count); 7089 + return do_rbd_add(buf, count); 7088 7090 } 7089 7091 7090 - static ssize_t add_single_major_store(struct bus_type *bus, const char *buf, 7092 + static ssize_t add_single_major_store(const struct bus_type *bus, const char *buf, 7091 7093 size_t count) 7092 7094 { 7093 - return do_rbd_add(bus, buf, count); 7095 + return do_rbd_add(buf, count); 7094 7096 } 7095 7097 7096 7098 static void rbd_dev_remove_parent(struct rbd_device *rbd_dev) ··· 7120 7122 } 7121 7123 } 7122 7124 7123 - static ssize_t do_rbd_remove(struct bus_type *bus, 7124 - const char *buf, 7125 - size_t count) 7125 + static ssize_t do_rbd_remove(const char *buf, size_t count) 7126 7126 { 7127 7127 struct rbd_device *rbd_dev = NULL; 7128 7128 struct list_head *tmp; ··· 7192 7196 return count; 7193 7197 } 7194 7198 7195 - static ssize_t remove_store(struct bus_type *bus, const char *buf, size_t count) 7199 + static ssize_t remove_store(const struct bus_type *bus, const char *buf, size_t count) 7196 7200 { 7197 7201 if (single_major) 7198 7202 return -EINVAL; 7199 7203 7200 - return do_rbd_remove(bus, buf, count); 7204 + return do_rbd_remove(buf, count); 7201 7205 } 7202 7206 7203 - static ssize_t remove_single_major_store(struct bus_type *bus, const char *buf, 7207 + static ssize_t remove_single_major_store(const struct bus_type *bus, const char *buf, 7204 7208 size_t count) 7205 7209 { 7206 - return do_rbd_remove(bus, buf, count); 7210 + return do_rbd_remove(buf, count); 7207 7211 } 7208 7212 7209 7213 /*
+3 -3
drivers/bus/fsl-mc/fsl-mc-bus.c
··· 231 231 return 0; 232 232 } 233 233 234 - static ssize_t rescan_store(struct bus_type *bus, 234 + static ssize_t rescan_store(const struct bus_type *bus, 235 235 const char *buf, size_t count) 236 236 { 237 237 unsigned long val; ··· 284 284 return 0; 285 285 } 286 286 287 - static ssize_t autorescan_store(struct bus_type *bus, 287 + static ssize_t autorescan_store(const struct bus_type *bus, 288 288 const char *buf, size_t count) 289 289 { 290 290 bus_for_each_dev(bus, NULL, (void *)buf, fsl_mc_bus_set_autorescan); ··· 292 292 return count; 293 293 } 294 294 295 - static ssize_t autorescan_show(struct bus_type *bus, char *buf) 295 + static ssize_t autorescan_show(const struct bus_type *bus, char *buf) 296 296 { 297 297 bus_for_each_dev(bus, NULL, (void *)buf, fsl_mc_bus_get_autorescan); 298 298 return strlen(buf);
+1 -1
drivers/cxl/core/port.c
··· 1927 1927 EXPORT_SYMBOL_NS_GPL(schedule_cxl_memdev_detach, CXL); 1928 1928 1929 1929 /* for user tooling to ensure port disable work has completed */ 1930 - static ssize_t flush_store(struct bus_type *bus, const char *buf, size_t count) 1930 + static ssize_t flush_store(const struct bus_type *bus, const char *buf, size_t count) 1931 1931 { 1932 1932 if (sysfs_streq(buf, "1")) { 1933 1933 flush_workqueue(cxl_bus_wq);
+1 -1
drivers/hv/vmbus_drv.c
··· 684 684 __ATTRIBUTE_GROUPS(vmbus_dev); 685 685 686 686 /* Set up the attribute for /sys/bus/vmbus/hibernation */ 687 - static ssize_t hibernation_show(struct bus_type *bus, char *buf) 687 + static ssize_t hibernation_show(const struct bus_type *bus, char *buf) 688 688 { 689 689 return sprintf(buf, "%d\n", !!hv_is_hibernation_supported()); 690 690 }
+2 -2
drivers/net/netdevsim/bus.c
··· 132 132 nsim_bus_dev_new(unsigned int id, unsigned int port_count, unsigned int num_queues); 133 133 134 134 static ssize_t 135 - new_device_store(struct bus_type *bus, const char *buf, size_t count) 135 + new_device_store(const struct bus_type *bus, const char *buf, size_t count) 136 136 { 137 137 unsigned int id, port_count, num_queues; 138 138 struct nsim_bus_dev *nsim_bus_dev; ··· 186 186 static void nsim_bus_dev_del(struct nsim_bus_dev *nsim_bus_dev); 187 187 188 188 static ssize_t 189 - del_device_store(struct bus_type *bus, const char *buf, size_t count) 189 + del_device_store(const struct bus_type *bus, const char *buf, size_t count) 190 190 { 191 191 struct nsim_bus_dev *nsim_bus_dev, *tmp; 192 192 unsigned int id;
+1 -1
drivers/pci/pci-sysfs.c
··· 428 428 } 429 429 static DEVICE_ATTR_RW(msi_bus); 430 430 431 - static ssize_t rescan_store(struct bus_type *bus, const char *buf, size_t count) 431 + static ssize_t rescan_store(const struct bus_type *bus, const char *buf, size_t count) 432 432 { 433 433 unsigned long val; 434 434 struct pci_bus *b = NULL;
+2 -2
drivers/pci/pci.c
··· 6679 6679 } 6680 6680 } 6681 6681 6682 - static ssize_t resource_alignment_show(struct bus_type *bus, char *buf) 6682 + static ssize_t resource_alignment_show(const struct bus_type *bus, char *buf) 6683 6683 { 6684 6684 size_t count = 0; 6685 6685 ··· 6691 6691 return count; 6692 6692 } 6693 6693 6694 - static ssize_t resource_alignment_store(struct bus_type *bus, 6694 + static ssize_t resource_alignment_store(const struct bus_type *bus, 6695 6695 const char *buf, size_t count) 6696 6696 { 6697 6697 char *param, *old, *end;
+1 -1
drivers/peci/sysfs.c
··· 15 15 return peci_controller_scan_devices(to_peci_controller(dev)); 16 16 } 17 17 18 - static ssize_t rescan_store(struct bus_type *bus, const char *buf, size_t count) 18 + static ssize_t rescan_store(const struct bus_type *bus, const char *buf, size_t count) 19 19 { 20 20 bool res; 21 21 int ret;
+1 -1
drivers/rapidio/rio-sysfs.c
··· 286 286 NULL, 287 287 }; 288 288 289 - static ssize_t scan_store(struct bus_type *bus, const char *buf, size_t count) 289 + static ssize_t scan_store(const struct bus_type *bus, const char *buf, size_t count) 290 290 { 291 291 long val; 292 292 int rc;
+21 -21
drivers/s390/crypto/ap_bus.c
··· 1166 1166 * AP bus attributes. 1167 1167 */ 1168 1168 1169 - static ssize_t ap_domain_show(struct bus_type *bus, char *buf) 1169 + static ssize_t ap_domain_show(const struct bus_type *bus, char *buf) 1170 1170 { 1171 1171 return scnprintf(buf, PAGE_SIZE, "%d\n", ap_domain_index); 1172 1172 } 1173 1173 1174 - static ssize_t ap_domain_store(struct bus_type *bus, 1174 + static ssize_t ap_domain_store(const struct bus_type *bus, 1175 1175 const char *buf, size_t count) 1176 1176 { 1177 1177 int domain; ··· 1193 1193 1194 1194 static BUS_ATTR_RW(ap_domain); 1195 1195 1196 - static ssize_t ap_control_domain_mask_show(struct bus_type *bus, char *buf) 1196 + static ssize_t ap_control_domain_mask_show(const struct bus_type *bus, char *buf) 1197 1197 { 1198 1198 if (!ap_qci_info) /* QCI not supported */ 1199 1199 return scnprintf(buf, PAGE_SIZE, "not supported\n"); ··· 1208 1208 1209 1209 static BUS_ATTR_RO(ap_control_domain_mask); 1210 1210 1211 - static ssize_t ap_usage_domain_mask_show(struct bus_type *bus, char *buf) 1211 + static ssize_t ap_usage_domain_mask_show(const struct bus_type *bus, char *buf) 1212 1212 { 1213 1213 if (!ap_qci_info) /* QCI not supported */ 1214 1214 return scnprintf(buf, PAGE_SIZE, "not supported\n"); ··· 1223 1223 1224 1224 static BUS_ATTR_RO(ap_usage_domain_mask); 1225 1225 1226 - static ssize_t ap_adapter_mask_show(struct bus_type *bus, char *buf) 1226 + static ssize_t ap_adapter_mask_show(const struct bus_type *bus, char *buf) 1227 1227 { 1228 1228 if (!ap_qci_info) /* QCI not supported */ 1229 1229 return scnprintf(buf, PAGE_SIZE, "not supported\n"); ··· 1238 1238 1239 1239 static BUS_ATTR_RO(ap_adapter_mask); 1240 1240 1241 - static ssize_t ap_interrupts_show(struct bus_type *bus, char *buf) 1241 + static ssize_t ap_interrupts_show(const struct bus_type *bus, char *buf) 1242 1242 { 1243 1243 return scnprintf(buf, PAGE_SIZE, "%d\n", 1244 1244 ap_irq_flag ? 1 : 0); ··· 1246 1246 1247 1247 static BUS_ATTR_RO(ap_interrupts); 1248 1248 1249 - static ssize_t config_time_show(struct bus_type *bus, char *buf) 1249 + static ssize_t config_time_show(const struct bus_type *bus, char *buf) 1250 1250 { 1251 1251 return scnprintf(buf, PAGE_SIZE, "%d\n", ap_config_time); 1252 1252 } 1253 1253 1254 - static ssize_t config_time_store(struct bus_type *bus, 1254 + static ssize_t config_time_store(const struct bus_type *bus, 1255 1255 const char *buf, size_t count) 1256 1256 { 1257 1257 int time; ··· 1265 1265 1266 1266 static BUS_ATTR_RW(config_time); 1267 1267 1268 - static ssize_t poll_thread_show(struct bus_type *bus, char *buf) 1268 + static ssize_t poll_thread_show(const struct bus_type *bus, char *buf) 1269 1269 { 1270 1270 return scnprintf(buf, PAGE_SIZE, "%d\n", ap_poll_kthread ? 1 : 0); 1271 1271 } 1272 1272 1273 - static ssize_t poll_thread_store(struct bus_type *bus, 1273 + static ssize_t poll_thread_store(const struct bus_type *bus, 1274 1274 const char *buf, size_t count) 1275 1275 { 1276 1276 int flag, rc; ··· 1289 1289 1290 1290 static BUS_ATTR_RW(poll_thread); 1291 1291 1292 - static ssize_t poll_timeout_show(struct bus_type *bus, char *buf) 1292 + static ssize_t poll_timeout_show(const struct bus_type *bus, char *buf) 1293 1293 { 1294 1294 return scnprintf(buf, PAGE_SIZE, "%llu\n", poll_timeout); 1295 1295 } 1296 1296 1297 - static ssize_t poll_timeout_store(struct bus_type *bus, const char *buf, 1297 + static ssize_t poll_timeout_store(const struct bus_type *bus, const char *buf, 1298 1298 size_t count) 1299 1299 { 1300 1300 unsigned long long time; ··· 1318 1318 1319 1319 static BUS_ATTR_RW(poll_timeout); 1320 1320 1321 - static ssize_t ap_max_domain_id_show(struct bus_type *bus, char *buf) 1321 + static ssize_t ap_max_domain_id_show(const struct bus_type *bus, char *buf) 1322 1322 { 1323 1323 return scnprintf(buf, PAGE_SIZE, "%d\n", ap_max_domain_id); 1324 1324 } 1325 1325 1326 1326 static BUS_ATTR_RO(ap_max_domain_id); 1327 1327 1328 - static ssize_t ap_max_adapter_id_show(struct bus_type *bus, char *buf) 1328 + static ssize_t ap_max_adapter_id_show(const struct bus_type *bus, char *buf) 1329 1329 { 1330 1330 return scnprintf(buf, PAGE_SIZE, "%d\n", ap_max_adapter_id); 1331 1331 } 1332 1332 1333 1333 static BUS_ATTR_RO(ap_max_adapter_id); 1334 1334 1335 - static ssize_t apmask_show(struct bus_type *bus, char *buf) 1335 + static ssize_t apmask_show(const struct bus_type *bus, char *buf) 1336 1336 { 1337 1337 int rc; 1338 1338 ··· 1393 1393 return 0; 1394 1394 } 1395 1395 1396 - static ssize_t apmask_store(struct bus_type *bus, const char *buf, 1396 + static ssize_t apmask_store(const struct bus_type *bus, const char *buf, 1397 1397 size_t count) 1398 1398 { 1399 1399 int rc, changes = 0; ··· 1425 1425 1426 1426 static BUS_ATTR_RW(apmask); 1427 1427 1428 - static ssize_t aqmask_show(struct bus_type *bus, char *buf) 1428 + static ssize_t aqmask_show(const struct bus_type *bus, char *buf) 1429 1429 { 1430 1430 int rc; 1431 1431 ··· 1486 1486 return 0; 1487 1487 } 1488 1488 1489 - static ssize_t aqmask_store(struct bus_type *bus, const char *buf, 1489 + static ssize_t aqmask_store(const struct bus_type *bus, const char *buf, 1490 1490 size_t count) 1491 1491 { 1492 1492 int rc, changes = 0; ··· 1518 1518 1519 1519 static BUS_ATTR_RW(aqmask); 1520 1520 1521 - static ssize_t scans_show(struct bus_type *bus, char *buf) 1521 + static ssize_t scans_show(const struct bus_type *bus, char *buf) 1522 1522 { 1523 1523 return scnprintf(buf, PAGE_SIZE, "%llu\n", 1524 1524 atomic64_read(&ap_scan_bus_count)); 1525 1525 } 1526 1526 1527 - static ssize_t scans_store(struct bus_type *bus, const char *buf, 1527 + static ssize_t scans_store(const struct bus_type *bus, const char *buf, 1528 1528 size_t count) 1529 1529 { 1530 1530 AP_DBF_INFO("%s force AP bus rescan\n", __func__); ··· 1536 1536 1537 1537 static BUS_ATTR_RW(scans); 1538 1538 1539 - static ssize_t bindings_show(struct bus_type *bus, char *buf) 1539 + static ssize_t bindings_show(const struct bus_type *bus, char *buf) 1540 1540 { 1541 1541 int rc; 1542 1542 unsigned int apqns, n;
+4 -4
drivers/scsi/fcoe/fcoe_sysfs.c
··· 659 659 .release = fcoe_fcf_device_release, 660 660 }; 661 661 662 - static ssize_t ctlr_create_store(struct bus_type *bus, const char *buf, 662 + static ssize_t ctlr_create_store(const struct bus_type *bus, const char *buf, 663 663 size_t count) 664 664 { 665 - return fcoe_ctlr_create_store(bus, buf, count); 665 + return fcoe_ctlr_create_store(buf, count); 666 666 } 667 667 static BUS_ATTR_WO(ctlr_create); 668 668 669 - static ssize_t ctlr_destroy_store(struct bus_type *bus, const char *buf, 669 + static ssize_t ctlr_destroy_store(const struct bus_type *bus, const char *buf, 670 670 size_t count) 671 671 { 672 - return fcoe_ctlr_destroy_store(bus, buf, count); 672 + return fcoe_ctlr_destroy_store(buf, count); 673 673 } 674 674 static BUS_ATTR_WO(ctlr_destroy); 675 675
+2 -4
drivers/scsi/fcoe/fcoe_transport.c
··· 745 745 return NOTIFY_OK; 746 746 } 747 747 748 - ssize_t fcoe_ctlr_create_store(struct bus_type *bus, 749 - const char *buf, size_t count) 748 + ssize_t fcoe_ctlr_create_store(const char *buf, size_t count) 750 749 { 751 750 struct net_device *netdev = NULL; 752 751 struct fcoe_transport *ft = NULL; ··· 807 808 return count; 808 809 } 809 810 810 - ssize_t fcoe_ctlr_destroy_store(struct bus_type *bus, 811 - const char *buf, size_t count) 811 + ssize_t fcoe_ctlr_destroy_store(const char *buf, size_t count) 812 812 { 813 813 int rc = -ENODEV; 814 814 struct net_device *netdev = NULL;
+2 -2
include/linux/device/bus.h
··· 118 118 119 119 struct bus_attribute { 120 120 struct attribute attr; 121 - ssize_t (*show)(struct bus_type *bus, char *buf); 122 - ssize_t (*store)(struct bus_type *bus, const char *buf, size_t count); 121 + ssize_t (*show)(const struct bus_type *bus, char *buf); 122 + ssize_t (*store)(const struct bus_type *bus, const char *buf, size_t count); 123 123 }; 124 124 125 125 #define BUS_ATTR_RW(_name) \
+2 -4
include/scsi/libfcoe.h
··· 397 397 int fcoe_transport_detach(struct fcoe_transport *ft); 398 398 399 399 /* sysfs store handler for ctrl_control interface */ 400 - ssize_t fcoe_ctlr_create_store(struct bus_type *bus, 401 - const char *buf, size_t count); 402 - ssize_t fcoe_ctlr_destroy_store(struct bus_type *bus, 403 - const char *buf, size_t count); 400 + ssize_t fcoe_ctlr_create_store(const char *buf, size_t count); 401 + ssize_t fcoe_ctlr_destroy_store(const char *buf, size_t count); 404 402 405 403 #endif /* _LIBFCOE_H */ 406 404