Skip to content

Commit ca52a49

Browse files
kaysieversgregkh
authored andcommitted
driver core: remove DEVICE_NAME_SIZE define
There is no such thing as a "device name size" in the driver core, so remove the define and fix up any users of this odd define in the rest of the kernel. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent aab0de2 commit ca52a49

File tree

7 files changed

+7
-10
lines changed

7 files changed

+7
-10
lines changed

drivers/eisa/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ obj-${CONFIG_EISA_VIRTUAL_ROOT} += virtual_root.o
99

1010

1111
# Ugly hack to get DEVICE_NAME_SIZE value...
12-
DEVICE_NAME_SIZE =$(shell awk '$$1=="\#define" && $$2=="DEVICE_NAME_SIZE" {print $$3-1}' $(srctree)/include/linux/device.h)
12+
DEVICE_NAME_SIZE = 50
1313

1414
$(obj)/eisa-bus.o: $(obj)/devlist.h
1515

drivers/eisa/eisa-bus.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
struct eisa_device_info {
2424
struct eisa_device_id id;
25-
char name[DEVICE_NAME_SIZE];
25+
char name[50];
2626
};
2727

2828
#ifdef CONFIG_EISA_NAMES
@@ -63,7 +63,7 @@ static void __init eisa_name_device (struct eisa_device *edev)
6363
if (!strcmp (edev->id.sig, eisa_table[i].id.sig)) {
6464
strlcpy (edev->pretty_name,
6565
eisa_table[i].name,
66-
DEVICE_NAME_SIZE);
66+
sizeof(edev->pretty_name));
6767
return;
6868
}
6969
}

drivers/mca/mca-bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static struct mca_bus *mca_root_busses[MAX_MCA_BUSSES];
4040

4141
struct mca_device_info {
4242
short pos_id; /* the 2 byte pos id for this card */
43-
char name[DEVICE_NAME_SIZE];
43+
char name[50];
4444
};
4545

4646
static int mca_bus_match (struct device *dev, struct device_driver *drv)

drivers/video/aty/aty128fb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1872,7 +1872,7 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
18721872
struct fb_info *info = pci_get_drvdata(pdev);
18731873
struct aty128fb_par *par = info->par;
18741874
struct fb_var_screeninfo var;
1875-
char video_card[DEVICE_NAME_SIZE];
1875+
char video_card[50];
18761876
u8 chip_rev;
18771877
u32 dac;
18781878

drivers/video/aty/radeonfb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ struct radeonfb_info {
289289
struct radeon_regs state;
290290
struct radeon_regs init_state;
291291

292-
char name[DEVICE_NAME_SIZE];
292+
char name[50];
293293

294294
unsigned long mmio_base_phys;
295295
unsigned long fb_base_phys;

include/linux/device.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525
#include <asm/atomic.h>
2626
#include <asm/device.h>
2727

28-
#define DEVICE_NAME_SIZE 50
29-
/* DEVICE_NAME_HALF is really less than half to accommodate slop */
30-
#define DEVICE_NAME_HALF __stringify(20)
3128
#define DEVICE_ID_SIZE 32
3229
#define BUS_ID_SIZE 20
3330

include/linux/eisa.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct eisa_device {
4040
u64 dma_mask;
4141
struct device dev; /* generic device */
4242
#ifdef CONFIG_EISA_NAMES
43-
char pretty_name[DEVICE_NAME_SIZE];
43+
char pretty_name[50];
4444
#endif
4545
};
4646

0 commit comments

Comments
 (0)