Skip to content

Commit 42c2d7d

Browse files
arndbherbertx
authored andcommitted
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: 6c50634 ("crypto: ccp - Add ACPI support") Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Tom Lendacky <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent f5c2cf9 commit 42c2d7d

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

drivers/crypto/ccp/sp-platform.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,44 +39,38 @@ static const struct sp_dev_vdata dev_vdata[] = {
3939
},
4040
};
4141

42-
#ifdef CONFIG_ACPI
4342
static const struct acpi_device_id sp_acpi_match[] = {
4443
{ "AMDI0C00", (kernel_ulong_t)&dev_vdata[0] },
4544
{ },
4645
};
4746
MODULE_DEVICE_TABLE(acpi, sp_acpi_match);
48-
#endif
4947

50-
#ifdef CONFIG_OF
5148
static const struct of_device_id sp_of_match[] = {
5249
{ .compatible = "amd,ccp-seattle-v1a",
5350
.data = (const void *)&dev_vdata[0] },
5451
{ },
5552
};
5653
MODULE_DEVICE_TABLE(of, sp_of_match);
57-
#endif
5854

5955
static struct sp_dev_vdata *sp_get_of_version(struct platform_device *pdev)
6056
{
61-
#ifdef CONFIG_OF
6257
const struct of_device_id *match;
6358

6459
match = of_match_node(sp_of_match, pdev->dev.of_node);
6560
if (match && match->data)
6661
return (struct sp_dev_vdata *)match->data;
67-
#endif
62+
6863
return NULL;
6964
}
7065

7166
static struct sp_dev_vdata *sp_get_acpi_version(struct platform_device *pdev)
7267
{
73-
#ifdef CONFIG_ACPI
7468
const struct acpi_device_id *match;
7569

7670
match = acpi_match_device(sp_acpi_match, &pdev->dev);
7771
if (match && match->driver_data)
7872
return (struct sp_dev_vdata *)match->driver_data;
79-
#endif
73+
8074
return NULL;
8175
}
8276

@@ -212,12 +206,8 @@ static int sp_platform_resume(struct platform_device *pdev)
212206
static struct platform_driver sp_platform_driver = {
213207
.driver = {
214208
.name = "ccp",
215-
#ifdef CONFIG_ACPI
216209
.acpi_match_table = sp_acpi_match,
217-
#endif
218-
#ifdef CONFIG_OF
219210
.of_match_table = sp_of_match,
220-
#endif
221211
},
222212
.probe = sp_platform_probe,
223213
.remove_new = sp_platform_remove,

0 commit comments

Comments
 (0)