Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "Steven J. Hill" <sjhill@cotw.com>
To: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Cc: linux-mips@oss.sgi.com, ralf@uni-koblenz.de
Subject: Re: [PATCH] Compiler warnings and remove unused code....
Date: Wed, 30 Jan 2002 13:13:19 -0600	[thread overview]
Message-ID: <3C5845CF.A61BF774@cotw.com> (raw)
In-Reply-To: Pine.GSO.3.96.1020130193633.8443E-100000@delta.ds2.pg.gda.pl

"Maciej W. Rozycki" wrote:
> 
> On Wed, 30 Jan 2002, Steven J. Hill wrote:
> 
> > -     p += sprintf(p, "ERR: %10lu\n", irq_err_count);
> > +     p += sprintf(p, "ERR: %10lu\n", (unsigned long) irq_err_count.counter);
> 
>  This looks bogus.  How about atomic_read()?
> 
Well, duh! Yeah, that would be better.

> > +#define MAX_NAMELEN 10
> > +
> > +static struct proc_dir_entry * root_irq_dir;
> > +static struct proc_dir_entry * irq_dir [NR_IRQS];
> > +
> > +static void register_irq_proc (unsigned int irq)
> > +{
> > +     char name [MAX_NAMELEN];
> > +
> > +     if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type) ||
> > +                     irq_dir[irq])
> > +             return;
> > +
> > +     memset(name, 0, MAX_NAMELEN);
> > +     sprintf(name, "%d", irq);
> > +
> > +     /* create /proc/irq/1234 */
> > +     irq_dir[irq] = proc_mkdir(name, root_irq_dir);
> > +
> > +#if CONFIG_SMP
> > +     {
> > +             struct proc_dir_entry *entry;
> > +
> > +             /* create /proc/irq/1234/smp_affinity */
> > +             entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]);
> > +
> > +             if (entry) {
> > +                     entry->nlink = 1;
> > +                     entry->data = (void *)(long)irq;
> > +                     entry->read_proc = irq_affinity_read_proc;
> > +                     entry->write_proc = irq_affinity_write_proc;
> > +             }
> > +
> > +             smp_affinity_entry[irq] = entry;
> > +     }
> > +#endif
> > +}
> > +
> 
>  Any specific need to move it?
> 
Yes. Eliminates a 'implicit declaration of register_irq_proc' warning.

> > -             ret = KSEG1ADDR(ret);
> > +             ret = (void *) KSEG1ADDR(ret);
> 
>  Hmm, KSEG1ADDR() should probably use typeof(), instead.
> 
Fine.

> >               printk(KERN_WARNING "Warning only %ldMB will be used.\n",
> > -                    MAXMEM>>20);
> > +                    (unsigned long) (MAXMEM>>20));
> 
>  MAXMEM is int, how about "%d" instead?
> 
Fine.

> > --- drivers/pci/pci.ids       3 Jan 2002 17:20:28 -0000       1.3
> > +++ drivers/pci/pci.ids       30 Jan 2002 17:20:50 -0000
> 
>  Are you sure it belongs here?  Or is needed at all?
> 
What happens is that when 'gendev' is ran to produce devlist.h, without
the patch it spits on '??? trigraph' warnings. By escaping them, the
warning disappears.

-Steve

-- 
 Steven J. Hill - Embedded SW Engineer

  reply	other threads:[~2002-01-30 20:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-30 17:29 [PATCH] Compiler warnings and remove unused code Steven J. Hill
2002-01-30 18:23 ` Geoffrey Espin
2002-01-30 18:35   ` Maciej W. Rozycki
2002-01-30 18:39     ` Geoffrey Espin
2002-01-30 18:46     ` Bradley D. LaRonde
2002-01-30 18:46       ` Bradley D. LaRonde
2002-01-30 18:39   ` James Simmons
2002-01-30 18:44     ` Geoffrey Espin
2002-01-30 18:55       ` James Simmons
2002-01-30 18:41   ` Daniel Jacobowitz
2002-01-30 18:53     ` Geoffrey Espin
2002-01-30 18:55 ` Maciej W. Rozycki
2002-01-30 19:13   ` Steven J. Hill [this message]
2002-01-31 12:45     ` Maciej W. Rozycki
2002-01-30 19:15 ` Steven J. Hill

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=3C5845CF.A61BF774@cotw.com \
    --to=sjhill@cotw.com \
    --cc=linux-mips@oss.sgi.com \
    --cc=macro@ds2.pg.gda.pl \
    --cc=ralf@uni-koblenz.de \
    /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