mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: Marin Mitov <mitov@issp.bas.bg>
Cc: David Airlie <airlied@linux.ie>,
	Jesse Barnes <jesse.barnes@intel.com>,
	dri-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH]Silancing a false positive: "may be used uninitialized"
Date: Sun, 20 Dec 2009 20:56:44 +1100	[thread overview]
Message-ID: <20091220095644.GA17838@verge.net.au> (raw)
In-Reply-To: <200912200903.28002.mitov@issp.bas.bg>

On Sun, Dec 20, 2009 at 09:03:27AM +0200, Marin Mitov wrote:
> Hello all,
> 
> Silancing a false positive:
> warning: 'width' may be used uninitialized in this function
> drivers/gpu/drm/drm_edid.c

Is it guaranteed that the switch will always see a value covered by the
four cases it has?  If not width would be used without having been initialised.

Perhaps adding

		default:
			BUG();

would be worthwhile?

> 
> Signed-off-by: Marin Mitov <mitov@issp.bas.bg>
> ==========================================================================
> --- a/drivers/gpu/drm/drm_edid.c	2009-12-20 07:43:57.000000000 +0200
> +++ b/drivers/gpu/drm/drm_edid.c	2009-12-20 07:45:49.000000000 +0200
> @@ -913,7 +913,7 @@
>  	const int rates[] = { 60, 85, 75, 60, 50 };
>  
>  	for (i = 0; i < 4; i++) {
> -		int width, height;
> +		int uninitialized_var(width), height;
>  		cvt = &(timing->data.other_data.data.cvt[i]);
>  
>  		height = (cvt->code[0] + ((cvt->code[1] & 0xf0) << 8) + 1) * 2;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

  reply	other threads:[~2009-12-20  9:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-20  7:03 Marin Mitov
2009-12-20  9:56 ` Simon Horman [this message]
2009-12-20 10:43   ` Marin Mitov
2009-12-20 21:14     ` Simon Horman

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=20091220095644.GA17838@verge.net.au \
    --to=horms@verge.net.au \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=jesse.barnes@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mitov@issp.bas.bg \
    /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

Powered by JetHome