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

Configure Feed

Select the types of activity you want to include in your feed.

crypto: ccp - drop platform ifdef checks

When both ACPI and OF are disabled, the dev_vdata variable is unused:

drivers/crypto/ccp/sp-platform.c:33:34: error: unused variable 'dev_vdata' [-Werror,-Wunused-const-variable]

This is not a useful configuration, and there is not much point in saving
a few bytes when only one of the two is enabled, so just remove all
these ifdef checks and rely on of_match_node() and acpi_match_device()
returning NULL when these subsystems are disabled.

Fixes: 6c5063434098 ("crypto: ccp - Add ACPI support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Arnd Bergmann and committed by
Herbert Xu
42c2d7d0 f5c2cf9d

+2 -12
+2 -12
drivers/crypto/ccp/sp-platform.c
··· 39 39 }, 40 40 }; 41 41 42 - #ifdef CONFIG_ACPI 43 42 static const struct acpi_device_id sp_acpi_match[] = { 44 43 { "AMDI0C00", (kernel_ulong_t)&dev_vdata[0] }, 45 44 { }, 46 45 }; 47 46 MODULE_DEVICE_TABLE(acpi, sp_acpi_match); 48 - #endif 49 47 50 - #ifdef CONFIG_OF 51 48 static const struct of_device_id sp_of_match[] = { 52 49 { .compatible = "amd,ccp-seattle-v1a", 53 50 .data = (const void *)&dev_vdata[0] }, 54 51 { }, 55 52 }; 56 53 MODULE_DEVICE_TABLE(of, sp_of_match); 57 - #endif 58 54 59 55 static struct sp_dev_vdata *sp_get_of_version(struct platform_device *pdev) 60 56 { 61 - #ifdef CONFIG_OF 62 57 const struct of_device_id *match; 63 58 64 59 match = of_match_node(sp_of_match, pdev->dev.of_node); 65 60 if (match && match->data) 66 61 return (struct sp_dev_vdata *)match->data; 67 - #endif 62 + 68 63 return NULL; 69 64 } 70 65 71 66 static struct sp_dev_vdata *sp_get_acpi_version(struct platform_device *pdev) 72 67 { 73 - #ifdef CONFIG_ACPI 74 68 const struct acpi_device_id *match; 75 69 76 70 match = acpi_match_device(sp_acpi_match, &pdev->dev); 77 71 if (match && match->driver_data) 78 72 return (struct sp_dev_vdata *)match->driver_data; 79 - #endif 73 + 80 74 return NULL; 81 75 } 82 76 ··· 206 212 static struct platform_driver sp_platform_driver = { 207 213 .driver = { 208 214 .name = "ccp", 209 - #ifdef CONFIG_ACPI 210 215 .acpi_match_table = sp_acpi_match, 211 - #endif 212 - #ifdef CONFIG_OF 213 216 .of_match_table = sp_of_match, 214 - #endif 215 217 }, 216 218 .probe = sp_platform_probe, 217 219 .remove_new = sp_platform_remove,