Skip to content

Commit 3d7c821

Browse files
andy-shevrafaeljw
authored andcommitted
ACPI: scan: Constify acpi_dma_supported() helper function
Constify arguments to acpi_dma_supported(). The function doesn't need to change the content of the passed argument and when it's const it allows to supply the result of other functions that may return a pointer to a constant object. Signed-off-by: Andy Shevchenko <[email protected]> [ rjw: Subject edit ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 5c1a72a commit 3d7c821

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

drivers/acpi/scan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1404,7 +1404,7 @@ void acpi_free_pnp_ids(struct acpi_device_pnp *pnp)
14041404
*
14051405
* Return false if DMA is not supported. Otherwise, return true
14061406
*/
1407-
bool acpi_dma_supported(struct acpi_device *adev)
1407+
bool acpi_dma_supported(const struct acpi_device *adev)
14081408
{
14091409
if (!adev)
14101410
return false;

include/acpi/acpi_bus.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ struct acpi_pci_root {
586586

587587
/* helper */
588588

589-
bool acpi_dma_supported(struct acpi_device *adev);
589+
bool acpi_dma_supported(const struct acpi_device *adev);
590590
enum dev_dma_attr acpi_get_dma_attr(struct acpi_device *adev);
591591
int acpi_dma_get_range(struct device *dev, u64 *dma_addr, u64 *offset,
592592
u64 *size);

include/linux/acpi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ acpi_create_platform_device(struct acpi_device *adev,
911911
return NULL;
912912
}
913913

914-
static inline bool acpi_dma_supported(struct acpi_device *adev)
914+
static inline bool acpi_dma_supported(const struct acpi_device *adev)
915915
{
916916
return false;
917917
}

0 commit comments

Comments
 (0)