From: Malcolm Priestley <tvboxspy@gmail.com>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: Re: [PATCH] [media] lmed04: add missing breaks
Date: Tue, 25 Nov 2014 20:45:23 +0000 [thread overview]
Message-ID: <5474EA63.7070408@gmail.com> (raw)
In-Reply-To: <20141125160033.4d613dd7@recife.lan>
On 25/11/14 18:00, Mauro Carvalho Chehab wrote:
> Em Tue, 25 Nov 2014 17:10:00 +0000
> Malcolm Priestley <malcolmpriestley@gmail.com> escreveu:
>
>> On 25/11/14 11:19, Mauro Carvalho Chehab wrote:
>>> drivers/media/usb/dvb-usb-v2/lmedm04.c:828 lme_firmware_switch() warn: missing break? reassigning 'st->dvb_usb_lme2510_firmware'
>>> drivers/media/usb/dvb-usb-v2/lmedm04.c:849 lme_firmware_switch() warn: missing break? reassigning 'st->dvb_usb_lme2510_firmware'
>>>
>>> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
>>>
>>> diff --git a/drivers/media/usb/dvb-usb-v2/lmedm04.c b/drivers/media/usb/dvb-usb-v2/lmedm04.c
>>> index 9f2c5459b73a..99587418f4f0 100644
>>> --- a/drivers/media/usb/dvb-usb-v2/lmedm04.c
>>> +++ b/drivers/media/usb/dvb-usb-v2/lmedm04.c
>>> @@ -826,6 +826,7 @@ static const char *lme_firmware_switch(struct dvb_usb_device *d, int cold)
>>> break;
>>> }
>>> st->dvb_usb_lme2510_firmware = TUNER_LG;
>>> + break;
>>> case TUNER_LG:
>>> fw_lme = fw_lg;
>>> ret = request_firmware(&fw, fw_lme, &udev->dev);
>>> @@ -847,6 +848,7 @@ static const char *lme_firmware_switch(struct dvb_usb_device *d, int cold)
>>> break;
>>> }
>>> st->dvb_usb_lme2510_firmware = TUNER_LG;
>>> + break;
>>> case TUNER_LG:
>>> fw_lme = fw_c_lg;
>>> ret = request_firmware(&fw, fw_lme, &udev->dev);
>>>
>> The break is not missing it's three lines above.
>>
>> All these switches are fall through until it finds firmware the user has.
>>
>> The switch comes into play when the firmware needs to changed.
>
> Oh! Well, I was so sure that the patch was right that I merged it already.
> My bad.
>
> Anyway, smatch complains if dvb_usb_lme2510_firmware is rewritten,
> and that bothers people that use static analyzers. So, IMO, the best
> is to rework the code in order to:
> - document that the breaks should not be used there;
> - remove smatch warning.
>
> What do you think about the following patch?
Fine
Acked-by: Malcolm Priestley <tvboxspy@gmail.com>
prev parent reply other threads:[~2014-11-25 20:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-25 11:19 [PATCH] [media] lmed04: add missing breaks Mauro Carvalho Chehab
2014-11-25 17:10 ` Malcolm Priestley
2014-11-25 18:00 ` Mauro Carvalho Chehab
2014-11-25 20:45 ` Malcolm Priestley [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5474EA63.7070408@gmail.com \
--to=tvboxspy@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=mchehab@osg.samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.