[PATCH 1/6] arm: gen-mach-types: add MAX_MACH_TYPE

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Thu Nov 28 13:06:42 EST 2013


this will be usefull to check that we set a valid machine id

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 arch/arm/tools/gen-mach-types | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/tools/gen-mach-types b/arch/arm/tools/gen-mach-types
index 04fef71..fd771aa 100644
--- a/arch/arm/tools/gen-mach-types
+++ b/arch/arm/tools/gen-mach-types
@@ -34,9 +34,15 @@ END	{
 	  printf("#endif\n\n");
 
 	  printf("/* see arch/arm/kernel/arch.c for a description of these */\n");
+	  max_mach_type = 0
 	  for (i = 0; i < nr; i++)
-	    if (num[i] ~ /..*/)
+	    if (num[i] ~ /..*/) {
 	      printf("#define %-30s %d\n", mach_type[i], num[i]);
+	      if (num[i] > max_mach_type)
+	        max_mach_type = num[i]
+	    }
+
+	      printf("#define MAX_MACH_TYPE %d\n", max_mach_type);
 
 	  printf("\n");
 
-- 
1.8.4.3




More information about the barebox mailing list