public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: "Cédric Augonnet" <cedric.augonnet@gmail.com>
Cc: Gabriel C <nix.or.die@googlemail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	J.E.J.Bottomley@HansenPartnership.com
Subject: Re: voyager_{thread,cat}.c compile warnings
Date: Sun, 22 Jul 2007 18:39:10 -0500	[thread overview]
Message-ID: <1185147550.3431.19.camel@localhost.localdomain> (raw)
In-Reply-To: <f56c1ba00707221549k768d7df9ke983160e634f4fe3@mail.gmail.com>

On Sun, 2007-07-22 at 18:49 -0400, Cédric Augonnet wrote:
> iff -urN a/arch/i386/mach-voyager/voyager_cat.c
> b/arch/i386/mach-voyager/voyager_cat.c
> --- /home/gonnet/tmp/linux-2.6.22/arch/i386/mach-voyager/voyager_cat.c  2007-07-20 11:50:17.000000000 -0400
> +++ linux-2.6.22/arch/i386/mach-voyager/voyager_cat.c   2007-07-22
> 11:24:34.000000000 -0400
> @@ -682,7 +682,7 @@
>                         outb(VOYAGER_CAT_END, CAT_CMD);
>                         continue;
>                 }
> -               if(eprom_size > sizeof(eprom_buf)) {
> +               if((unsigned)eprom_size > sizeof(eprom_buf)) {

Actually, no.  If gcc can deduce that the comparison is always false
then I want it not to build the body of the if.  The only thing I don't
know how to do is to shut up the warning in this case.  What you've done
is make gcc pretend it doesn't know the if is always false.

>                         printk("**WARNING**: Voyager insufficient size
> to read EPROM data, module 0x%x.  Need %d\n", i, eprom_size);
>                         outb(VOYAGER_CAT_END, CAT_CMD);
>                         continue;
> @@ -752,7 +752,7 @@
>                         outb(VOYAGER_CAT_END, CAT_CMD);
>                         continue;
>                 }
> -               if(eprom_size > sizeof(eprom_buf)) {
> +               if((unsigned)eprom_size > sizeof(eprom_buf)) {
>                         printk("**WARNING**: Voyager insufficient size
> to read EPROM data, module 0x%x.  Need %d\n", i, eprom_size);
>                         outb(VOYAGER_CAT_END, CAT_CMD);
>                         continue;
> diff -urN a/arch/i386/mach-voyager/voyager_thread.c
> b/arch/i386/mach-voyager/voyager_thread.c
> --- /home/gonnet/tmp/linux-2.6.22/arch/i386/mach-voyager/voyager_thread.c       2007-07-20 11:50:17.000000000 -0400
> +++
> linux-2.6.22/arch/i386/mach-voyager/voyager_thread.c        2007-07-22
> 11:27:13.000000000 -0400
> @@ -92,7 +92,7 @@
>         }
>  }
>  
> -static int
> +static void
>  thread(void *unused)
>  {
>         printk(KERN_NOTICE "Voyager starting monitor thread\n");

You didn't actually compile this, did you?  Apparently the signature of
the kthread_run function changed from returning void to returning int.
Unfortunately the person who fixed this up forgot to add a return 0 at
the end of the voyager thread() function .. which is the correct fix.

James



  reply	other threads:[~2007-07-22 23:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-21 22:03 voyager_{thread,cat}.c compile warnings Gabriel C
2007-07-22 15:33 ` Cédric Augonnet
2007-07-22 22:49   ` Cédric Augonnet
2007-07-22 23:39     ` James Bottomley [this message]
2007-07-23  0:39       ` Cédric Augonnet

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=1185147550.3431.19.camel@localhost.localdomain \
    --to=james.bottomley@hansenpartnership.com \
    --cc=J.E.J.Bottomley@HansenPartnership.com \
    --cc=cedric.augonnet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nix.or.die@googlemail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox