* [PATCH] scrpits: Remove unneeded assignment parentheses
@ 2020-05-21 6:32 Xu Wang
2020-05-21 14:14 ` James Bottomley
2020-05-21 14:28 ` David Howells
0 siblings, 2 replies; 5+ messages in thread
From: Xu Wang @ 2020-05-21 6:32 UTC (permalink / raw)
To: dhowells, dwmw2, keyrings; +Cc: linux-kernel
Remove unneeded assignment parentheses.
Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
---
| 2 +-
scripts/sign-file.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--git a/scripts/extract-cert.c b/scripts/extract-cert.c
index b071bf476fea..8005911926b8 100644
--- a/scripts/extract-cert.c
+++ b/scripts/extract-cert.c
@@ -61,7 +61,7 @@ static void drain_openssl_errors(void)
#define ERR(cond, fmt, ...) \
do { \
- bool __cond = (cond); \
+ bool __cond = cond; \
display_openssl_errors(__LINE__); \
if (__cond) { \
err(1, fmt, ## __VA_ARGS__); \
diff --git a/scripts/sign-file.c b/scripts/sign-file.c
index fbd34b8e8f57..9ea08b07a0aa 100644
--- a/scripts/sign-file.c
+++ b/scripts/sign-file.c
@@ -104,7 +104,7 @@ static void drain_openssl_errors(void)
#define ERR(cond, fmt, ...) \
do { \
- bool __cond = (cond); \
+ bool __cond = cond; \
display_openssl_errors(__LINE__); \
if (__cond) { \
err(1, fmt, ## __VA_ARGS__); \
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] scrpits: Remove unneeded assignment parentheses
2020-05-21 6:32 [PATCH] scrpits: Remove unneeded assignment parentheses Xu Wang
@ 2020-05-21 14:14 ` James Bottomley
2020-05-21 14:28 ` David Howells
1 sibling, 0 replies; 5+ messages in thread
From: James Bottomley @ 2020-05-21 14:14 UTC (permalink / raw)
To: Xu Wang, dhowells, dwmw2, keyrings; +Cc: linux-kernel
On Thu, 2020-05-21 at 06:32 +0000, Xu Wang wrote:
> Remove unneeded assignment parentheses.
I really don't think this is a good idea. Best practice for macros is
to parenthesize every argument even if there are technically some cases
where it's unnecessary because the problems in the majority cases are
huge and unexpected.
James
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
> ---
> scripts/extract-cert.c | 2 +-
> scripts/sign-file.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/extract-cert.c b/scripts/extract-cert.c
> index b071bf476fea..8005911926b8 100644
> --- a/scripts/extract-cert.c
> +++ b/scripts/extract-cert.c
> @@ -61,7 +61,7 @@ static void drain_openssl_errors(void)
>
> #define ERR(cond, fmt, ...) \
> do { \
> - bool __cond = (cond); \
> + bool __cond = cond; \
> display_openssl_errors(__LINE__); \
> if (__cond) { \
> err(1, fmt, ## __VA_ARGS__); \
> diff --git a/scripts/sign-file.c b/scripts/sign-file.c
> index fbd34b8e8f57..9ea08b07a0aa 100644
> --- a/scripts/sign-file.c
> +++ b/scripts/sign-file.c
> @@ -104,7 +104,7 @@ static void drain_openssl_errors(void)
>
> #define ERR(cond, fmt, ...) \
> do { \
> - bool __cond = (cond); \
> + bool __cond = cond; \
> display_openssl_errors(__LINE__); \
> if (__cond) { \
> err(1, fmt, ## __VA_ARGS__); \
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scrpits: Remove unneeded assignment parentheses
@ 2020-05-21 14:14 ` James Bottomley
0 siblings, 0 replies; 5+ messages in thread
From: James Bottomley @ 2020-05-21 14:14 UTC (permalink / raw)
To: Xu Wang, dhowells, dwmw2, keyrings; +Cc: linux-kernel
On Thu, 2020-05-21 at 06:32 +0000, Xu Wang wrote:
> Remove unneeded assignment parentheses.
I really don't think this is a good idea. Best practice for macros is
to parenthesize every argument even if there are technically some cases
where it's unnecessary because the problems in the majority cases are
huge and unexpected.
James
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
> ---
> scripts/extract-cert.c | 2 +-
> scripts/sign-file.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/extract-cert.c b/scripts/extract-cert.c
> index b071bf476fea..8005911926b8 100644
> --- a/scripts/extract-cert.c
> +++ b/scripts/extract-cert.c
> @@ -61,7 +61,7 @@ static void drain_openssl_errors(void)
>
> #define ERR(cond, fmt, ...) \
> do { \
> - bool __cond = (cond); \
> + bool __cond = cond; \
> display_openssl_errors(__LINE__); \
> if (__cond) { \
> err(1, fmt, ## __VA_ARGS__); \
> diff --git a/scripts/sign-file.c b/scripts/sign-file.c
> index fbd34b8e8f57..9ea08b07a0aa 100644
> --- a/scripts/sign-file.c
> +++ b/scripts/sign-file.c
> @@ -104,7 +104,7 @@ static void drain_openssl_errors(void)
>
> #define ERR(cond, fmt, ...) \
> do { \
> - bool __cond = (cond); \
> + bool __cond = cond; \
> display_openssl_errors(__LINE__); \
> if (__cond) { \
> err(1, fmt, ## __VA_ARGS__); \
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scrpits: Remove unneeded assignment parentheses
2020-05-21 6:32 [PATCH] scrpits: Remove unneeded assignment parentheses Xu Wang
@ 2020-05-21 14:28 ` David Howells
2020-05-21 14:28 ` David Howells
1 sibling, 0 replies; 5+ messages in thread
From: David Howells @ 2020-05-21 14:28 UTC (permalink / raw)
To: James Bottomley; +Cc: dhowells, Xu Wang, dwmw2, keyrings, linux-kernel
James Bottomley <James.Bottomley@HansenPartnership.com> wrote:
> > Remove unneeded assignment parentheses.
>
> I really don't think this is a good idea. Best practice for macros is
> to parenthesize every argument even if there are technically some cases
> where it's unnecessary because the problems in the majority cases are
> huge and unexpected.
Yep.
David
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scrpits: Remove unneeded assignment parentheses
@ 2020-05-21 14:28 ` David Howells
0 siblings, 0 replies; 5+ messages in thread
From: David Howells @ 2020-05-21 14:28 UTC (permalink / raw)
To: James Bottomley; +Cc: dhowells, Xu Wang, dwmw2, keyrings, linux-kernel
James Bottomley <James.Bottomley@HansenPartnership.com> wrote:
> > Remove unneeded assignment parentheses.
>
> I really don't think this is a good idea. Best practice for macros is
> to parenthesize every argument even if there are technically some cases
> where it's unnecessary because the problems in the majority cases are
> huge and unexpected.
Yep.
David
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-05-21 14:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21 6:32 [PATCH] scrpits: Remove unneeded assignment parentheses Xu Wang
2020-05-21 14:14 ` James Bottomley
2020-05-21 14:14 ` James Bottomley
2020-05-21 14:28 ` David Howells
2020-05-21 14:28 ` David Howells
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.