* [PATCH] [media] tda18271: Fix identation
@ 2014-11-26 15:26 Mauro Carvalho Chehab
2014-11-27 18:47 ` Michael Ira Krufky
0 siblings, 1 reply; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2014-11-26 15:26 UTC (permalink / raw)
To: Linux Media Mailing List
Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab, Michael Krufky
As reported by smatch:
drivers/media/tuners/tda18271-common.c:176 tda18271_read_extended() warn: if statement not indented
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
diff --git a/drivers/media/tuners/tda18271-common.c b/drivers/media/tuners/tda18271-common.c
index 86e5e3110118..6118203543ea 100644
--- a/drivers/media/tuners/tda18271-common.c
+++ b/drivers/media/tuners/tda18271-common.c
@@ -173,12 +173,9 @@ int tda18271_read_extended(struct dvb_frontend *fe)
for (i = 0; i < TDA18271_NUM_REGS; i++) {
/* don't update write-only registers */
- if ((i != R_EB9) &&
- (i != R_EB16) &&
- (i != R_EB17) &&
- (i != R_EB19) &&
- (i != R_EB20))
- regs[i] = regdump[i];
+ if ((i != R_EB9) && (i != R_EB16) && (i != R_EB17) &&
+ (i != R_EB19) && (i != R_EB20))
+ regs[i] = regdump[i];
}
if (tda18271_debug & DBG_REG)
--
1.9.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] [media] tda18271: Fix identation
2014-11-26 15:26 [PATCH] [media] tda18271: Fix identation Mauro Carvalho Chehab
@ 2014-11-27 18:47 ` Michael Ira Krufky
2014-11-27 18:59 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 5+ messages in thread
From: Michael Ira Krufky @ 2014-11-27 18:47 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab
On Wed, Nov 26, 2014 at 10:26 AM, Mauro Carvalho Chehab
<mchehab@osg.samsung.com> wrote:
> As reported by smatch:
> drivers/media/tuners/tda18271-common.c:176 tda18271_read_extended() warn: if statement not indented
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
>
> diff --git a/drivers/media/tuners/tda18271-common.c b/drivers/media/tuners/tda18271-common.c
> index 86e5e3110118..6118203543ea 100644
> --- a/drivers/media/tuners/tda18271-common.c
> +++ b/drivers/media/tuners/tda18271-common.c
> @@ -173,12 +173,9 @@ int tda18271_read_extended(struct dvb_frontend *fe)
>
> for (i = 0; i < TDA18271_NUM_REGS; i++) {
> /* don't update write-only registers */
> - if ((i != R_EB9) &&
> - (i != R_EB16) &&
> - (i != R_EB17) &&
> - (i != R_EB19) &&
> - (i != R_EB20))
> - regs[i] = regdump[i];
> + if ((i != R_EB9) && (i != R_EB16) && (i != R_EB17) &&
> + (i != R_EB19) && (i != R_EB20))
> + regs[i] = regdump[i];
> }
>
> if (tda18271_debug & DBG_REG)
> --
> 1.9.3
>
Mauro,
I would actually rather NOT merge this patch. This hurts the
readability of the code. If applied already, please revert it.
Cheers,
Mike
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [media] tda18271: Fix identation
2014-11-27 18:47 ` Michael Ira Krufky
@ 2014-11-27 18:59 ` Mauro Carvalho Chehab
2014-11-27 19:04 ` Michael Ira Krufky
0 siblings, 1 reply; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2014-11-27 18:59 UTC (permalink / raw)
To: Michael Ira Krufky; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab
Em Thu, 27 Nov 2014 13:47:09 -0500
Michael Ira Krufky <mkrufky@linuxtv.org> escreveu:
> On Wed, Nov 26, 2014 at 10:26 AM, Mauro Carvalho Chehab
> <mchehab@osg.samsung.com> wrote:
> > As reported by smatch:
> > drivers/media/tuners/tda18271-common.c:176 tda18271_read_extended() warn: if statement not indented
> >
> > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> >
> > diff --git a/drivers/media/tuners/tda18271-common.c b/drivers/media/tuners/tda18271-common.c
> > index 86e5e3110118..6118203543ea 100644
> > --- a/drivers/media/tuners/tda18271-common.c
> > +++ b/drivers/media/tuners/tda18271-common.c
> > @@ -173,12 +173,9 @@ int tda18271_read_extended(struct dvb_frontend *fe)
> >
> > for (i = 0; i < TDA18271_NUM_REGS; i++) {
> > /* don't update write-only registers */
> > - if ((i != R_EB9) &&
> > - (i != R_EB16) &&
> > - (i != R_EB17) &&
> > - (i != R_EB19) &&
> > - (i != R_EB20))
> > - regs[i] = regdump[i];
> > + if ((i != R_EB9) && (i != R_EB16) && (i != R_EB17) &&
> > + (i != R_EB19) && (i != R_EB20))
> > + regs[i] = regdump[i];
> > }
> >
> > if (tda18271_debug & DBG_REG)
> > --
> > 1.9.3
> >
>
> Mauro,
>
> I would actually rather NOT merge this patch. This hurts the
> readability of the code. If applied already, please revert it.
What hurts readability is to not indent regs[i] = regdump[i];
>
> Cheers,
>
> Mike
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [media] tda18271: Fix identation
2014-11-27 18:59 ` Mauro Carvalho Chehab
@ 2014-11-27 19:04 ` Michael Ira Krufky
2014-11-27 21:45 ` Antti Palosaari
0 siblings, 1 reply; 5+ messages in thread
From: Michael Ira Krufky @ 2014-11-27 19:04 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab
On Thu, Nov 27, 2014 at 1:59 PM, Mauro Carvalho Chehab
<mchehab@osg.samsung.com> wrote:
> Em Thu, 27 Nov 2014 13:47:09 -0500
> Michael Ira Krufky <mkrufky@linuxtv.org> escreveu:
>
>> On Wed, Nov 26, 2014 at 10:26 AM, Mauro Carvalho Chehab
>> <mchehab@osg.samsung.com> wrote:
>> > As reported by smatch:
>> > drivers/media/tuners/tda18271-common.c:176 tda18271_read_extended() warn: if statement not indented
>> >
>> > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
>> >
>> > diff --git a/drivers/media/tuners/tda18271-common.c b/drivers/media/tuners/tda18271-common.c
>> > index 86e5e3110118..6118203543ea 100644
>> > --- a/drivers/media/tuners/tda18271-common.c
>> > +++ b/drivers/media/tuners/tda18271-common.c
>> > @@ -173,12 +173,9 @@ int tda18271_read_extended(struct dvb_frontend *fe)
>> >
>> > for (i = 0; i < TDA18271_NUM_REGS; i++) {
>> > /* don't update write-only registers */
>> > - if ((i != R_EB9) &&
>> > - (i != R_EB16) &&
>> > - (i != R_EB17) &&
>> > - (i != R_EB19) &&
>> > - (i != R_EB20))
>> > - regs[i] = regdump[i];
>> > + if ((i != R_EB9) && (i != R_EB16) && (i != R_EB17) &&
>> > + (i != R_EB19) && (i != R_EB20))
>> > + regs[i] = regdump[i];
>> > }
>> >
>> > if (tda18271_debug & DBG_REG)
>> > --
>> > 1.9.3
>> >
>>
>> Mauro,
>>
>> I would actually rather NOT merge this patch. This hurts the
>> readability of the code. If applied already, please revert it.
>
> What hurts readability is to not indent regs[i] = regdump[i];
>
>>
>> Cheers,
>>
>> Mike
If the patch were only fixing the indent of "regs[i] = regdump[i];"
then it wouldn't bother me. I don't approve of the whitespace change
in the if statement.
Please resubmit it as a one-liner that *only* fixes the single bad
indentation of the assignment to regs[i].
Cheers,
Mike
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [media] tda18271: Fix identation
2014-11-27 19:04 ` Michael Ira Krufky
@ 2014-11-27 21:45 ` Antti Palosaari
0 siblings, 0 replies; 5+ messages in thread
From: Antti Palosaari @ 2014-11-27 21:45 UTC (permalink / raw)
To: Michael Ira Krufky, Mauro Carvalho Chehab
Cc: Linux Media Mailing List, Mauro Carvalho Chehab
On 11/27/2014 09:04 PM, Michael Ira Krufky wrote:
> On Thu, Nov 27, 2014 at 1:59 PM, Mauro Carvalho Chehab
> <mchehab@osg.samsung.com> wrote:
>> Em Thu, 27 Nov 2014 13:47:09 -0500
>> Michael Ira Krufky <mkrufky@linuxtv.org> escreveu:
>>
>>> On Wed, Nov 26, 2014 at 10:26 AM, Mauro Carvalho Chehab
>>> <mchehab@osg.samsung.com> wrote:
>>>> As reported by smatch:
>>>> drivers/media/tuners/tda18271-common.c:176 tda18271_read_extended() warn: if statement not indented
>>>>
>>>> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
>>>>
>>>> diff --git a/drivers/media/tuners/tda18271-common.c b/drivers/media/tuners/tda18271-common.c
>>>> index 86e5e3110118..6118203543ea 100644
>>>> --- a/drivers/media/tuners/tda18271-common.c
>>>> +++ b/drivers/media/tuners/tda18271-common.c
>>>> @@ -173,12 +173,9 @@ int tda18271_read_extended(struct dvb_frontend *fe)
>>>>
>>>> for (i = 0; i < TDA18271_NUM_REGS; i++) {
>>>> /* don't update write-only registers */
>>>> - if ((i != R_EB9) &&
>>>> - (i != R_EB16) &&
>>>> - (i != R_EB17) &&
>>>> - (i != R_EB19) &&
>>>> - (i != R_EB20))
>>>> - regs[i] = regdump[i];
>>>> + if ((i != R_EB9) && (i != R_EB16) && (i != R_EB17) &&
>>>> + (i != R_EB19) && (i != R_EB20))
>>>> + regs[i] = regdump[i];
>>>> }
>>>>
>>>> if (tda18271_debug & DBG_REG)
>>>> --
>>>> 1.9.3
>>>>
>>>
>>> Mauro,
>>>
>>> I would actually rather NOT merge this patch. This hurts the
>>> readability of the code. If applied already, please revert it.
>>
>> What hurts readability is to not indent regs[i] = regdump[i];
>>
>>>
>>> Cheers,
>>>
>>> Mike
>
>
> If the patch were only fixing the indent of "regs[i] = regdump[i];"
> then it wouldn't bother me. I don't approve of the whitespace change
> in the if statement.
>
> Please resubmit it as a one-liner that *only* fixes the single bad
> indentation of the assignment to regs[i].
switch-case is most suitable for that kind of comparisons.
regards
Antti
--
http://palosaari.fi/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-11-27 21:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-26 15:26 [PATCH] [media] tda18271: Fix identation Mauro Carvalho Chehab
2014-11-27 18:47 ` Michael Ira Krufky
2014-11-27 18:59 ` Mauro Carvalho Chehab
2014-11-27 19:04 ` Michael Ira Krufky
2014-11-27 21:45 ` Antti Palosaari
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).