diff options
author | Nathan Fontenot | 2013-04-24 07:55:08 +0200 |
---|---|---|
committer | Benjamin Herrenschmidt | 2013-04-26 08:08:21 +0200 |
commit | 43c0ea60537d9423f0f1b5c14b0cd0a0b4af5c81 (patch) | |
tree | 0583e4dd038d0463ad8859f5d1ce33578d20ee45 /arch/powerpc | |
parent | powerpc/pseries: Move architecture vector definitions to prom.h (diff) | |
download | kernel-qcow2-linux-43c0ea60537d9423f0f1b5c14b0cd0a0b4af5c81.tar.gz kernel-qcow2-linux-43c0ea60537d9423f0f1b5c14b0cd0a0b4af5c81.tar.xz kernel-qcow2-linux-43c0ea60537d9423f0f1b5c14b0cd0a0b4af5c81.zip |
powerpc/pseries: Use ARRAY_SIZE to iterate over firmware_features_table array
When iterating over the entries in firmware_features_table we only need
to go over the actual number of entries in the array instead of declaring
it to be bigger and checking to make sure there is a valid entry in every
slot.
This patch removes the FIRMWARE_MAX_FEATURES #define and replaces the
array looping with the use of ARRAY_SIZE().
Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/firmware.h | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/firmware.c | 8 |
2 files changed, 3 insertions, 6 deletions
diff --git a/arch/powerpc/include/asm/firmware.h b/arch/powerpc/include/asm/firmware.h index 097dee57a7a9..f9651b288da1 100644 --- a/arch/powerpc/include/asm/firmware.h +++ b/arch/powerpc/include/asm/firmware.h @@ -18,7 +18,6 @@ #include <asm/feature-fixups.h> /* firmware feature bitmask values */ -#define FIRMWARE_MAX_FEATURES 63 #define FW_FEATURE_PFT ASM_CONST(0x0000000000000001) #define FW_FEATURE_TCE ASM_CONST(0x0000000000000002) diff --git a/arch/powerpc/platforms/pseries/firmware.c b/arch/powerpc/platforms/pseries/firmware.c index aa3693f7fb27..1236a9d6146a 100644 --- a/arch/powerpc/platforms/pseries/firmware.c +++ b/arch/powerpc/platforms/pseries/firmware.c @@ -39,7 +39,7 @@ typedef struct { * string must match. */ static __initdata firmware_feature_t -firmware_features_table[FIRMWARE_MAX_FEATURES] = { +firmware_features_table[] = { {FW_FEATURE_PFT, "hcall-pft"}, {FW_FEATURE_TCE, "hcall-tce"}, {FW_FEATURE_SPRG0, "hcall-sprg0"}, @@ -77,12 +77,10 @@ void __init fw_feature_init(const char *hypertas, unsigned long len) pr_debug(" -> fw_feature_init()\n"); for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) { - for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) { + for (i = 0; i < ARRAY_SIZE(firmware_features_table); i++) { const char *name = firmware_features_table[i].name; size_t size; - /* check value against table of strings */ - if (!name) - continue; + /* * If there is a '*' at the end of name, only check * upto there |