summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzk@kernel.org>2016-12-10 04:51:11 -0500
committerMark Brown <broonie@kernel.org>2016-12-15 06:42:42 -0500
commit409c69be433b819c924a8d1c457a835bc6d51700 (patch)
tree9414844e73526cea5fa4ffe8d30c6d584f8f11d8 /sound
parent0223f500aa39a2b6df00af212da736232705be3e (diff)
ASoC: samsung: Remove tests of member address
The driver was checking for non-NULL address of struct's members: - s3c_audio_pdata->type (union), - s3c_audio_pdata->type.i2s (embedded struct). This is pointless as these will be always non-NULL. The 's3c_audio_pdata' is always initialized in static memory so it will be zeroed. Additionally the 'type' member was an union with only one member. It is safe to reorganize the structures to get rid of useless union and checks for addresses to fix the coccinelle warning: >> sound/soc/samsung/i2s.c:1270:2-4: ERROR: test of a variable/field address Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/samsung/i2s.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index e00974bc5616..d55326289a4a 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -1218,7 +1218,6 @@ static int samsung_i2s_probe(struct platform_device *pdev)
1218{ 1218{
1219 struct i2s_dai *pri_dai, *sec_dai = NULL; 1219 struct i2s_dai *pri_dai, *sec_dai = NULL;
1220 struct s3c_audio_pdata *i2s_pdata = pdev->dev.platform_data; 1220 struct s3c_audio_pdata *i2s_pdata = pdev->dev.platform_data;
1221 struct samsung_i2s *i2s_cfg = NULL;
1222 struct resource *res; 1221 struct resource *res;
1223 u32 regs_base, quirks = 0, idma_addr = 0; 1222 u32 regs_base, quirks = 0, idma_addr = 0;
1224 struct device_node *np = pdev->dev.of_node; 1223 struct device_node *np = pdev->dev.of_node;
@@ -1267,13 +1266,8 @@ static int samsung_i2s_probe(struct platform_device *pdev)
1267 pri_dai->dma_capture.filter_data = i2s_pdata->dma_capture; 1266 pri_dai->dma_capture.filter_data = i2s_pdata->dma_capture;
1268 pri_dai->filter = i2s_pdata->dma_filter; 1267 pri_dai->filter = i2s_pdata->dma_filter;
1269 1268
1270 if (&i2s_pdata->type) 1269 quirks = i2s_pdata->type.quirks;
1271 i2s_cfg = &i2s_pdata->type.i2s; 1270 idma_addr = i2s_pdata->type.idma_addr;
1272
1273 if (i2s_cfg) {
1274 quirks = i2s_cfg->quirks;
1275 idma_addr = i2s_cfg->idma_addr;
1276 }
1277 } else { 1271 } else {
1278 quirks = i2s_dai_data->quirks; 1272 quirks = i2s_dai_data->quirks;
1279 if (of_property_read_u32(np, "samsung,idma-addr", 1273 if (of_property_read_u32(np, "samsung,idma-addr",