From f50d736b596ab67fcb665308777b74c4ff5adc63 Mon Sep 17 00:00:00 2001 From: Michael Neuling Date: Tue, 6 Nov 2012 14:49:15 +0000 Subject: [PATCH] --- yaml --- r: 356339 b: refs/heads/master c: 2f1d4ea7bcd96d3796eba4087388bdb37322ee7a h: refs/heads/master i: 356337: 4b8b8e17954884eea1753e06dfe412a9242549e3 356335: 6d020742e8ea16fe50597db8d88bb1c2a993357b v: v3 --- [refs] | 2 +- .../arch/powerpc/platforms/pseries/firmware.c | 20 +++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index bee1c2a85871..8dc45814188c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1e18c17adf32b86474fd903071b0181de9334bd4 +refs/heads/master: 2f1d4ea7bcd96d3796eba4087388bdb37322ee7a diff --git a/trunk/arch/powerpc/platforms/pseries/firmware.c b/trunk/arch/powerpc/platforms/pseries/firmware.c index 7b56118f531c..55b98c3dc47a 100644 --- a/trunk/arch/powerpc/platforms/pseries/firmware.c +++ b/trunk/arch/powerpc/platforms/pseries/firmware.c @@ -33,6 +33,11 @@ typedef struct { char * name; } firmware_feature_t; +/* + * The names in this table match names in rtas/ibm,hypertas-functions. If the + * entry ends in a '*', only upto the '*' is matched. Otherwise the entire + * string must match. + */ static __initdata firmware_feature_t firmware_features_table[FIRMWARE_MAX_FEATURES] = { {FW_FEATURE_PFT, "hcall-pft"}, @@ -72,9 +77,20 @@ void __init fw_feature_init(const char *hypertas, unsigned long len) for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) { for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) { + const char *name = firmware_features_table[i].name; + size_t size; /* check value against table of strings */ - if (!firmware_features_table[i].name || - strcmp(firmware_features_table[i].name, s)) + if (!name) + continue; + /* + * If there is a '*' at the end of name, only check + * upto there + */ + size = strlen(name); + if (size && name[size - 1] == '*') { + if (strncmp(name, s, size - 1)) + continue; + } else if (strcmp(name, s)) continue; /* we have a match */