* [PATCH] staging: bcm2835-audio: remove more than 80 char error
@ 2017-07-11 11:29 Karuna Grewal
2017-07-11 12:10 ` Dan Carpenter
2017-07-11 12:13 ` Joe Perches
0 siblings, 2 replies; 3+ messages in thread
From: Karuna Grewal @ 2017-07-11 11:29 UTC (permalink / raw)
To: linux-kernel; +Cc: gregkh, devel
remove the more than 80 character error as pointed out by checkpatch by
spliting the statements at the separators in the statements .
Signed-off-by: Karuna Grewal <karunagrewal98@gmail.com>
---
.../vc04_services/bcm2835-audio/bcm2835-ctl.c | 53 ++++++++++++++--------
1 file changed, 35 insertions(+), 18 deletions(-)
diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
index 30d310b..8277c6f 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
@@ -107,7 +107,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 changed = 0;
@@ -116,14 +116,19 @@ static int snd_bcm2835_ctl_put(struct snd_kcontrol *kcontrol,
return -EINTR;
if (kcontrol->private_value == PCM_PLAYBACK_VOLUME) {
- audio_info("Volume change attempted.. volume = %d new_volume = %d\n", chip->volume, (int)ucontrol->value.integer.value[0]);
+ audio_info(
+ "Volume change attempted.. volume = %d new_volume = %d\n",
+ chip->volume, (int)ucontrol->value.integer.value[0]);
if (chip->mute == CTRL_VOL_MUTE) {
- /* changed = toggle_mute(chip, CTRL_VOL_UNMUTE); */
- changed = 1; /* should return 0 to signify no change but the mixer takes this as the opposite sign (no idea why) */
+ /* changed = toggle_mute(chip, CTRL_VOL_UNMUTE);*/
+ /* should return 0*/
+ changed = 1; //mixers takes opposite sign that's why 1
goto unlock;
}
- if (changed || (ucontrol->value.integer.value[0] != chip2alsa(chip->volume))) {
- chip->volume = alsa2chip(ucontrol->value.integer.value[0]);
+ if (changed || (ucontrol->value.integer.value[0] != chip2alsa(
+ chip->volume))) {
+ chip->volume =
+ alsa2chip(ucontrol->value.integer.value[0]);
changed = 1;
}
@@ -154,7 +159,9 @@ static struct snd_kcontrol_new snd_bcm2835_ctl[] = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "PCM Playback Volume",
.index = 0,
- .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,
@@ -186,15 +193,17 @@ static struct snd_kcontrol_new snd_bcm2835_ctl[] = {
},
};
-static int snd_bcm2835_spdif_default_info(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_info *uinfo)
+static int snd_bcm2835_spdif_default_info(
+ struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
uinfo->count = 1;
return 0;
}
-static int snd_bcm2835_spdif_default_get(struct snd_kcontrol *kcontrol,
+static int snd_bcm2835_spdif_default_get(
+ struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
@@ -211,7 +220,8 @@ static int snd_bcm2835_spdif_default_get(struct snd_kcontrol *kcontrol,
return 0;
}
-static int snd_bcm2835_spdif_default_put(struct snd_kcontrol *kcontrol,
+static int snd_bcm2835_spdif_default_put(
+ struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
@@ -222,7 +232,8 @@ static int snd_bcm2835_spdif_default_put(struct snd_kcontrol *kcontrol,
return -EINTR;
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;
@@ -231,7 +242,8 @@ static int snd_bcm2835_spdif_default_put(struct snd_kcontrol *kcontrol,
return change;
}
-static int snd_bcm2835_spdif_mask_info(struct snd_kcontrol *kcontrol,
+static int snd_bcm2835_spdif_mask_info(
+ struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
@@ -239,7 +251,8 @@ static int snd_bcm2835_spdif_mask_info(struct snd_kcontrol *kcontrol,
return 0;
}
-static int snd_bcm2835_spdif_mask_get(struct snd_kcontrol *kcontrol,
+static int snd_bcm2835_spdif_mask_get(
+ struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
/*
@@ -250,7 +263,8 @@ static int snd_bcm2835_spdif_mask_get(struct snd_kcontrol *kcontrol,
return 0;
}
-static int snd_bcm2835_spdif_stream_info(struct snd_kcontrol *kcontrol,
+static int snd_bcm2835_spdif_stream_info(
+ struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
@@ -258,7 +272,8 @@ static int snd_bcm2835_spdif_stream_info(struct snd_kcontrol *kcontrol,
return 0;
}
-static int snd_bcm2835_spdif_stream_get(struct snd_kcontrol *kcontrol,
+static int snd_bcm2835_spdif_stream_get(
+ struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
@@ -275,7 +290,8 @@ static int snd_bcm2835_spdif_stream_get(struct snd_kcontrol *kcontrol,
return 0;
}
-static int snd_bcm2835_spdif_stream_put(struct snd_kcontrol *kcontrol,
+static int snd_bcm2835_spdif_stream_put(
+ struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
@@ -286,7 +302,8 @@ static int snd_bcm2835_spdif_stream_put(struct snd_kcontrol *kcontrol,
return -EINTR;
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;
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] staging: bcm2835-audio: remove more than 80 char error
2017-07-11 11:29 [PATCH] staging: bcm2835-audio: remove more than 80 char error Karuna Grewal
@ 2017-07-11 12:10 ` Dan Carpenter
2017-07-11 12:13 ` Joe Perches
1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2017-07-11 12:10 UTC (permalink / raw)
To: Karuna Grewal; +Cc: linux-kernel, devel, gregkh
On Tue, Jul 11, 2017 at 04:59:14PM +0530, Karuna Grewal wrote:
> remove the more than 80 character error as pointed out by checkpatch by
> spliting the statements at the separators in the statements .
>
Don't indent your commit log.
> - if (changed || (ucontrol->value.integer.value[0] != chip2alsa(chip->volume))) {
> - chip->volume = alsa2chip(ucontrol->value.integer.value[0]);
> + if (changed || (ucontrol->value.integer.value[0] != chip2alsa(
> + chip->volume))) {
> + chip->volume =
> + alsa2chip(ucontrol->value.integer.value[0]);
Don't indent like that.
> @@ -154,7 +159,9 @@ static struct snd_kcontrol_new snd_bcm2835_ctl[] = {
> .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
> .name = "PCM Playback Volume",
> .index = 0,
> - .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ,
> + .access =
> + SNDRV_CTL_ELEM_ACCESS_READWRITE |
> + SNDRV_CTL_ELEM_ACCESS_TLV_READ,
Of this. Just go over 80 characters if that's more readable than
breaking the line up.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] staging: bcm2835-audio: remove more than 80 char error
2017-07-11 11:29 [PATCH] staging: bcm2835-audio: remove more than 80 char error Karuna Grewal
2017-07-11 12:10 ` Dan Carpenter
@ 2017-07-11 12:13 ` Joe Perches
1 sibling, 0 replies; 3+ messages in thread
From: Joe Perches @ 2017-07-11 12:13 UTC (permalink / raw)
To: Karuna Grewal, linux-kernel; +Cc: gregkh, devel
On Tue, 2017-07-11 at 16:59 +0530, Karuna Grewal wrote:
> remove the more than 80 character error as pointed out by checkpatch by
> spliting the statements at the separators in the statements .
Not every 80 column warning needs fixing.
Your selection of separators is poor. For instance:
> diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
[]
> @@ -116,14 +116,19 @@ static int snd_bcm2835_ctl_put(struct snd_kcontrol *kcontrol,
> return -EINTR;
>
> if (kcontrol->private_value == PCM_PLAYBACK_VOLUME) {
> - audio_info("Volume change attempted.. volume = %d new_volume = %d\n", chip->volume, (int)ucontrol->value.integer.value[0]);
> + audio_info(
> + "Volume change attempted.. volume = %d new_volume = %d\n",
> + chip->volume, (int)ucontrol->value.integer.value[0]);
Better:
audio_info("Volume change attempted.. volume = %d new_volume = %d\n",
chip->volume, (int)ucontrol->value.integer.value[0]);
[]
> - if (changed || (ucontrol->value.integer.value[0] != chip2alsa(chip->volume))) {
> - chip->volume = alsa2chip(ucontrol->value.integer.value[0]);
> + if (changed || (ucontrol->value.integer.value[0] != chip2alsa(
> + chip->volume))) {
> + chip->volume =
> + alsa2chip(ucontrol->value.integer.value[0]);
Better:
if (changed ||
ucontrol->value.integer.value[0] != chip2alsa(chip->volume) {
chip->volume = alsa2chip(ucontrol->value.integer.value[0]);
changed = 1;
}
etc...
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-11 12:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-11 11:29 [PATCH] staging: bcm2835-audio: remove more than 80 char error Karuna Grewal
2017-07-11 12:10 ` Dan Carpenter
2017-07-11 12:13 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox