mtd: devices: phram.c: Fix use true/false for bool type
Subsystems (3)
PATCH 1/1 mtd: devices: phram.c: Fix use true/false for bool type
Return type for security_extensions_enabled() is bool so use true/false.
--- arch/arm/mm/nommu.c | 2 +- drivers/mtd/devices/phram.c | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-)
arch/arm/mm/nommu.c +1 -1
@@ -56,7 +56,7 @@ static inline bool security_extensions_enabled(void)if ((read_cpuid_id () &0x000f0000 ) ==0x000f0000 )return cpuid_feature_extract (CPUID_EXT_PFR1 ,4 ) ||cpuid_feature_extract (CPUID_EXT_PFR1 ,20 ); -return 0 ; +return true; }unsigned long setup_vectors_base (void )
drivers/mtd/devices/phram.c +5 -6
@@ -239,27 +239,26 @@ static int phram_setup(const char *val) ret =parse_name (&name, token[0 ]);if (ret) - goto exit; +return ret; ret =parse_num64 (&start, token[1 ]);if (ret) { +kfree (name);parse_err ("illegal start address\n" ); - goto parse_err; } ret =parse_num64 (&len, token[2 ]);if (ret) { +kfree (name);parse_err ("illegal device length\n" ); - goto parse_err; } ret =register_device (name, start, len);if (!ret)pr_info ("%s device: %#llx at %#llx\n" , name, len, start); +else +kfree (name); -parse_err: -kfree (name); -exit:return ret; }
Signature · 1 line
2.20.1
Russell King - ARM Linux admin
maintainerQuoted 2 lines · Saurav Girepunje
Return type for
security_extensions_enabled()is bool so use true/false.
This doesn't seem to bear any resemblence to the subject line.
Quoted 11 lines
Signed-off-by Saurav Girepunje <[email protected]>--- arch/arm/mm/nommu.c | 2 +- drivers/mtd/devices/phram.c | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-)arch/arm/mm/nommu.c +0
-0
arch/arm/mm/nommu.c static inline bool security_extensions_enabled(void) · line 59
Quoted 5 lines
arch/arm/mm/nommu.c +1
-1@@ -56,7 +56,7 @@ static inline bool security_extensions_enabled(void)if ((read_cpuid_id () &0x000f0000 ) ==0x000f0000 )return cpuid_feature_extract (CPUID_EXT_PFR1 ,4 ) ||cpuid_feature_extract (CPUID_EXT_PFR1 ,20 ); -return 0 ; +return true;
This isn't explained in the commit. You explain why it should return true or false, but you don't explain why converting this from returning 0, aka false, to returning true is necessary.
Quoted 29 lines
arch/arm/mm/nommu.c +0
-0}unsigned long setup_vectors_base (void )drivers/mtd/devices/phram.c +3
-3@@ -239,27 +239,26 @@ static int phram_setup(const char *val) ret =parse_name (&name, token[0 ]);if (ret) - goto exit; +return ret; ret =parse_num64 (&start, token[1 ]);if (ret) { +kfree (name);parse_err ("illegal start address\n" ); - goto parse_err; } ret =parse_num64 (&len, token[2 ]);if (ret) { +kfree (name);parse_err ("illegal device length\n" ); - goto parse_err; } ret =register_device (name, start, len);
drivers/mtd/devices/phram.c static int phram_setup(const char *val) · line 263
Quoted 10 lines
drivers/mtd/devices/phram.c +2
-3if (!ret)pr_info ("%s device: %#llx at %#llx\n" , name, len, start); +else +kfree (name); -parse_err: -kfree (name); -exit:return ret; }
At least this partially matches the subject line but it looks unrelated to the other changes.
Signature · 8 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 61 lines · Russell King - ARM Linux admin
Quoted 2 lines · Saurav Girepunje
Return type for
security_extensions_enabled()is bool so use true/false.This doesn't seem to bear any resemblence to the subject line.
Quoted 11 lines
Signed-off-by Saurav Girepunje <[email protected]>--- arch/arm/mm/nommu.c | 2 +- drivers/mtd/devices/phram.c | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-)arch/arm/mm/nommu.c +0
-0arch/arm/mm/nommu.c static inline bool security_extensions_enabled(void) · line 59
Quoted 5 lines
arch/arm/mm/nommu.c +1
-1@@ -56,7 +56,7 @@ static inline bool security_extensions_enabled(void)if ((read_cpuid_id () &0x000f0000 ) ==0x000f0000 )return cpuid_feature_extract (CPUID_EXT_PFR1 ,4 ) ||cpuid_feature_extract (CPUID_EXT_PFR1 ,20 ); -return 0 ; +return true;This isn't explained in the commit. You explain why it should return true or false, but you don't explain why converting this from returning 0, aka false, to returning true is necessary.
Quoted 34 lines
arch/arm/mm/nommu.c +0
-0}unsigned long setup_vectors_base (void )drivers/mtd/devices/phram.c +5
-3@@ -239,27 +239,26 @@ static int phram_setup(const char *val) ret =parse_name (&name, token[0 ]);if (ret) - goto exit; +return ret; ret =parse_num64 (&start, token[1 ]);if (ret) { +kfree (name);parse_err ("illegal start address\n" ); - goto parse_err; } ret =parse_num64 (&len, token[2 ]);if (ret) { +kfree (name);parse_err ("illegal device length\n" ); - goto parse_err; } ret =register_device (name, start, len);if (!ret)pr_info ("%s device: %#llx at %#llx\n" , name, len, start); +else +kfree (name);
Quoted 13 lines
drivers/mtd/devices/phram.c static int phram_setup(const char *val) · line 263
Quoted 5 lines
drivers/mtd/devices/phram.c +0
-3-parse_err: -kfree (name); -exit:return ret; }At least this partially matches the subject line but it looks unrelated to the other changes.
Signature · 3 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up
Please igonre this patch. Suppose to send for only one file nommu.c. I have seperated and submitted the patch for chnages in file phram.c and nommu.c. Thanks for review ... :-)