From 6819c00e72491819f6861a25f435cca4e0bd2384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=98yvind=20Karlsen?= Date: Thu, 4 Mar 2010 03:04:20 +0000 Subject: * using a for loop looks better * fix warning about not using parenthesis --- mdk-stage1/probing.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mdk-stage1/probing.c b/mdk-stage1/probing.c index 55769e87f..7d97056a4 100644 --- a/mdk-stage1/probing.c +++ b/mdk-stage1/probing.c @@ -798,10 +798,10 @@ void find_media(enum media_bus bus) "/proc/array/ida", "/proc/cciss/cciss", // 2.2 style NULL }; static char cpq_descr[] = "Compaq RAID logical disk"; - char ** procfile = procfiles; + char ** procfile; FILE * f; - while (procfile && *procfile) { - if(f = fopen(*procfile, "rb")) { + for (procfile = procfiles; procfile && *procfile; procfile++) { + if((f = fopen(*procfile, "rb"))) { while (fgets(buf, sizeof(buf), f)) { if (ptr_begins_static_str(buf, "ida/") || ptr_begins_static_str(buf, "cciss/")) { char * end = strchr(buf, ':'); @@ -819,7 +819,6 @@ void find_media(enum media_bus bus) } fclose(f); } - procfile++; } } -- cgit v1.2.1