From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] ARM: at91: dt: add header to define at_hdmac configuration
Date: Fri, 31 May 2013 23:30:29 +0200 [thread overview]
Message-ID: <201305312330.29364.arnd@arndb.de> (raw)
In-Reply-To: <1369930103-11963-2-git-send-email-ludovic.desroches@atmel.com>
On Thursday 30 May 2013, ludovic.desroches at atmel.com wrote:
> +/*
> + * Source and/or destination peripheral ID
> + */
> +#define AT91_DMA_CFG_PER_ID_MASK (0xff)
> +#define AT91_DMA_CFG_PER_ID(id) (id & AT91_DMA_CFG_PER_ID_MASK)
> +
I'm a little worried about macros like this one spreading in the name
of readability, and I don't see this as actual value-add here:
The output of the macro is always the same as the input, and passing
an invalid number still results in an invalid output and no error message,
it actually prevents us from warning about the mistake at run-time.
The other macros are fine.
Arnd
WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: Re: [PATCH 1/3] ARM: at91: dt: add header to define at_hdmac configuration
Date: Fri, 31 May 2013 23:30:29 +0200 [thread overview]
Message-ID: <201305312330.29364.arnd@arndb.de> (raw)
In-Reply-To: <1369930103-11963-2-git-send-email-ludovic.desroches-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
On Thursday 30 May 2013, ludovic.desroches-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org wrote:
> +/*
> + * Source and/or destination peripheral ID
> + */
> +#define AT91_DMA_CFG_PER_ID_MASK (0xff)
> +#define AT91_DMA_CFG_PER_ID(id) (id & AT91_DMA_CFG_PER_ID_MASK)
> +
I'm a little worried about macros like this one spreading in the name
of readability, and I don't see this as actual value-add here:
The output of the macro is always the same as the input, and passing
an invalid number still results in an invalid output and no error message,
it actually prevents us from warning about the mistake at run-time.
The other macros are fine.
Arnd
next prev parent reply other threads:[~2013-05-31 21:30 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-30 16:08 [PATCH 0/3] at_hdmac: dt dma bindings update ludovic.desroches at atmel.com
2013-05-30 16:08 ` ludovic.desroches
2013-05-30 16:08 ` [PATCH 1/3] ARM: at91: dt: add header to define at_hdmac configuration ludovic.desroches at atmel.com
2013-05-30 16:08 ` ludovic.desroches
2013-05-31 21:30 ` Arnd Bergmann [this message]
2013-05-31 21:30 ` Arnd Bergmann
2013-06-03 7:32 ` Ludovic Desroches
[not found] ` <201305312330.29364.arnd-r2nGTMty4D4@public.gmane.org>
2013-06-03 7:32 ` Ludovic Desroches
2013-06-03 7:32 ` Ludovic Desroches
2013-06-04 13:17 ` Nicolas Ferre
2013-06-04 13:17 ` Nicolas Ferre
2013-05-30 16:08 ` [PATCH 2/3] ARM: at91: dt: switch DMA DT bindings to pre-processor ludovic.desroches at atmel.com
2013-05-30 16:08 ` ludovic.desroches
2013-05-30 16:08 ` [PATCH 3/3] at_hdmac: add FIFO configuration parameter to DMA DT binding ludovic.desroches at atmel.com
2013-05-30 16:08 ` ludovic.desroches
2013-05-30 16:32 ` Nicolas Ferre
2013-05-30 16:32 ` Nicolas Ferre
2013-05-30 16:39 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-30 16:39 ` Jean-Christophe PLAGNIOL-VILLARD
[not found] ` <20130530163936.GC23653-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
2013-05-31 9:16 ` Ludovic Desroches
2013-05-31 9:16 ` Ludovic Desroches
2013-05-31 9:16 ` Ludovic Desroches
2013-05-31 9:31 ` Nicolas Ferre
2013-05-31 9:31 ` Nicolas Ferre
2013-05-31 15:11 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-31 15:11 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-31 23:11 ` Olof Johansson
2013-05-31 23:11 ` Olof Johansson
[not found] ` <CAOesGMhQetZfyzMpCax63xoRqtRW2ZRXt04MCbgCT-CcvUq43A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-03 7:39 ` Ludovic Desroches
2013-06-03 7:39 ` Ludovic Desroches
2013-06-03 7:39 ` Ludovic Desroches
2013-05-30 16:37 ` [PATCH 0/3] at_hdmac: dt dma bindings update Jean-Christophe PLAGNIOL-VILLARD
2013-05-30 16:37 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-30 17:26 ` Vinod Koul
2013-05-30 17:26 ` Vinod Koul
2013-05-30 20:13 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-30 20:13 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-31 8:04 ` Nicolas Ferre
2013-05-31 8:04 ` Nicolas Ferre
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=201305312330.29364.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.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.