Patchwork [v3,2/5] makedevs: Correct the device number calculation for blocks of devices

login
register
mail settings
Submitter Peter Kjellerstedt
Date May 30, 2013, 12:18 p.m.
Message ID <96e901a9e3cd5047c319233bd7cd904ea5600ae0.1369916015.git.pkj@axis.com>
Download mbox | patch
Permalink /patch/50827/
State New
Headers show

Comments

Peter Kjellerstedt - May 30, 2013, 12:18 p.m.
If the increment > 1 and the start > 0 then the calculation for the
minor device number was incorrect.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

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 247d6c1..d58e891 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 {