Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI: Constify ACPI device IDs in documentation

ACPI device ID arrays normally don't need to be written to as they're
only ever read. The common usage -- embedding pointers to acpi_device_id
arrays in other data structures -- reference them as 'const', e.g. as in
struct acpi_driver / acpi_scan_handler / device_driver. The matchers are
taking const pointers, too. So it's only natural, to propose using const
arrays. Change the documentation accordingly.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Mathias Krause and committed by
Rafael J. Wysocki
1a147ed7 eb348664

+3 -3
+3 -3
Documentation/acpi/enumeration.txt
··· 42 42 straightforward. Here is the simplest example: 43 43 44 44 #ifdef CONFIG_ACPI 45 - static struct acpi_device_id mydrv_acpi_match[] = { 45 + static const struct acpi_device_id mydrv_acpi_match[] = { 46 46 /* ACPI IDs here */ 47 47 { } 48 48 }; ··· 166 166 to at25 SPI eeprom driver (this is meant for the above ACPI snippet): 167 167 168 168 #ifdef CONFIG_ACPI 169 - static struct acpi_device_id at25_acpi_match[] = { 169 + static const struct acpi_device_id at25_acpi_match[] = { 170 170 { "AT25", 0 }, 171 171 { }, 172 172 }; ··· 230 230 input driver: 231 231 232 232 #ifdef CONFIG_ACPI 233 - static struct acpi_device_id mpu3050_acpi_match[] = { 233 + static const struct acpi_device_id mpu3050_acpi_match[] = { 234 234 { "MPU3050", 0 }, 235 235 { }, 236 236 };