ASoC: soc-core: Fix -Wunused-const-variable warning
authorYueHaibing <yuehaibing@huawei.com>
Tue, 13 Aug 2019 14:25:01 +0000 (22:25 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 15 Aug 2019 14:03:21 +0000 (15:03 +0100)
If CONFIG_DMI is not set, gcc warns:

sound/soc/soc-core.c:81:27: warning:
 dmi_blacklist defined but not used [-Wunused-const-variable=]

Add #ifdef guard around it.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190813142501.13080-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-core.c

index e9f44505cc3ed7e6129bd74035b379d2d6ed7189..abe2f47cee6e76cecc42de4a25ab49562eccaa9d 100644 (file)
@@ -73,6 +73,7 @@ static int pmdown_time = 5000;
 module_param(pmdown_time, int, 0);
 MODULE_PARM_DESC(pmdown_time, "DAPM stream powerdown time (msecs)");
 
+#ifdef CONFIG_DMI
 /*
  * If a DMI filed contain strings in this blacklist (e.g.
  * "Type2 - Board Manufacturer" or "Type1 - TBD by OEM"), it will be taken
@@ -87,6 +88,7 @@ static const char * const dmi_blacklist[] = {
        "Board Product Name",
        NULL,   /* terminator */
 };
+#endif
 
 static ssize_t pmdown_time_show(struct device *dev,
                                struct device_attribute *attr, char *buf)