drivers/intel/gma/acpi: Use snprintf() to construct device name
TEST=Booted ThinkPad X201s, backlight control still works. Change-Id: Ieee02f698879ba6b60d863dd63ef9107c0d502b5 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/39728 Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
53c1717dc1
commit
c0be410760
|
@ -50,8 +50,7 @@ drivers_intel_gma_displays_ssdt_generate(const struct i915_gpu_controller_info *
|
|||
acpigen_pop_len(); /* End Method. */
|
||||
|
||||
for (i = 0; i < conf->ndid; i++) {
|
||||
char name[10];
|
||||
char *ptr;
|
||||
char name[5];
|
||||
int kind;
|
||||
|
||||
kind = (conf->did[i] >> 8) & 0xf;
|
||||
|
@ -59,10 +58,7 @@ drivers_intel_gma_displays_ssdt_generate(const struct i915_gpu_controller_info *
|
|||
kind = 0;
|
||||
}
|
||||
|
||||
strcpy(name, names[kind]);
|
||||
for (ptr = name; *ptr; ptr++);
|
||||
*ptr++ = counters[kind] + '0';
|
||||
*ptr++ = '\0';
|
||||
snprintf(name, sizeof(name), "%s%d", names[kind], counters[kind]);
|
||||
counters[kind]++;
|
||||
|
||||
/* Device (LCD0) */
|
||||
|
|
Loading…
Reference in New Issue