From 6044ec8882c726e325017bd948aa0cd94ad33abc Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Mon, 7 Nov 2005 01:01:32 -0800 Subject: [PATCH] kfree cleanup: misc remaining drivers This is the remaining misc drivers/ part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in misc files in drivers/. Signed-off-by: Jesper Juhl Acked-by: Aristeu Sergio Rozanski Filho Acked-by: Roland Dreier Acked-by: Pierre Ossman Acked-by: Jean Delvare Acked-by: Greg Kroah-Hartman Acked-by: Len Brown Acked-by: "Antonino A. Daplas" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/parport/probe.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'drivers/parport/probe.c') diff --git a/drivers/parport/probe.c b/drivers/parport/probe.c index 6e6f42d01e6..4b48b31ec23 100644 --- a/drivers/parport/probe.c +++ b/drivers/parport/probe.c @@ -78,17 +78,15 @@ static void parse_data(struct parport *port, int device, char *str) u++; } if (!strcmp(p, "MFG") || !strcmp(p, "MANUFACTURER")) { - if (info->mfr) - kfree (info->mfr); + kfree(info->mfr); info->mfr = kstrdup(sep, GFP_KERNEL); } else if (!strcmp(p, "MDL") || !strcmp(p, "MODEL")) { - if (info->model) - kfree (info->model); + kfree(info->model); info->model = kstrdup(sep, GFP_KERNEL); } else if (!strcmp(p, "CLS") || !strcmp(p, "CLASS")) { int i; - if (info->class_name) - kfree (info->class_name); + + kfree(info->class_name); info->class_name = kstrdup(sep, GFP_KERNEL); for (u = sep; *u; u++) *u = toupper(*u); @@ -102,21 +100,22 @@ static void parse_data(struct parport *port, int device, char *str) info->class = PARPORT_CLASS_OTHER; } else if (!strcmp(p, "CMD") || !strcmp(p, "COMMAND SET")) { - if (info->cmdset) - kfree (info->cmdset); + kfree(info->cmdset); info->cmdset = kstrdup(sep, GFP_KERNEL); /* if it speaks printer language, it's probably a printer */ if (strstr(sep, "PJL") || strstr(sep, "PCL")) guessed_class = PARPORT_CLASS_PRINTER; } else if (!strcmp(p, "DES") || !strcmp(p, "DESCRIPTION")) { - if (info->description) - kfree (info->description); + kfree(info->description); info->description = kstrdup(sep, GFP_KERNEL); } } rock_on: - if (q) p = q+1; else p=NULL; + if (q) + p = q + 1; + else + p = NULL; } /* If the device didn't tell us its class, maybe we have managed to -- cgit v1.2.3