linux-mips
[Top] [All Lists]

Re: Porting Linux MIPS issue: maltaint.h files

To: "Ardelean, Andrei" <Andrei.Ardelean@idt.com>
Subject: Re: Porting Linux MIPS issue: maltaint.h files
From: Ralf Baechle <ralf@linux-mips.org>
Date: Fri, 17 Sep 2010 00:57:39 +0100
Cc: linux-mips@linux-mips.org
In-reply-to: <AEA634773855ED4CAD999FBB1A66D076010CFA4E@CORPEXCH1.na.ads.idt.com>
References: <AEA634773855ED4CAD999FBB1A66D076010CFA4E@CORPEXCH1.na.ads.idt.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.20 (2009-12-10)
On Wed, Sep 15, 2010 at 01:04:02PM -0700, Ardelean, Andrei wrote:

> I am porting LINUX MIPS from MALTA on a new board. The problem is that
> .../mips-boards/maltaint.h files is included in a non-MALTA specific
> file, irq-gic.c, without #ifdef CONFIG_MALTA protection. The only need
> there is for the following constant:
> #define X                     0xdead

That's just poor programming style.  1 character long names in headers are
begging for conflicts and with few exceptions as the universal loop index
variables i, j, k are not descriptive.

Including system specific headers hinders code reusability and reusability
is the reason why most of the irq-*.c files are in arch/mips/kernel and not
hidden away in some platform specific directory.

> What is the recommended way to follow since I will replace maltaint.h
> with my new file gdint.h?

Post a patch to cleanup the mess.

In this case (and I haven't looked at it for more than 30s ...) it seems
that the constant X should be moved into <asm/gic.h> after which the
inclusion of the Malta header can go away.

  Ralf

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