lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 15 Jan 2014 16:51:33 +0100
From:	Jean-Francois Moine <moinejf@...e.fr>
To:	Mark Brown <broonie@...nel.org>, lgirdwood@...il.com
Cc:	alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
	kuninori.morimoto.gx@...esas.com, Xiubo Li <Li.Xiubo@...escale.com>
Subject: [PATCH v2 1/8] ASoC: simple-card: simplify code

The check of the mandatory fields is done for DT in its specific sequence.
Move the global check to the non-DT sequence.

Signed-off-by: Jean-Francois Moine <moinejf@...e.fr>
---
 sound/soc/generic/simple-card.c      | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 2a1b1b5..f0784ca 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -225,16 +225,16 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
 
 		memcpy(cinfo, dev->platform_data, sizeof(*cinfo));
 		cinfo->snd_card.dev = dev;
-	}
 
-	if (!cinfo->name	||
-	    !cinfo->card	||
-	    !cinfo->codec_dai.name	||
-	    !(cinfo->codec		|| of_codec)	||
-	    !(cinfo->platform		|| of_platform)	||
-	    !(cinfo->cpu_dai.name	|| of_cpu)) {
-		dev_err(dev, "insufficient asoc_simple_card_info settings\n");
-		return -EINVAL;
+		if (!cinfo->name	||
+		    !cinfo->card	||
+		    !cinfo->codec_dai.name	||
+		    !cinfo->codec	||
+		    !cinfo->platform	||
+		    !cinfo->cpu_dai.name) {
+			dev_err(dev, "insufficient asoc_simple_card_info settings\n");
+			return -EINVAL;
+		}
 	}
 
 	/*
-- 
Ken ar c'hentaƱ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ