Commit 7c0bf4da authored by Joel Granados's avatar Joel Granados Committed by Luis Chamberlain
Browse files

parport: Move magic number "15" to a define



Put the size of a parport name behind a define so we can use it in other
files. This is a preparation patch to be able to use this size in
parport/procfs.c.

Signed-off-by: default avatarJoel Granados <j.granados@samsung.com>
Reviewed-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
parent f1fcbaa1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -467,7 +467,7 @@ struct parport *parport_register_port(unsigned long base, int irq, int dma,
	atomic_set(&tmp->ref_count, 1);
	INIT_LIST_HEAD(&tmp->full_list);

	name = kmalloc(15, GFP_KERNEL);
	name = kmalloc(PARPORT_NAME_MAX_LEN, GFP_KERNEL);
	if (!name) {
		kfree(tmp);
		return NULL;
+2 −0
Original line number Diff line number Diff line
@@ -180,6 +180,8 @@ struct ieee1284_info {
	struct semaphore irq;
};

#define PARPORT_NAME_MAX_LEN 15

/* A parallel port */
struct parport {
	unsigned long base;	/* base address */