Re: [PATCH] ASoC: Drop invalid DMI fields when setting card long name from DMI info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 06/28/2017 10:22 PM, Takashi Iwai wrote:
On Wed, 28 Jun 2017 09:01:39 +0200,
mengdong.lin@xxxxxxxxxxxxxxx wrote:

From: Mengdong Lin <mengdong.lin@xxxxxxxxxxxxxxx>

Sometimes DMI fields may be invalid and so can't give useful vendor,
product or board info, such as "Type2 - Board Manufacturer" or
"Type1 - TBD by OEM". Including such invalid DMI fileds may create silly
card long name. So this patch creates a black list of invalid strings.
And if a DMI field contains any string in this list, it will be excluded
from the card long name.

Signed-off-by: Mengdong Lin <mengdong.lin@xxxxxxxxxxxxxxx>

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index cfa9cf1476f2..419b788fd801 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -69,6 +69,20 @@ static int pmdown_time = 5000;
  module_param(pmdown_time, int, 0);
  MODULE_PARM_DESC(pmdown_time, "DAPM stream powerdown time (msecs)");
+/* If a DMI filed contain strings in this blacklist (e.g.
+ * "Type2 - Board Manufacturer" or  "Type1 - TBD by OEM"), it will be taken
+ * as invalid and dropped when setting the card long name from DMI info.
+ */
+static const char * const dmi_blacklist[] = {
+	"To be filled by OEM",
+	"TBD by OEM",
+	"Default String",

We found also a case with "Default string" (note the case-sensitive).

I added it in the v2 patch. Please review.

It seems we'll add more strings later to handle such case-sensitive cases.

Thanks
Mengdong

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux