diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2012-02-11 23:57:19 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-14 00:24:26 +0100 |
commit | 5467bdda4a326513c2f14b712a22d59115b7ae94 (patch) | |
tree | 535210ef9bf238b1b4df1988114686f09896dbf9 /arch/x86/kernel/cpu/match.c | |
parent | x86/cpu: Fix overrun check in arch_print_cpu_modalias() (diff) | |
download | linux-5467bdda4a326513c2f14b712a22d59115b7ae94.tar.xz linux-5467bdda4a326513c2f14b712a22d59115b7ae94.zip |
x86/cpu: Clean up modalias feature matching
We currently include commas on both sides of the feature ID in a
modalias, but this prevents the lowest numbered feature of a CPU from
being matched. Since all feature IDs have the same length, we do not
need to worry about substring matches, so omit commas from the
modalias entirely.
Avoid generating multiple adjacent wildcards when there is no
feature ID to match.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Acked-by: Thomas Renninger <trenn@suse.de>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/x86/kernel/cpu/match.c')
-rw-r--r-- | arch/x86/kernel/cpu/match.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/match.c b/arch/x86/kernel/cpu/match.c index 2dfa52bcdfe2..5502b289341b 100644 --- a/arch/x86/kernel/cpu/match.c +++ b/arch/x86/kernel/cpu/match.c @@ -63,7 +63,7 @@ ssize_t arch_print_cpu_modalias(struct device *dev, boot_cpu_data.x86_model); size -= n; buf += n; - size -= 2; + size -= 1; for (i = 0; i < NCAPINTS*32; i++) { if (boot_cpu_has(i)) { n = snprintf(buf, size, ",%04X", i); @@ -75,7 +75,6 @@ ssize_t arch_print_cpu_modalias(struct device *dev, buf += n; } } - *buf++ = ','; *buf++ = '\n'; return buf - bufptr; } |