lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 18 Dec 2013 07:34:11 +0900
From:	Magnus Damm <magnus.damm@...il.com>
To:	Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc:	linux-kernel <linux-kernel@...r.kernel.org>,
	SH-Linux <linux-sh@...r.kernel.org>,
	Linus Walleij <linus.walleij@...aro.org>,
	Wolfram Sang <wsa@...-dreams.de>,
	"Simon Horman [Horms]" <horms@...ge.net.au>
Subject: Re: [PATCH 03/05 v2] pinctrl: sh-pfc: r7s72100 single pin macros

Hi Laurent,

Thanks for your feedback.

On Wed, Dec 18, 2013 at 1:01 AM, Laurent Pinchart
<laurent.pinchart@...asonboard.com> wrote:
> Hi Magnus,
>
> Thank you for the patches.
>
> On Tuesday 17 December 2013 11:38:14 Magnus Damm wrote:
>> From: Magnus Damm <damm@...nsource.se>
>>
>> Introduce macros that allow description of one pin per line.
>> Compared to the other ways of doing this, using this style
>> we can compresses the description of each pin from 9 to 1 line.
>>
>> Signed-off-by: Magnus Damm <damm@...nsource.se>
>> ---
>>
>>  This patch uses RZ_PMX_GROUP and RZ_GROUPS, thanks Laurent!
>>
>>  drivers/pinctrl/sh-pfc/pfc-r7s72100.c |   21 +++++++++++++++++++++
>>  1 file changed, 21 insertions(+)
>>
>> --- 0003/drivers/pinctrl/sh-pfc/pfc-r7s72100.c
>> +++ work/drivers/pinctrl/sh-pfc/pfc-r7s72100.c        2013-12-16
> 19:14:30.000000000
>> +0900 @@ -98,9 +98,30 @@ static struct sh_pfc_pin pinmux_pins[] =
>>
>>  #define RZ_PORT_PIN(bank, pin) (((bank) * 16) + (pin))
>>
>> +#define __RZ_STR(pfx, hw, bank, pin, sfx)            \
>> +     pfx##_##hw##_p##bank##_##pin####sfx
>
> Do you mean s/####sfx/##sfx/ ?

Yes, thanks for catching that.

>> +
>> +#define RZ_PIN_AND_MUX(pfx, hw, bank, pin, fn)                               \
>> +static const unsigned int __RZ_STR(pfx, hw, bank, pin, _pins)[] = {  \
>> +     RZ_PORT_PIN(bank, pin),                                         \
>> +};                                                                   \
>> +static const unsigned int __RZ_STR(pfx, hw, bank, pin, _mux)[] = {   \
>> +     P_##bank##_##pin##_MARK_FN##fn,                                 \
>> +};
>
> I would have preferred keeping the trailing semicolon (and comma in the
> RZ_GROUPS macro) out of the macro, but that won't be possible as the
> RZ_PIN_AND_MUX and RZ_GROUPS macros are used as arguments to the SCIF macros
> in the next patch.

That's correct. As much as I like semicolons, having a
single-line-per-pin must be better than duplicating stuff and use
semicolons.

>> +
>> +#define RZ_PMX_GROUP(pfx, hw, bank, pin, fn) \
>> +     SH_PFC_PIN_GROUP(pfx##_##hw##_p##bank##_##pin),
>> +
>> +#define __RZ_GROUPS(x) #x
>
> Can't you replace __RZ_GROUPS() by __stringify() ?

I'll try!

>> +#define RZ_GROUPS(pfx, hw, bank, pin, fn) \
>> +     __RZ_GROUPS(pfx##_##hw##_p##bank##_##pin),
>> +
>>  static const struct sh_pfc_pin_group pinmux_groups[] = {
>>  };
>>
>> +static const char * const scif2_groups[] = {
>> +};
>
> I think this should be part of patch 04/05.

Yes, so it seems.

Thanks,

/ magnus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ