From: Peter Kjellerstedt Date: Wed, 29 May 2013 11:51:02 +0000 (+0000) Subject: makedevs: Correct the device number calculation for blocks of devices X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~37201 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a878426bee607a7d961ba475a7ec7e89115df35;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git makedevs: Correct the device number calculation for blocks of devices If the increment > 1 and the start > 0 then the calculation for the minor device number was incorrect. Signed-off-by: Peter Kjellerstedt Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c b/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c index 247d6c1c3cb..d58e8911a66 100644 --- a/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c +++ b/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c @@ -226,7 +226,7 @@ static int interpret_table_entry(char *line) sprintf(path, "%s/%s%d", rootdir, name, i); /* FIXME: MKDEV uses illicit insider knowledge of kernel * major/minor representation... */ - rdev = MKDEV(major, minor + (i * increment - start)); + rdev = MKDEV(major, minor + (i - start) * increment); add_new_device(buf, path, uid, gid, mode, rdev); } } else {