ASoC: rsnd: reduce confusable macro parameter magic

rsnd_dai_call() macro is using "priv" inside.
Thus, if caller function doesn't have "priv" related operation, strange
phenomenon occur which code is using "priv", but compiler indicates
"unused variable 'priv'".

>From code point of view, it is not problem, but it is very confusable.
This patch removes "priv" from rsnd_dai_call() macro, and adds "priv"
on caller function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2017-06-14 07:41:43 +00:00 committed by Mark Brown
parent f0b04d8b44
commit f30b4ca444
1 changed files with 3 additions and 2 deletions

View File

@ -488,8 +488,7 @@ static int rsnd_status_update(u32 *status,
#define rsnd_dai_call(fn, io, param...) \ #define rsnd_dai_call(fn, io, param...) \
({ \ ({ \
struct rsnd_priv *priv = rsnd_io_to_priv(io); \ struct device *dev = rsnd_priv_to_dev(rsnd_io_to_priv(io)); \
struct device *dev = rsnd_priv_to_dev(priv); \
struct rsnd_mod *mod; \ struct rsnd_mod *mod; \
int is_play = rsnd_io_is_play(io); \ int is_play = rsnd_io_is_play(io); \
int ret = 0, i; \ int ret = 0, i; \
@ -741,6 +740,7 @@ static int rsnd_soc_dai_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai); struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
struct rsnd_priv *priv = rsnd_rdai_to_priv(rdai);
struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream); struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
int ret; int ret;
@ -758,6 +758,7 @@ static void rsnd_soc_dai_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai); struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
struct rsnd_priv *priv = rsnd_rdai_to_priv(rdai);
struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream); struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
/* /*