[PATCH] staging: vc04_services: bcm2835-audio: Fixed warnings
Fixed warnings provided by checkpatch.pl Signed-off-by: Arnold Chand --- .../vc04_services/bcm2835-audio/bcm2835-ctl.c | 18 +++--- .../vc04_services/bcm2835-audio/bcm2835-pcm.c | 25 .../bcm2835-audio/bcm2835-vchiq.c | 59 ++- .../vc04_services/bcm2835-audio/bcm2835.h | 4 +- 4 files changed, 56 insertions(+), 50 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c index a6ec72a5f0be..04df4e7a1d24 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c @@ -68,7 +68,7 @@ static int snd_bcm2835_ctl_get(struct snd_kcontrol *kcontrol, } static int snd_bcm2835_ctl_put(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) + struct snd_ctl_elem_value *ucontrol) { struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol); int val, *valp; @@ -101,7 +101,8 @@ static const struct snd_kcontrol_new snd_bcm2835_ctl[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "PCM Playback Volume", - .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, + .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | + SNDRV_CTL_ELEM_ACCESS_TLV_READ, .private_value = PCM_PLAYBACK_VOLUME, .info = snd_bcm2835_ctl_info, .get = snd_bcm2835_ctl_get, @@ -129,7 +130,7 @@ static const struct snd_kcontrol_new snd_bcm2835_ctl[] = { }; static int snd_bcm2835_spdif_default_info(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_info *uinfo) + struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; uinfo->count = 1; @@ -137,7 +138,7 @@ static int snd_bcm2835_spdif_default_info(struct snd_kcontrol *kcontrol, } static int snd_bcm2835_spdif_default_get(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) +struct snd_ctl_elem_value *ucontrol) { struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol); int i; @@ -153,7 +154,7 @@ static int snd_bcm2835_spdif_default_get(struct snd_kcontrol *kcontrol, } static int snd_bcm2835_spdif_default_put(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) +struct snd_ctl_elem_value *ucontrol) { struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol); unsigned int val = 0; @@ -162,7 +163,8 @@ static int snd_bcm2835_spdif_default_put(struct snd_kcontrol *kcontrol, mutex_lock(&chip->audio_mutex); for (i = 0; i < 4; i++) - val |= (unsigned int)ucontrol->value.iec958.status[i] << (i * 8); + val |= (unsigned int)ucontrol->value.iec958.status[i] << + (i * 8); change = val != chip->spdif_status; chip->spdif_status = val; @@ -172,7 +174,7 @@ static int snd_bcm2835_spdif_default_put(struct snd_kcontrol *kcontrol, } static int snd_bcm2835_spdif_mask_info(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_info *uinfo) + struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; uinfo->count = 1; @@ -180,7 +182,7 @@ static int snd_bcm2835_spdif_mask_info(struct snd_kcontrol *kcontrol, } static int snd_bcm2835_spdif_mask_get(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) + struct snd_ctl_elem_value *ucontrol) { /* * bcm2835 supports only consumer mode and sets all other format flags diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c index e66da11af5cf..68766e57f6e2 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c @@ -81,17 +81,17 @@ void bcm2835_playback_fifo(struct bcm2835_alsa_stream *alsa_stream, } /* open callback */ -static int snd_bcm2835_playback_open_generic( - struct snd_pcm_substream *substream, int spdif) +static int snd_bcm2835_playback_open_generic(struct snd_pcm_substream *substrm, +int spdif) { - struct bcm2835_chip *chip = snd_pcm_substream_chip(substream); - struct snd_pcm_runtime *runtime = substream->runtime; + struct bcm2835_chip *chip = snd_pcm_substream_chip(substrm); + struct snd_pcm_runtime *runtime = substrm->runtime; struct bcm2835_alsa_stream *alsa_stream; int idx; int err; mutex_lock(&chip->
[PATCH v2] staging: vc04_services: bcm2835-audio: Fixed warnings, checks
Corrected warnings and checks provided by scripts/checkpatch.pl which includes: alignment of parenthesis, lines over 80 characters and mutex definition without comment. Signed-off-by: Arnold Chand --- .../vc04_services/bcm2835-audio/bcm2835-ctl.c | 18 +++--- .../vc04_services/bcm2835-audio/bcm2835-pcm.c | 25 .../bcm2835-audio/bcm2835-vchiq.c | 59 ++- .../vc04_services/bcm2835-audio/bcm2835.h | 4 +- 4 files changed, 56 insertions(+), 50 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c index a6ec72a5f0be..04df4e7a1d24 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c @@ -68,7 +68,7 @@ static int snd_bcm2835_ctl_get(struct snd_kcontrol *kcontrol, } static int snd_bcm2835_ctl_put(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) + struct snd_ctl_elem_value *ucontrol) { struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol); int val, *valp; @@ -101,7 +101,8 @@ static const struct snd_kcontrol_new snd_bcm2835_ctl[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "PCM Playback Volume", - .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, + .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | + SNDRV_CTL_ELEM_ACCESS_TLV_READ, .private_value = PCM_PLAYBACK_VOLUME, .info = snd_bcm2835_ctl_info, .get = snd_bcm2835_ctl_get, @@ -129,7 +130,7 @@ static const struct snd_kcontrol_new snd_bcm2835_ctl[] = { }; static int snd_bcm2835_spdif_default_info(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_info *uinfo) + struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; uinfo->count = 1; @@ -137,7 +138,7 @@ static int snd_bcm2835_spdif_default_info(struct snd_kcontrol *kcontrol, } static int snd_bcm2835_spdif_default_get(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) +struct snd_ctl_elem_value *ucontrol) { struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol); int i; @@ -153,7 +154,7 @@ static int snd_bcm2835_spdif_default_get(struct snd_kcontrol *kcontrol, } static int snd_bcm2835_spdif_default_put(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) +struct snd_ctl_elem_value *ucontrol) { struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol); unsigned int val = 0; @@ -162,7 +163,8 @@ static int snd_bcm2835_spdif_default_put(struct snd_kcontrol *kcontrol, mutex_lock(&chip->audio_mutex); for (i = 0; i < 4; i++) - val |= (unsigned int)ucontrol->value.iec958.status[i] << (i * 8); + val |= (unsigned int)ucontrol->value.iec958.status[i] << + (i * 8); change = val != chip->spdif_status; chip->spdif_status = val; @@ -172,7 +174,7 @@ static int snd_bcm2835_spdif_default_put(struct snd_kcontrol *kcontrol, } static int snd_bcm2835_spdif_mask_info(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_info *uinfo) + struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; uinfo->count = 1; @@ -180,7 +182,7 @@ static int snd_bcm2835_spdif_mask_info(struct snd_kcontrol *kcontrol, } static int snd_bcm2835_spdif_mask_get(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) + struct snd_ctl_elem_value *ucontrol) { /* * bcm2835 supports only consumer mode and sets all other format flags diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c index e66da11af5cf..68766e57f6e2 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c @@ -81,17 +81,17 @@ void bcm2835_playback_fifo(struct bcm2835_alsa_stream *alsa_stream, } /* open callback */ -static int snd_bcm2835_playback_open_generic( - struct snd_pcm_substream *substream, int spdif) +static int snd_bcm2835_playback_open_generic(struct snd_pcm_substream *substrm, +int spdif) { - struct bcm2835_chip *chip = snd_pcm_substream_chip(substream); - struct snd_pcm_runtime *runtime = substream->runtime; + struct bcm2835_chip *chip = snd_pcm_substream_chip(substrm); + struct snd_pcm_runtime *runtime = substr
Re: [PATCH] staging: vc04_services: bcm2835-audio: Fixed warnings, checks
On Mon, 2018-11-12 at 17:08 -0800, gre...@linuxfoundation.org wrote: > On Mon, Nov 12, 2018 at 07:29:09PM -0500, Arnold Chand wrote: > > Corrected warnings and checks issued by scripts/checkpatch.pl which > > includes: > > alignment of > > parenthesis, lines over 80 characters and mutex definition without comment. > > Signed-off-by: Arnold Chand --- > > .../vc04_services/bcm2835-audio/bcm2835-ctl.c | 18 +++--- > > .../vc04_services/bcm2835-audio/bcm2835-pcm.c | 25 .../bcm2835- > > audio/bcm2835-vchiq.c | 59 ++- > > .../vc04_services/bcm2835-audio/bcm2835.h | 4 +- 4 files changed, 56 > > insertions(+), 50 deletions(-) > > diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c > > b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.cindex > > a6ec72a5f0be..04df4e7a1d24 100644--- > > a/drivers/staging/vc04_services/bcm2835- > > audio/bcm2835-ctl.c+++ > > b/drivers/staging/vc04_services/bcm2835-audio/bcm2835- > > ctl.c@@ -68,7 +68,7 @@ static int snd_bcm2835_ctl_get(struct snd_kcontrol > > *kcontrol, } static int snd_bcm2835_ctl_put(struct snd_kcontrol > > *kcontrol,- > > struct snd_ctl_elem_value *ucontrol)+ > >struct snd_ctl_elem_value *ucontrol) { struct bcm2835_chip > > *chip = > > snd_kcontrol_chip(kcontrol);int val, *valp;@@ -101,7 +101,8 @@ > > static const > > struct snd_kcontrol_new snd_bcm2835_ctl[] = { { .iface = > > SNDRV_CTL_ELEM_IFACE_MIXER, .name = "PCM Playback Volume",- > > > > .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | > > SNDRV_CTL_ELEM_ACCESS_TLV_READ,+ > > .access = SNDRV_CTL_ELEM_ACCESS_READWRITE |+ SNDRV > > _CTL_ELEM_ACCESS_TLV_READ, .private_value = PCM_PLAYBACK_VOLUME, > > .info = snd_bcm2835_ctl_info, .get = snd_bcm2835_ctl_get,@@ > > -129,7 +130,7 @@ static const struct snd_kcontrol_new snd_bcm2835_ctl[] = { > > }; static int snd_bcm2835_spdif_default_info(struct snd_kcontrol > > *kcontrol,- > > struct snd_ctl_elem_info *uinfo)+ struc > > t snd_ctl_elem_info *uinfo) { uinfo->type = > > SNDRV_CTL_ELEM_TYPE_IEC958; > > uinfo->count = 1;@@ -137,7 +138,7 @@ static int > > snd_bcm2835_spdif_default_info(struct snd_kcontrol *kcontrol, } static int > > snd_bcm2835_spdif_default_get(struct snd_kcontrol *kcontrol,- struct > > snd_ctl_elem_value *ucontrol)+ struct > > snd_ctl_elem_value *ucontrol) { struct bcm2835_chip *chip = > > snd_kcontrol_chip(kcontrol);int i;@@ -153,7 +154,7 @@ static int > > snd_bcm2835_spdif_default_get(struct snd_kcontrol *kcontrol, } static int > > snd_bcm2835_spdif_default_put(struct snd_kcontrol *kcontrol,- struct > > snd_ctl_elem_value *ucontrol)+ struct > > snd_ctl_elem_value *ucontrol) { struct bcm2835_chip *chip = > > snd_kcontrol_chip(kcontrol);unsigned int val = 0;@@ -162,7 +163,8 > > @@ static > > int snd_bcm2835_spdif_default_put(struct snd_kcontrol *kcontrol,mutex_l > > ock(&chip->audio_mutex);for (i = 0; i < 4; i++)-val |= > > (unsigned int)ucontrol->value.iec958.status[i] << (i * 8);+ val |= > > (unsigned int)ucontrol->value.iec958.status[i] <<+ (i * > > 8); change = val != chip->spdif_status; chip->spdif_status = > > val;@@ > > -172,7 +174,7 @@ static int snd_bcm2835_spdif_default_put(struct > > snd_kcontrol > > *kcontrol, } static int snd_bcm2835_spdif_mask_info(struct snd_kcontrol > > *kcontrol,- struct snd_ctl_elem_info *uinfo)+ > >struct snd_ctl_elem_info *uinfo) { uinfo->type = > > SNDRV_CTL_ELEM_TYPE_IEC958; uinfo->count = 1;@@ -180,7 +182,7 @@ > > static int > > snd_bcm2835_spdif_mask_info(struct snd_kcontrol *kcontrol, } static int > > snd_bcm2835_spdif_mask_get(struct snd_kcontrol *kcontrol,- struct > > snd_ctl_elem_value *ucontrol)+struct > > snd_ctl_elem_value *ucontrol) { /* * bcm2835 supports only > > consumer mode and sets all other format flagsdiff --git > > a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c > > b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.cindex > > e66da11af5cf..68766e57f6e2 100644--- > > a/drivers/staging/vc04_services/bcm2835- > > a
[PATCH] staging: vc04_services: bcm2835-audio: bcm2835-ctl.c fixed warnings
Fixed lines over 80 characters by adding braces where control flow statements are more than one line, aligned parenthesis of function arguments. Signed-off-by: Arnold Chand --- .../vc04_services/bcm2835-audio/bcm2835-ctl.c | 27 +++ 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c index a6ec72a5f0be..47347ec82572 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c @@ -68,7 +68,7 @@ static int snd_bcm2835_ctl_get(struct snd_kcontrol *kcontrol, } static int snd_bcm2835_ctl_put(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) + struct snd_ctl_elem_value *ucontrol) { struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol); int val, *valp; @@ -88,8 +88,10 @@ static int snd_bcm2835_ctl_put(struct snd_kcontrol *kcontrol, if (val != *valp) { *valp = val; changed = 1; - if (bcm2835_audio_set_chip_ctls(chip)) - dev_err(chip->card->dev, "Failed to set ALSA controls..\n"); + if (bcm2835_audio_set_chip_ctls(chip)) { + dev_err(chip->card->dev, + "Failed to set ALSA controls..\n"); + } } mutex_unlock(&chip->audio_mutex); return changed; @@ -101,7 +103,8 @@ static const struct snd_kcontrol_new snd_bcm2835_ctl[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "PCM Playback Volume", - .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, + .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | + SNDRV_CTL_ELEM_ACCESS_TLV_READ, .private_value = PCM_PLAYBACK_VOLUME, .info = snd_bcm2835_ctl_info, .get = snd_bcm2835_ctl_get, @@ -129,7 +132,7 @@ static const struct snd_kcontrol_new snd_bcm2835_ctl[] = { }; static int snd_bcm2835_spdif_default_info(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_info *uinfo) + struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; uinfo->count = 1; @@ -137,7 +140,7 @@ static int snd_bcm2835_spdif_default_info(struct snd_kcontrol *kcontrol, } static int snd_bcm2835_spdif_default_get(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) +struct snd_ctl_elem_value *ucontrol) { struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol); int i; @@ -153,7 +156,7 @@ static int snd_bcm2835_spdif_default_get(struct snd_kcontrol *kcontrol, } static int snd_bcm2835_spdif_default_put(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) +struct snd_ctl_elem_value *ucontrol) { struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol); unsigned int val = 0; @@ -161,8 +164,10 @@ static int snd_bcm2835_spdif_default_put(struct snd_kcontrol *kcontrol, mutex_lock(&chip->audio_mutex); - for (i = 0; i < 4; i++) - val |= (unsigned int)ucontrol->value.iec958.status[i] << (i * 8); + for (i = 0; i < 4; i++) { + val |= (unsigned int)ucontrol->value.iec958.status[i] << + (i * 8); + } change = val != chip->spdif_status; chip->spdif_status = val; @@ -172,7 +177,7 @@ static int snd_bcm2835_spdif_default_put(struct snd_kcontrol *kcontrol, } static int snd_bcm2835_spdif_mask_info(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_info *uinfo) + struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; uinfo->count = 1; @@ -180,7 +185,7 @@ static int snd_bcm2835_spdif_mask_info(struct snd_kcontrol *kcontrol, } static int snd_bcm2835_spdif_mask_get(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) + struct snd_ctl_elem_value *ucontrol) { /* * bcm2835 supports only consumer mode and sets all other format flags -- 2.19.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel