linux-mips
[Top] [All Lists]

Re: [PATCH]: remove warnings on promlib

To: Juan Quintela <quintela@mandrakesoft.com>
Subject: Re: [PATCH]: remove warnings on promlib
From: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Date: Wed, 18 Dec 2002 18:00:09 +0100 (MET)
Cc: linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>
In-reply-to: <m2u1hcp0ds.fsf@demo.mitica>
Organization: Technical University of Gdansk
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
On 18 Dec 2002, Juan Quintela wrote:

> Index: arch/mips/lib/promlib.c
> ===================================================================
> RCS file: /home/cvs/linux/arch/mips/lib/promlib.c,v
> retrieving revision 1.1.2.1
> diff -u -r1.1.2.1 promlib.c
> --- arch/mips/lib/promlib.c   28 Sep 2002 22:28:38 -0000      1.1.2.1
> +++ arch/mips/lib/promlib.c   18 Dec 2002 00:49:18 -0000
> @@ -1,3 +1,7 @@
> +
> +#include <asm/sgialib.h>
> +#include <linux/kernel.h>
> +
>  #include <stdarg.h>
>  
>  void prom_printf(char *fmt, ...)

 A few comments:

1. <linux> includes first, <asm> ones following (hmm, shouldn't that be
obvious...).

2. <linux/kernel.h> is obviously OK for vsprintf().

3. I would hesitate using <asm/sgialib.h> here being too much platform
specific.  Either a separate generic <asm/prom.h> should be created for
primitives like prom_putchar(), prom_getchar(), etc. or a private
conservative declaration should be used here.  The reason is the functions
are much platform-specific, e.g. they may be pointers or even macros --
see <asm/dec/prom.h> for a not-so-trivial example (luckily, DECstations
support prom_printf() directly, so they don't have to use promlib.c).

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +


<Prev in Thread] Current Thread [Next in Thread>