From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH] drivers: video: i740fb: add 'default' processing contents for 'switch'.
Date: Fri, 30 Aug 2013 07:21:52 +0000 [thread overview]
Message-ID: <52204810.6020504@ti.com> (raw)
In-Reply-To: <51ECF12D.8060903@asianux.com>
[-- Attachment #1: Type: text/plain, Size: 1008 bytes --]
On 22/07/13 11:45, Chen Gang wrote:
> Need add related 'default' processing contents for 'switch', or may
> report 'wm' uninitialized warning.
>
> The related warning:
>
> drivers/video/i740fb.c:662:26: warning: ‘wm’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>
>
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
> drivers/video/i740fb.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/video/i740fb.c b/drivers/video/i740fb.c
> index 6c48388..e82e767 100644
> --- a/drivers/video/i740fb.c
> +++ b/drivers/video/i740fb.c
> @@ -336,6 +336,9 @@ static u32 i740_calc_fifo(struct i740fb_par *par, u32 freq, int bpp)
> wm = 0x16110000;
> }
> break;
> + default:
> + wm = 0;
> + BUG();
> }
I don't think you should use BUG there. BUG should be used when there's
not really a good way to continue. Here you could have just a WARN, and
return some default FIFO watermark value.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
next prev parent reply other threads:[~2013-08-30 7:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-22 8:45 [PATCH] drivers: video: i740fb: add 'default' processing contents for 'switch' Chen Gang
2013-08-30 7:21 ` Tomi Valkeinen [this message]
2013-08-30 8:17 ` Chen Gang
2013-08-30 8:36 ` Tomi Valkeinen
2013-08-30 8:44 ` Chen Gang
2013-08-30 9:16 ` Tomi Valkeinen
2013-08-30 9:45 ` Chen Gang
2013-08-30 10:19 ` Tomi Valkeinen
2013-08-30 10:41 ` Chen Gang
2013-08-30 10:52 ` Tomi Valkeinen
2013-09-02 1:41 ` Chen Gang
2013-09-02 6:45 ` Tomi Valkeinen
2013-09-02 6:45 ` Chen Gang
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=52204810.6020504@ti.com \
--to=tomi.valkeinen@ti.com \
--cc=linux-fbdev@vger.kernel.org \
/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 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).