All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-samsung-soc@vger.kernel.org,
	'Ben Dooks' <ben-linux@fluff.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH V2 2/2] ARM: SAMSUNG: Cleanup resources by using macro
Date: Tue, 4 Oct 2011 17:26:02 +0200	[thread overview]
Message-ID: <201110041726.03056.arnd@arndb.de> (raw)
In-Reply-To: <019301cc8293$79a6f510$6cf4df30$%kim@samsung.com>

On Tuesday 04 October 2011, Kukjin Kim wrote:
> > I think the string concatenation really just obfuscates the code, and
> > it does not actually save much at all. When you replace
> > 
> > +       [0] = SAMSUNG_RES_MEM(S3C, WDT, SZ_1K),
> > +       [1] = SAMSUNG_RES_IRQ(WDT),
> > 
> > with
> > 
> > +       [0] = DEFINE_RES_MEM(S3C_PA_WDT, SZ_1K),
> > +       [1] = DEFINE_RES_IRQ(IRQ_WDT),
> > 
> > you need practically no extra space, but you gain the advantages that
> > 
> > * Someone using grep for DEFINE_RES_MEM finds all memory resources without
> >   having to look up what your macros do an where they are used.
> > * Someone using grep to look for S3C_PA_WDT finds the place where it is
> used.
> > * Someone reading the resource definition immediately knows what the
> >   macro does if familiar with other platforms using that macro.
> 
> Yes, right. But I'm preparing to reduce the 'soc' part to consolidate some
> duplicated resources and platform data after this and the new SAMSUNG_RES
> macro will be used.

Hmm, can't you instead change the names of these constants to be
always the same? That would let you use the regular DEFINE_RES_*
definitions without having to introduce your own.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 2/2] ARM: SAMSUNG: Cleanup resources by using macro
Date: Tue, 4 Oct 2011 17:26:02 +0200	[thread overview]
Message-ID: <201110041726.03056.arnd@arndb.de> (raw)
In-Reply-To: <019301cc8293$79a6f510$6cf4df30$%kim@samsung.com>

On Tuesday 04 October 2011, Kukjin Kim wrote:
> > I think the string concatenation really just obfuscates the code, and
> > it does not actually save much at all. When you replace
> > 
> > +       [0] = SAMSUNG_RES_MEM(S3C, WDT, SZ_1K),
> > +       [1] = SAMSUNG_RES_IRQ(WDT),
> > 
> > with
> > 
> > +       [0] = DEFINE_RES_MEM(S3C_PA_WDT, SZ_1K),
> > +       [1] = DEFINE_RES_IRQ(IRQ_WDT),
> > 
> > you need practically no extra space, but you gain the advantages that
> > 
> > * Someone using grep for DEFINE_RES_MEM finds all memory resources without
> >   having to look up what your macros do an where they are used.
> > * Someone using grep to look for S3C_PA_WDT finds the place where it is
> used.
> > * Someone reading the resource definition immediately knows what the
> >   macro does if familiar with other platforms using that macro.
> 
> Yes, right. But I'm preparing to reduce the 'soc' part to consolidate some
> duplicated resources and platform data after this and the new SAMSUNG_RES
> macro will be used.

Hmm, can't you instead change the names of these constants to be
always the same? That would let you use the regular DEFINE_RES_*
definitions without having to introduce your own.

	Arnd

  reply	other threads:[~2011-10-04 15:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-03  3:41 [PATCH V2 2/2] ARM: SAMSUNG: Cleanup resources by using macro Kukjin Kim
2011-10-03  3:41 ` Kukjin Kim
2011-10-03  3:53 ` Kyungmin Park
2011-10-03  3:53   ` Kyungmin Park
2011-10-03 13:13   ` Kukjin Kim
2011-10-03 13:13     ` Kukjin Kim
2011-10-03 14:20     ` Sylwester Nawrocki
2011-10-03 14:20       ` Sylwester Nawrocki
2011-10-04 12:45       ` Kukjin Kim
2011-10-04 12:45         ` Kukjin Kim
2011-10-03 15:01 ` Arnd Bergmann
2011-10-03 15:01   ` Arnd Bergmann
2011-10-04 12:45   ` Kukjin Kim
2011-10-04 12:45     ` Kukjin Kim
2011-10-04 15:26     ` Arnd Bergmann [this message]
2011-10-04 15:26       ` Arnd Bergmann
2011-10-04 23:27       ` Kyungmin Park
2011-10-04 23:27         ` Kyungmin Park
2011-10-05  1:17         ` Kukjin Kim
2011-10-05  1:17           ` Kukjin Kim
2011-10-05  1:17       ` Kukjin Kim
2011-10-05  1:17         ` Kukjin Kim

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=201110041726.03056.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=ben-linux@fluff.org \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.