[alsa-devel] [PATCH 0/3] sound: 3 cosmetic patches
From: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com
3 trivial cosmetic patches.
Guennadi Liakhovetski (3): sound: (cosmetic) remove a superfluous function declaration asoc: (cosmetic) simplify a condition asoc: (cosmetic) simplify a function
sound/core/pcm_native.c | 2 -- sound/soc/soc-core.c | 4 ++-- sound/soc/soc-topology.c | 6 +----- 3 files changed, 3 insertions(+), 9 deletions(-)
From: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com
Declaration of snd_pcm_drop() in sound/core/pcm_native.c is superfluous since the function isn't called before being defined. Remove the declaration.
Signed-off-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com --- sound/core/pcm_native.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 0bc4aa0ac9cf..672babd20cb1 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -1806,8 +1806,6 @@ static const struct action_ops snd_pcm_action_drain_init = { .post_action = snd_pcm_post_drain_init };
-static int snd_pcm_drop(struct snd_pcm_substream *substream); - /* * Drain the stream(s). * When the substream is linked, sync until the draining of all playback streams
On Wed, 30 Jan 2019 17:22:39 +0100, Guennadi Liakhovetski wrote:
From: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com
Declaration of snd_pcm_drop() in sound/core/pcm_native.c is superfluous since the function isn't called before being defined. Remove the declaration.
Signed-off-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com
Applied this one with an adjustment of the subject line. I leave the rest two for ASoC to Mark.
thanks,
Takashi
From: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com
Double negation is often used in the kernel to avoid explicit comparison to 0. However an "if (!!a == !!b)" test can be trivially reduced to "if (!a == !b)".
Signed-off-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com --- sound/soc/soc-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index aae450ba4f08..8c6b688837de 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1106,8 +1106,8 @@ static int soc_init_dai_link(struct snd_soc_card *card, * Codec must be specified by 1 of name or OF node, * not both or neither. */ - if (!!codec->name == - !!codec->of_node) { + if (!codec->name == + !codec->of_node) { dev_err(card->dev, "ASoC: Neither/both codec name/of_node are set for %s\n", link->name); return -EINVAL;
From: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com
Doing "if (a >= b) return 1; return 0;" can be trivially simplified to "return a >= b;" Use this for soc_tplg_is_eof().
Signed-off-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com --- sound/soc/soc-topology.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 045ef136903d..041e7c680a6b 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -111,11 +111,7 @@ static int soc_tplg_check_elem_count(struct soc_tplg *tplg, size_t elem_size,
static inline int soc_tplg_is_eof(struct soc_tplg *tplg) { - const u8 *end = tplg->hdr_pos; - - if (end >= tplg->fw->data + tplg->fw->size) - return 1; - return 0; + return tplg->hdr_pos >= tplg->fw->data + tplg->fw->size; }
static inline unsigned long soc_tplg_get_hdr_offset(struct soc_tplg *tplg)
participants (2)
-
Guennadi Liakhovetski
-
Takashi Iwai