Skip to content

Commit aab0de2

Browse files
kaysieversgregkh
authored andcommitted
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>
1 parent f75b1c6 commit aab0de2

File tree

16 files changed

+26
-26
lines changed

16 files changed

+26
-26
lines changed

arch/arm/plat-omap/mailbox.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ static int omap_mbox_init(struct omap_mbox *mbox)
334334
}
335335

336336
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);
338338
dev_set_drvdata(&mbox->dev, mbox);
339339

340340
ret = device_register(&mbox->dev);

arch/sparc64/kernel/vio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
224224
if (!strcmp(type, "domain-services-port"))
225225
bus_id_name = "ds";
226226

227-
if (strlen(bus_id_name) >= KOBJ_NAME_LEN - 4) {
227+
if (strlen(bus_id_name) >= BUS_ID_SIZE - 4) {
228228
printk(KERN_ERR "VIO: bus_id_name [%s] is too long.\n",
229229
bus_id_name);
230230
return NULL;

drivers/message/fusion/mptbase.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
16701670
INIT_DELAYED_WORK(&ioc->fault_reset_work, mpt_fault_reset_work);
16711671
spin_lock_init(&ioc->fault_reset_work_lock);
16721672

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);
16741675
ioc->reset_work_q =
16751676
create_singlethread_workqueue(ioc->reset_work_q_name);
16761677
if (!ioc->reset_work_q) {

drivers/message/fusion/mptbase.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,12 +707,12 @@ typedef struct _MPT_ADAPTER
707707
u8 fc_link_speed[2];
708708
spinlock_t fc_rescan_work_lock;
709709
struct work_struct fc_rescan_work;
710-
char fc_rescan_work_q_name[KOBJ_NAME_LEN];
710+
char fc_rescan_work_q_name[20];
711711
struct workqueue_struct *fc_rescan_work_q;
712712
struct scsi_cmnd **ScsiLookup;
713713
spinlock_t scsi_lookup_lock;
714714

715-
char reset_work_q_name[KOBJ_NAME_LEN];
715+
char reset_work_q_name[20];
716716
struct workqueue_struct *reset_work_q;
717717
struct delayed_work fault_reset_work;
718718
spinlock_t fault_reset_work_lock;

drivers/message/fusion/mptfc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,8 +1326,8 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
13261326

13271327
/* initialize workqueue */
13281328

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);
13311331
ioc->fc_rescan_work_q =
13321332
create_singlethread_workqueue(ioc->fc_rescan_work_q_name);
13331333
if (!ioc->fc_rescan_work_q)

drivers/pci/hotplug/acpiphp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#define _ACPIPHP_H
3737

3838
#include <linux/acpi.h>
39-
#include <linux/kobject.h> /* for KOBJ_NAME_LEN */
39+
#include <linux/kobject.h>
4040
#include <linux/mutex.h>
4141
#include <linux/pci_hotplug.h>
4242

@@ -51,7 +51,7 @@
5151
#define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME , ## arg)
5252

5353
/* 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} */
5555

5656
struct acpiphp_bridge;
5757
struct acpiphp_slot;

drivers/scsi/hosts.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev)
232232
}
233233

234234
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);
237237
shost->work_q = create_singlethread_workqueue(
238238
shost->work_q_name);
239239
if (!shost->work_q) {

drivers/scsi/scsi_transport_fc.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,15 +417,16 @@ static int fc_host_setup(struct transport_container *tc, struct device *dev,
417417
fc_host->next_vport_number = 0;
418418
fc_host->npiv_vports_inuse = 0;
419419

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);
422422
fc_host->work_q = create_singlethread_workqueue(
423423
fc_host->work_q_name);
424424
if (!fc_host->work_q)
425425
return -ENOMEM;
426426

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);
429430
fc_host->devloss_work_q = create_singlethread_workqueue(
430431
fc_host->devloss_work_q_name);
431432
if (!fc_host->devloss_work_q) {

drivers/scsi/scsi_transport_iscsi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ static int iscsi_setup_host(struct transport_container *tc, struct device *dev,
247247
atomic_set(&ihost->nr_scans, 0);
248248
mutex_init(&ihost->mutex);
249249

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);
252252
ihost->scan_workq = create_singlethread_workqueue(
253253
ihost->scan_workq_name);
254254
if (!ihost->scan_workq)

fs/partitions/check.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ void register_disk(struct gendisk *disk)
401401
disk->dev.parent = disk->driverfs_dev;
402402
disk->dev.devt = MKDEV(disk->major, disk->first_minor);
403403

404-
strlcpy(disk->dev.bus_id, disk->disk_name, KOBJ_NAME_LEN);
404+
strlcpy(disk->dev.bus_id, disk->disk_name, BUS_ID_SIZE);
405405
/* ewww... some of these buggers have / in the name... */
406406
s = strchr(disk->dev.bus_id, '/');
407407
if (s)

0 commit comments

Comments
 (0)