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

driver core: remove KOBJ_NAME_LEN define

Kobjects do not have a limit in name size since a while, so stop
pretending that they do.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Kay Sievers and committed by
Greg Kroah-Hartman
aab0de24 f75b1c60

+26 -26
+1 -1
arch/arm/plat-omap/mailbox.c
··· 334 334 } 335 335 336 336 mbox->dev.class = &omap_mbox_class; 337 - strlcpy(mbox->dev.bus_id, mbox->name, KOBJ_NAME_LEN); 337 + strlcpy(mbox->dev.bus_id, mbox->name, BUS_ID_SIZE); 338 338 dev_set_drvdata(&mbox->dev, mbox); 339 339 340 340 ret = device_register(&mbox->dev);
+1 -1
arch/sparc64/kernel/vio.c
··· 224 224 if (!strcmp(type, "domain-services-port")) 225 225 bus_id_name = "ds"; 226 226 227 - if (strlen(bus_id_name) >= KOBJ_NAME_LEN - 4) { 227 + if (strlen(bus_id_name) >= BUS_ID_SIZE - 4) { 228 228 printk(KERN_ERR "VIO: bus_id_name [%s] is too long.\n", 229 229 bus_id_name); 230 230 return NULL;
+2 -1
drivers/message/fusion/mptbase.c
··· 1670 1670 INIT_DELAYED_WORK(&ioc->fault_reset_work, mpt_fault_reset_work); 1671 1671 spin_lock_init(&ioc->fault_reset_work_lock); 1672 1672 1673 - snprintf(ioc->reset_work_q_name, KOBJ_NAME_LEN, "mpt_poll_%d", ioc->id); 1673 + snprintf(ioc->reset_work_q_name, sizeof(ioc->reset_work_q_name), 1674 + "mpt_poll_%d", ioc->id); 1674 1675 ioc->reset_work_q = 1675 1676 create_singlethread_workqueue(ioc->reset_work_q_name); 1676 1677 if (!ioc->reset_work_q) {
+2 -2
drivers/message/fusion/mptbase.h
··· 707 707 u8 fc_link_speed[2]; 708 708 spinlock_t fc_rescan_work_lock; 709 709 struct work_struct fc_rescan_work; 710 - char fc_rescan_work_q_name[KOBJ_NAME_LEN]; 710 + char fc_rescan_work_q_name[20]; 711 711 struct workqueue_struct *fc_rescan_work_q; 712 712 struct scsi_cmnd **ScsiLookup; 713 713 spinlock_t scsi_lookup_lock; 714 714 715 - char reset_work_q_name[KOBJ_NAME_LEN]; 715 + char reset_work_q_name[20]; 716 716 struct workqueue_struct *reset_work_q; 717 717 struct delayed_work fault_reset_work; 718 718 spinlock_t fault_reset_work_lock;
+2 -2
drivers/message/fusion/mptfc.c
··· 1326 1326 1327 1327 /* initialize workqueue */ 1328 1328 1329 - snprintf(ioc->fc_rescan_work_q_name, KOBJ_NAME_LEN, "mptfc_wq_%d", 1330 - sh->host_no); 1329 + snprintf(ioc->fc_rescan_work_q_name, sizeof(ioc->fc_rescan_work_q_name), 1330 + "mptfc_wq_%d", sh->host_no); 1331 1331 ioc->fc_rescan_work_q = 1332 1332 create_singlethread_workqueue(ioc->fc_rescan_work_q_name); 1333 1333 if (!ioc->fc_rescan_work_q)
+2 -2
drivers/pci/hotplug/acpiphp.h
··· 36 36 #define _ACPIPHP_H 37 37 38 38 #include <linux/acpi.h> 39 - #include <linux/kobject.h> /* for KOBJ_NAME_LEN */ 39 + #include <linux/kobject.h> 40 40 #include <linux/mutex.h> 41 41 #include <linux/pci_hotplug.h> 42 42 ··· 51 51 #define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME , ## arg) 52 52 53 53 /* name size which is used for entries in pcihpfs */ 54 - #define SLOT_NAME_SIZE KOBJ_NAME_LEN /* {_SUN} */ 54 + #define SLOT_NAME_SIZE 20 /* {_SUN} */ 55 55 56 56 struct acpiphp_bridge; 57 57 struct acpiphp_slot;
+2 -2
drivers/scsi/hosts.c
··· 232 232 } 233 233 234 234 if (shost->transportt->create_work_queue) { 235 - snprintf(shost->work_q_name, KOBJ_NAME_LEN, "scsi_wq_%d", 236 - shost->host_no); 235 + snprintf(shost->work_q_name, sizeof(shost->work_q_name), 236 + "scsi_wq_%d", shost->host_no); 237 237 shost->work_q = create_singlethread_workqueue( 238 238 shost->work_q_name); 239 239 if (!shost->work_q) {
+5 -4
drivers/scsi/scsi_transport_fc.c
··· 417 417 fc_host->next_vport_number = 0; 418 418 fc_host->npiv_vports_inuse = 0; 419 419 420 - snprintf(fc_host->work_q_name, KOBJ_NAME_LEN, "fc_wq_%d", 421 - shost->host_no); 420 + snprintf(fc_host->work_q_name, sizeof(fc_host->work_q_name), 421 + "fc_wq_%d", shost->host_no); 422 422 fc_host->work_q = create_singlethread_workqueue( 423 423 fc_host->work_q_name); 424 424 if (!fc_host->work_q) 425 425 return -ENOMEM; 426 426 427 - snprintf(fc_host->devloss_work_q_name, KOBJ_NAME_LEN, "fc_dl_%d", 428 - shost->host_no); 427 + snprintf(fc_host->devloss_work_q_name, 428 + sizeof(fc_host->devloss_work_q_name), 429 + "fc_dl_%d", shost->host_no); 429 430 fc_host->devloss_work_q = create_singlethread_workqueue( 430 431 fc_host->devloss_work_q_name); 431 432 if (!fc_host->devloss_work_q) {
+2 -2
drivers/scsi/scsi_transport_iscsi.c
··· 247 247 atomic_set(&ihost->nr_scans, 0); 248 248 mutex_init(&ihost->mutex); 249 249 250 - snprintf(ihost->scan_workq_name, KOBJ_NAME_LEN, "iscsi_scan_%d", 251 - shost->host_no); 250 + snprintf(ihost->scan_workq_name, sizeof(ihost->scan_workq_name), 251 + "iscsi_scan_%d", shost->host_no); 252 252 ihost->scan_workq = create_singlethread_workqueue( 253 253 ihost->scan_workq_name); 254 254 if (!ihost->scan_workq)
+1 -1
fs/partitions/check.c
··· 401 401 disk->dev.parent = disk->driverfs_dev; 402 402 disk->dev.devt = MKDEV(disk->major, disk->first_minor); 403 403 404 - strlcpy(disk->dev.bus_id, disk->disk_name, KOBJ_NAME_LEN); 404 + strlcpy(disk->dev.bus_id, disk->disk_name, BUS_ID_SIZE); 405 405 /* ewww... some of these buggers have / in the name... */ 406 406 s = strchr(disk->dev.bus_id, '/'); 407 407 if (s)
+1 -2
include/linux/device.h
··· 29 29 /* DEVICE_NAME_HALF is really less than half to accommodate slop */ 30 30 #define DEVICE_NAME_HALF __stringify(20) 31 31 #define DEVICE_ID_SIZE 32 32 - #define BUS_ID_SIZE KOBJ_NAME_LEN 33 - 32 + #define BUS_ID_SIZE 20 34 33 35 34 struct device; 36 35 struct device_driver;
-1
include/linux/kobject.h
··· 26 26 #include <linux/wait.h> 27 27 #include <asm/atomic.h> 28 28 29 - #define KOBJ_NAME_LEN 20 30 29 #define UEVENT_HELPER_PATH_LEN 256 31 30 #define UEVENT_NUM_ENVP 32 /* number of env pointers */ 32 31 #define UEVENT_BUFFER_SIZE 2048 /* buffer for the variables */
+1 -1
include/linux/spi/spi.h
··· 733 733 * controller_data goes to spi_device.controller_data, 734 734 * irq is copied too 735 735 */ 736 - char modalias[KOBJ_NAME_LEN]; 736 + char modalias[32]; 737 737 const void *platform_data; 738 738 void *controller_data; 739 739 int irq;
+1 -1
include/scsi/scsi_host.h
··· 623 623 /* 624 624 * Optional work queue to be utilized by the transport 625 625 */ 626 - char work_q_name[KOBJ_NAME_LEN]; 626 + char work_q_name[20]; 627 627 struct workqueue_struct *work_q; 628 628 629 629 /*
+2 -2
include/scsi/scsi_transport_fc.h
··· 489 489 u16 npiv_vports_inuse; 490 490 491 491 /* work queues for rport state manipulation */ 492 - char work_q_name[KOBJ_NAME_LEN]; 492 + char work_q_name[20]; 493 493 struct workqueue_struct *work_q; 494 - char devloss_work_q_name[KOBJ_NAME_LEN]; 494 + char devloss_work_q_name[20]; 495 495 struct workqueue_struct *devloss_work_q; 496 496 }; 497 497
+1 -1
include/scsi/scsi_transport_iscsi.h
··· 198 198 atomic_t nr_scans; 199 199 struct mutex mutex; 200 200 struct workqueue_struct *scan_workq; 201 - char scan_workq_name[KOBJ_NAME_LEN]; 201 + char scan_workq_name[20]; 202 202 }; 203 203 204 204 extern void iscsi_host_for_each_session(struct Scsi_Host *shost,