From: Kukjin Kim <kgene.kim@samsung.com>
To: Kyungmin Park <kmpark@infradead.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org,
Ben Dooks <ben-linux@fluff.org>
Subject: Re: [PATCH V2 2/2] ARM: SAMSUNG: Cleanup resources by using macro
Date: Mon, 03 Oct 2011 22:13:41 +0900 [thread overview]
Message-ID: <4E89B505.3060501@samsung.com> (raw)
In-Reply-To: <CAH9JG2Wc4M2dVFOfNE5jgsygvigE8RbPH_yLcMqarr64LfbENw@mail.gmail.com>
On 10/03/11 12:53, Kyungmin Park wrote:
> On Mon, Oct 3, 2011 at 12:41 PM, Kukjin Kim<kgene.kim@samsung.com> wrote:
>> This patch adds macro SAMSUNG_RES_MEM, SAMSUNG_RES_IRQ
>> and so on to cleanup regarding 'struct resource' by using
>> defined helpers at<linux/ioport.h>.
>>
>> Cc: Ben Dooks<ben-linux@fluff.org>
>> Signed-off-by: Kukjin Kim<kgene.kim@samsung.com>
>> ---
>> Changes since v1:
>> - Address comments from Russell King
>> Using defined helpers to define resource
>>
>> arch/arm/mach-s3c2410/include/mach/map.h | 1 +
>> arch/arm/plat-samsung/devs.c | 697 +++++------------------------
>> arch/arm/plat-samsung/include/plat/devs.h | 11 +
>> 3 files changed, 129 insertions(+), 580 deletions(-)
>>
(snip)
>>
>> +#define SAMSUNG_RES_MEM(soc, ip, sz) DEFINE_RES_MEM(soc##_PA_##ip, sz)
>> +#define SAMSUNG_RES_IRQ(ip) DEFINE_RES_IRQ(IRQ_##ip)
>> +
>> +#define SAMSUNG_RES_MEM_NAMED(soc, ip, sz, name) \
>> + DEFINE_RES_MEM_NAMED(soc##_PA_##ip, sz, name)
>> +#define SAMSUNG_RES_IRQ_NAMED(ip, name) \
>> + DEFINE_RES_IRQ_NAMED(IRQ_##ip, name)
>> +#define SAMSUNG_RES_DMA_NAMED(ch, name) \
>> + DEFINE_RES_DMA_NAMED(DMACH_##ch, name)
>
> It's good for readability. but do you think that it's hard to find out
> defined macros are used at real place?
> e.g., Now I want to find out the S3C_PA_USB_HSOTG. it's difficult if
> you use the SAMSUNG_RES_* series macro.
> but if you use the DEFINED_RES_* series directly. it's easy to find
> out at real codes.
>
Well, I don't think so because the XXX_PA_XXX addresses are defined in
each mach/map.h and they are usually used in here so it's not hard to
find it.
And now the 'S3C', 'S5P' and 'SAMSUNG' are used in the 'soc' part. I'm
preparing to consolidate the name and to remove duplicated resources.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
WARNING: multiple messages have this Message-ID (diff)
From: kgene.kim@samsung.com (Kukjin Kim)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 2/2] ARM: SAMSUNG: Cleanup resources by using macro
Date: Mon, 03 Oct 2011 22:13:41 +0900 [thread overview]
Message-ID: <4E89B505.3060501@samsung.com> (raw)
In-Reply-To: <CAH9JG2Wc4M2dVFOfNE5jgsygvigE8RbPH_yLcMqarr64LfbENw@mail.gmail.com>
On 10/03/11 12:53, Kyungmin Park wrote:
> On Mon, Oct 3, 2011 at 12:41 PM, Kukjin Kim<kgene.kim@samsung.com> wrote:
>> This patch adds macro SAMSUNG_RES_MEM, SAMSUNG_RES_IRQ
>> and so on to cleanup regarding 'struct resource' by using
>> defined helpers at<linux/ioport.h>.
>>
>> Cc: Ben Dooks<ben-linux@fluff.org>
>> Signed-off-by: Kukjin Kim<kgene.kim@samsung.com>
>> ---
>> Changes since v1:
>> - Address comments from Russell King
>> Using defined helpers to define resource
>>
>> arch/arm/mach-s3c2410/include/mach/map.h | 1 +
>> arch/arm/plat-samsung/devs.c | 697 +++++------------------------
>> arch/arm/plat-samsung/include/plat/devs.h | 11 +
>> 3 files changed, 129 insertions(+), 580 deletions(-)
>>
(snip)
>>
>> +#define SAMSUNG_RES_MEM(soc, ip, sz) DEFINE_RES_MEM(soc##_PA_##ip, sz)
>> +#define SAMSUNG_RES_IRQ(ip) DEFINE_RES_IRQ(IRQ_##ip)
>> +
>> +#define SAMSUNG_RES_MEM_NAMED(soc, ip, sz, name) \
>> + DEFINE_RES_MEM_NAMED(soc##_PA_##ip, sz, name)
>> +#define SAMSUNG_RES_IRQ_NAMED(ip, name) \
>> + DEFINE_RES_IRQ_NAMED(IRQ_##ip, name)
>> +#define SAMSUNG_RES_DMA_NAMED(ch, name) \
>> + DEFINE_RES_DMA_NAMED(DMACH_##ch, name)
>
> It's good for readability. but do you think that it's hard to find out
> defined macros are used at real place?
> e.g., Now I want to find out the S3C_PA_USB_HSOTG. it's difficult if
> you use the SAMSUNG_RES_* series macro.
> but if you use the DEFINED_RES_* series directly. it's easy to find
> out at real codes.
>
Well, I don't think so because the XXX_PA_XXX addresses are defined in
each mach/map.h and they are usually used in here so it's not hard to
find it.
And now the 'S3C', 'S5P' and 'SAMSUNG' are used in the 'soc' part. I'm
preparing to consolidate the name and to remove duplicated resources.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
next prev parent reply other threads:[~2011-10-03 13:13 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 [this message]
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
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=4E89B505.3060501@samsung.com \
--to=kgene.kim@samsung.com \
--cc=ben-linux@fluff.org \
--cc=kmpark@infradead.org \
--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.