kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [KJ] [PATCH] Removal of compiler warnings in ipc/msg.c
@ 2007-07-17  9:38 Rune V. Sjøen
  2007-07-17  9:43 ` Bernd Petrovitsch
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Rune V. Sjøen @ 2007-07-17  9:38 UTC (permalink / raw)
  To: kernel-janitors

Hello, this is my first patch so please be gentle.
It fixes some compiler warnings in ipc/msg.c

ipc/msg.c: In function 'sys_msgctl':
ipc/msg.c:388: warning: 'setbuf.qbytes' may be used uninitialized in
this function
ipc/msg.c:388: warning: 'setbuf.uid' may be used uninitialized in this function
ipc/msg.c:388: warning: 'setbuf.gid' may be used uninitialized in this function
ipc/msg.c:388: warning: 'setbuf.mode' may be used uninitialized in this function

Any kind of feedback would be appreciated if i've done something wrong.

--
diff --git a/ipc/msg.c b/ipc/msg.c
index cbd27e5..e5e62ca 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -390,6 +390,8 @@ asmlinkage long sys_msgctl(int msqid, int cmd,
struct msqid_ds __user *buf)
       int err, version;
       struct ipc_namespace *ns;

+       memset(&setbuf, '0', sizeof(setbuf));
+
       if (msqid < 0 || cmd < 0)
               return -EINVAL;

-- 
-=<X>=-
Rune V. Sjøen
You always pass failure on the way to success

http://www.opensourcesolutions.no

_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon.
To resubscribe, send email to majordomo@vger.kernel.org with
&quot;subscribe kernel-janitors&quot; in message body and follow instructions.

Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [KJ] [PATCH] Removal of compiler warnings in ipc/msg.c
  2007-07-17  9:38 [KJ] [PATCH] Removal of compiler warnings in ipc/msg.c Rune V. Sjøen
@ 2007-07-17  9:43 ` Bernd Petrovitsch
  2007-07-17 10:00 ` Rune V. Sjøen
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Bernd Petrovitsch @ 2007-07-17  9:43 UTC (permalink / raw)
  To: kernel-janitors

On Tue, 2007-07-17 at 11:38 +0200, Rune V. Sjøen wrote:
> Hello, this is my first patch so please be gentle.
> It fixes some compiler warnings in ipc/msg.c
> 
> ipc/msg.c: In function 'sys_msgctl':
> ipc/msg.c:388: warning: 'setbuf.qbytes' may be used uninitialized in
> this function
> ipc/msg.c:388: warning: 'setbuf.uid' may be used uninitialized in this function
> ipc/msg.c:388: warning: 'setbuf.gid' may be used uninitialized in this function
> ipc/msg.c:388: warning: 'setbuf.mode' may be used uninitialized in this function
> 
> Any kind of feedback would be appreciated if i've done something wrong.
> 
> --
> diff --git a/ipc/msg.c b/ipc/msg.c
> index cbd27e5..e5e62ca 100644
> --- a/ipc/msg.c
> +++ b/ipc/msg.c
> @@ -390,6 +390,8 @@ asmlinkage long sys_msgctl(int msqid, int cmd,
> struct msqid_ds __user *buf)
>        int err, version;
>        struct ipc_namespace *ns;
> 
> +       memset(&setbuf, '0', sizeof(setbuf));

Without looking into the file and context (e.g. if it *really* is used
uninitialized): Are you really sure you really want to write 0x30 (i.e.
decimal 48 and the ASCII value of '0') in every byte instead of 0x00 in
the struct as initialization?

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services


_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon.
To resubscribe, send email to majordomo@vger.kernel.org with
&quot;subscribe kernel-janitors&quot; in message body and follow instructions.

Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [KJ] [PATCH] Removal of compiler warnings in ipc/msg.c
  2007-07-17  9:38 [KJ] [PATCH] Removal of compiler warnings in ipc/msg.c Rune V. Sjøen
  2007-07-17  9:43 ` Bernd Petrovitsch
@ 2007-07-17 10:00 ` Rune V. Sjøen
  2007-07-17 10:12 ` Bernd Petrovitsch
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Rune V. Sjøen @ 2007-07-17 10:00 UTC (permalink / raw)
  To: kernel-janitors

I am not, thank you for pointing that out, my mind was thinking 0
while my fingers typed '0'.

On 7/17/07, Bernd Petrovitsch <bernd@firmix.at> wrote:
> On Tue, 2007-07-17 at 11:38 +0200, Rune V. Sjøen wrote:
> > Hello, this is my first patch so please be gentle.
> > It fixes some compiler warnings in ipc/msg.c
> >
> > ipc/msg.c: In function 'sys_msgctl':
> > ipc/msg.c:388: warning: 'setbuf.qbytes' may be used uninitialized in
> > this function
> > ipc/msg.c:388: warning: 'setbuf.uid' may be used uninitialized in this function
> > ipc/msg.c:388: warning: 'setbuf.gid' may be used uninitialized in this function
> > ipc/msg.c:388: warning: 'setbuf.mode' may be used uninitialized in this function
> >
> > Any kind of feedback would be appreciated if i've done something wrong.
> >
> > --
> > diff --git a/ipc/msg.c b/ipc/msg.c
> > index cbd27e5..e5e62ca 100644
> > --- a/ipc/msg.c
> > +++ b/ipc/msg.c
> > @@ -390,6 +390,8 @@ asmlinkage long sys_msgctl(int msqid, int cmd,
> > struct msqid_ds __user *buf)
> >        int err, version;
> >        struct ipc_namespace *ns;
> >
> > +       memset(&setbuf, '0', sizeof(setbuf));
>
> Without looking into the file and context (e.g. if it *really* is used
> uninitialized): Are you really sure you really want to write 0x30 (i.e.
> decimal 48 and the ASCII value of '0') in every byte instead of 0x00 in
> the struct as initialization?
>
>         Bernd
> --
> Firmix Software GmbH                   http://www.firmix.at/
> mobil: +43 664 4416156                 fax: +43 1 7890849-55
>           Embedded Linux Development and Services
>
>
>


-- 
-=<X>=-
Rune V. Sjøen
You always pass failure on the way to success

http://www.opensourcesolutions.no

_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon.
To resubscribe, send email to majordomo@vger.kernel.org with
&quot;subscribe kernel-janitors&quot; in message body and follow instructions.

Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [KJ] [PATCH] Removal of compiler warnings in ipc/msg.c
  2007-07-17  9:38 [KJ] [PATCH] Removal of compiler warnings in ipc/msg.c Rune V. Sjøen
  2007-07-17  9:43 ` Bernd Petrovitsch
  2007-07-17 10:00 ` Rune V. Sjøen
@ 2007-07-17 10:12 ` Bernd Petrovitsch
  2007-07-17 15:24 ` Randy Dunlap
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Bernd Petrovitsch @ 2007-07-17 10:12 UTC (permalink / raw)
  To: kernel-janitors

On Tue, 2007-07-17 at 12:00 +0200, Rune V. Sjøen wrote:
> I am not, thank you for pointing that out, my mind was thinking 0
> while my fingers typed '0'.

De nada, I also have some of those sometimes.

Next thing is: Please don't top-quote and full-quote. Remove every not
answered (and thus in an answer email irrelevant) line/part and answer
directly below the line(s) where the answer belongs.

In the first answer, it is usually not a big problem (except: imagine
that are 2 questions in the mail below. How does a reader of your mail
exactly know to which of these the answer belongs?).

The problem starts aright afterwards and having one question/problem
discussed in dozen mails is not that seldom.

[ 38 lines of full-quote purposely deleted. I could have left it in but
it doesn't add any new information and saves a little diskspace and
bandwith and especially time in figuring out that there is nothing
interesting and}or new in there -  and that for all readers of this
mailinglist. I don't have an idea about the number on k-j@ but LKML has
(much?) more than 10.000 .... ]

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services


_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon.
To resubscribe, send email to majordomo@vger.kernel.org with
&quot;subscribe kernel-janitors&quot; in message body and follow instructions.

Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [KJ] [PATCH] Removal of compiler warnings in ipc/msg.c
  2007-07-17  9:38 [KJ] [PATCH] Removal of compiler warnings in ipc/msg.c Rune V. Sjøen
                   ` (2 preceding siblings ...)
  2007-07-17 10:12 ` Bernd Petrovitsch
@ 2007-07-17 15:24 ` Randy Dunlap
  2007-07-17 15:57 ` Matthew Wilcox
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Randy Dunlap @ 2007-07-17 15:24 UTC (permalink / raw)
  To: kernel-janitors

On Tue, 17 Jul 2007 12:12:52 +0200 Bernd Petrovitsch wrote:

> On Tue, 2007-07-17 at 12:00 +0200, Rune V. Sjøen wrote:
> > I am not, thank you for pointing that out, my mind was thinking 0
> > while my fingers typed '0'.
> 
> De nada, I also have some of those sometimes.
> 
> Next thing is: Please don't top-quote and full-quote. Remove every not
> answered (and thus in an answer email irrelevant) line/part and answer
> directly below the line(s) where the answer belongs.

next thing:  the patch used spaces for indentation.  It should
use tab(s).  The gmail web interface is sucky for sending
patches.  Hopefully you are using SMTP to gmail.com instead of
the web interface.

next' thing:  use the new KJ mailing list from now on:
  http://vger.kernel.org/vger-lists.html#kernel-janitors

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon.
To resubscribe, send email to majordomo@vger.kernel.org with
&quot;subscribe kernel-janitors&quot; in message body and follow instructions.

Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [KJ] [PATCH] Removal of compiler warnings in ipc/msg.c
  2007-07-17  9:38 [KJ] [PATCH] Removal of compiler warnings in ipc/msg.c Rune V. Sjøen
                   ` (3 preceding siblings ...)
  2007-07-17 15:24 ` Randy Dunlap
@ 2007-07-17 15:57 ` Matthew Wilcox
  2007-07-17 16:01 ` "Rune V. Sjøen"
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Matthew Wilcox @ 2007-07-17 15:57 UTC (permalink / raw)
  To: kernel-janitors

On Tue, Jul 17, 2007 at 11:38:19AM +0200, Rune V. Sj??en wrote:
> Hello, this is my first patch so please be gentle.
> It fixes some compiler warnings in ipc/msg.c
> 
> ipc/msg.c: In function 'sys_msgctl':
> ipc/msg.c:388: warning: 'setbuf.qbytes' may be used uninitialized in
> this function

These warnings are bogus -- it would be more helpful to look at
making GCC smarter so it doesn't emit this warning in this particular
case.  I can prove quite easily that all paths to uses of qbytes
initialise it.

-- 
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon.
To resubscribe, send email to majordomo@vger.kernel.org with
&quot;subscribe kernel-janitors&quot; in message body and follow instructions.

Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [KJ] [PATCH] Removal of compiler warnings in ipc/msg.c
  2007-07-17  9:38 [KJ] [PATCH] Removal of compiler warnings in ipc/msg.c Rune V. Sjøen
                   ` (4 preceding siblings ...)
  2007-07-17 15:57 ` Matthew Wilcox
@ 2007-07-17 16:01 ` "Rune V. Sjøen"
  2007-07-18 22:34 ` Denver Gingerich
  2007-07-19  8:13 ` pradeep singh
  7 siblings, 0 replies; 9+ messages in thread
From: "Rune V. Sjøen" @ 2007-07-17 16:01 UTC (permalink / raw)
  To: kernel-janitors

> These warnings are bogus -- it would be more helpful to look at
> making GCC smarter so it doesn't emit this warning in this particular
> case.  I can prove quite easily that all paths to uses of qbytes
> initialise it.

So there's really no point in patching this ?



_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon.
To resubscribe, send email to majordomo@vger.kernel.org with
&quot;subscribe kernel-janitors&quot; in message body and follow instructions.

Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [KJ] [PATCH] Removal of compiler warnings in ipc/msg.c
  2007-07-17  9:38 [KJ] [PATCH] Removal of compiler warnings in ipc/msg.c Rune V. Sjøen
                   ` (5 preceding siblings ...)
  2007-07-17 16:01 ` "Rune V. Sjøen"
@ 2007-07-18 22:34 ` Denver Gingerich
  2007-07-19  8:13 ` pradeep singh
  7 siblings, 0 replies; 9+ messages in thread
From: Denver Gingerich @ 2007-07-18 22:34 UTC (permalink / raw)
  To: kernel-janitors

On 7/17/07, Randy Dunlap <rdunlap@xenotime.net> wrote:
[...]
> next thing:  the patch used spaces for indentation.  It should
> use tab(s).  The gmail web interface is sucky for sending
> patches.  Hopefully you are using SMTP to gmail.com instead of
> the web interface.

I have successfully used the Gmail web interface to send patches.  I
think the reason that some people run into problems with spaces is
that they copy their patches from an application like GNOME Terminal,
which does not maintain tab characters in its output (it converts them
to spaces).  If you instead copy and paste from an editor such as
gedit, the tabs will be properly copied.

To test whether your mail client is keeping the tabs, I recommend
sending a test message to yourself before sending the patch to a
mailing list.

Denver
_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon.
To resubscribe, send email to majordomo@vger.kernel.org with
&quot;subscribe kernel-janitors&quot; in message body and follow instructions.

Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [KJ] [PATCH] Removal of compiler warnings in ipc/msg.c
  2007-07-17  9:38 [KJ] [PATCH] Removal of compiler warnings in ipc/msg.c Rune V. Sjøen
                   ` (6 preceding siblings ...)
  2007-07-18 22:34 ` Denver Gingerich
@ 2007-07-19  8:13 ` pradeep singh
  7 siblings, 0 replies; 9+ messages in thread
From: pradeep singh @ 2007-07-19  8:13 UTC (permalink / raw)
  To: kernel-janitors

On 7/19/07, Denver Gingerich <denver@ossguy.com> wrote:
> On 7/17/07, Randy Dunlap <rdunlap@xenotime.net> wrote:
> [...]
> > next thing:  the patch used spaces for indentation.  It should
> > use tab(s).  The gmail web interface is sucky for sending
> > patches.  Hopefully you are using SMTP to gmail.com instead of
> > the web interface.
>
> I have successfully used the Gmail web interface to send patches.  I
> think the reason that some people run into problems with spaces is
> that they copy their patches from an application like GNOME Terminal,
> which does not maintain tab characters in its output (it converts them
> to spaces).  If you instead copy and paste from an editor such as
> gedit, the tabs will be properly copied.

It did not work for me months back though :-/
Don't know what am i supposed to do :(
BTW are you sure about this?
There have a lot of reports of patches getting mis-formatted by
gmail's web interface.

>
> To test whether your mail client is keeping the tabs, I recommend
> sending a test message to yourself before sending the patch to a
> mailing list.
>
> Denver
> -
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


-- 
Pradeep
_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon.
To resubscribe, send email to majordomo@vger.kernel.org with
&quot;subscribe kernel-janitors&quot; in message body and follow instructions.

Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-07-19  8:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-17  9:38 [KJ] [PATCH] Removal of compiler warnings in ipc/msg.c Rune V. Sjøen
2007-07-17  9:43 ` Bernd Petrovitsch
2007-07-17 10:00 ` Rune V. Sjøen
2007-07-17 10:12 ` Bernd Petrovitsch
2007-07-17 15:24 ` Randy Dunlap
2007-07-17 15:57 ` Matthew Wilcox
2007-07-17 16:01 ` "Rune V. Sjøen"
2007-07-18 22:34 ` Denver Gingerich
2007-07-19  8:13 ` pradeep singh

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).