From: Ralf Baechle <ralf@linux-mips.org>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Subject: Re: [MIPS] Workaround for a sparse warning in include/asm-mips/io.h
Date: Thu, 12 Jul 2007 15:41:37 +0100 [thread overview]
Message-ID: <20070712144137.GC19674@linux-mips.org> (raw)
In-Reply-To: <Pine.LNX.4.64N.0707121541190.3029@blysk.ds.pg.gda.pl>
On Thu, Jul 12, 2007 at 03:47:04PM +0100, Maciej W. Rozycki wrote:
> > Author: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Wed Jul 11 23:12:00 2007 +0900
> > Comitter: Ralf Baechle <ralf@linux-mips.org> Thu Jul 12 14:39:44 2007 +0100
> > Commit: 57be612bf3815728ad29f39a09a1c70d71bd279c
> > Gitweb: http://www.linux-mips.org/g/linux/57be612b
> > Branch: master
> >
> > CKSEG1ADDR() returns unsigned int value on 32bit kernel. Cast it to
>
> This is not true. With a 32-bit kernel CKSEG1ADDR(), quite
> intentionally, returns a *signed* int.
>
> Since you have decided to fix the symptom rather than the bug I would at
> least suggest to cast the result to "long" first and only then drop the
> signedness. Otherwise it looks misleading to a casual reader.
More a general comment on the use of KSEG0, KSEG1, KSEG1ADDR and similar
macros. They've been used in about every piece of MIPS UNIX OS kernel
and driver code I ever touched. But generally we want to abstract such
architecture specific knowledge away from drivers, even platform-specific
drivers. So Linux code should prefer to use the standard Linux interfaces
such as ioremap, readb, writeb etc. over those old macros.
Ralf
next prev parent reply other threads:[~2007-07-12 14:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <S20022480AbXGLO2a/20070712142830Z+14663@ftp.linux-mips.org>
2007-07-12 14:47 ` [MIPS] Workaround for a sparse warning in include/asm-mips/io.h Maciej W. Rozycki
2007-07-12 14:41 ` Ralf Baechle [this message]
2007-07-12 15:23 ` Atsushi Nemoto
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=20070712144137.GC19674@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=linux-mips@linux-mips.org \
--cc=macro@linux-mips.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox