All of lore.kernel.org
 help / color / mirror / Atom feed
From: Poyo VL <poyo_vl@yahoo.com>
To: kernel-janitors@vger.kernel.org
Subject: [PATCH] drivers/block/cciss.c (2.6.35.7): Fixed useless compile warning
Date: Mon, 20 Sep 2010 17:48:08 +0000	[thread overview]
Message-ID: <115163.69814.qm@web45812.mail.sp1.yahoo.com> (raw)

I am sorry if I sent this wrong, but someone told me to send this to this e-mail 
adress.
There isn't practically any problem, but the compiler can't know that, because 
sn is initialized in a conditional expression (else return snprintf(...)...), 
and it throws those ugly warnings:
drivers/block/cciss.c: In function ‘dev_show_unique_id’:
drivers/block/cciss.c:564:7: warning: ‘sn[0]’ may be used uninitialized in this 
function
drivers/block/cciss.c:564:7: warning: ‘sn[1]’ may be used uninitialized in this 
function
drivers/block/cciss.c:564:7: warning: ‘sn[2]’ may be used uninitialized in this 
function
drivers/block/cciss.c:564:7: warning: ‘sn[3]’ may be used uninitialized in this 
function
drivers/block/cciss.c:564:7: warning: ‘sn[4]’ may be used uninitialized in this 
function
drivers/block/cciss.c:564:7: warning: ‘sn[5]’ may be used uninitialized in this 
function
drivers/block/cciss.c:564:7: warning: ‘sn[6]’ may be used uninitialized in this 
function
drivers/block/cciss.c:564:7: warning: ‘sn[7]’ may be used uninitialized in this 
function
drivers/block/cciss.c:564:7: warning: ‘sn[8]’ may be used uninitialized in this 
function
drivers/block/cciss.c:564:7: warning: ‘sn[9]’ may be used uninitialized in this 
function
drivers/block/cciss.c:564:7: warning: ‘sn[10]’ may be used uninitialized in this 

function
drivers/block/cciss.c:564:7: warning: ‘sn[11]’ may be used uninitialized in this 

function
drivers/block/cciss.c:564:7: warning: ‘sn[12]’ may be used uninitialized in this 

function
drivers/block/cciss.c:564:7: warning: ‘sn[13]’ may be used uninitialized in this 

function
drivers/block/cciss.c:564:7: warning: ‘sn[14]’ may be used uninitialized in this 

function
drivers/block/cciss.c:564:7: warning: ‘sn[15]’ may be used uninitialized in this 

function
Just have to initialize sn[] with 0. It is practically useless, but the compiler 

wan't throw that warnings anymore.
Patch downer. Thanks.

Signed-off-by: Ionut Gabriel Popescu <poyo_vl@yahoo.com>
---

--- a/drivers/block/cciss.c    2010-09-17 20:17:49.844010958 +0300
+++ b/drivers/block/cciss.c    2010-09-13 19:54:58.000000000 +0300
@@ -561,7 +561,7 @@ static ssize_t dev_show_unique_id(struct
{
     drive_info_struct *drv = to_drv(dev);
     struct ctlr_info *h = to_hba(drv->dev.parent);
-    __u8 sn[16] = {0};
+    __u8 sn[16];
     unsigned long flags;
     int ret = 0;


      

             reply	other threads:[~2010-09-20 17:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-20 17:48 Poyo VL [this message]
2010-09-21  7:05 ` [PATCH] drivers/block/cciss.c (2.6.35.7): Fixed useless Dan Carpenter
2010-09-21  7:23 ` [PATCH] drivers/block/cciss.c (2.6.35.7): Fixed useless compile walter harms

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=115163.69814.qm@web45812.mail.sp1.yahoo.com \
    --to=poyo_vl@yahoo.com \
    --cc=kernel-janitors@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 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.