linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fanotify: delete useless parenthesis in FANOTIFY_INLINE_FH macro
@ 2023-10-10 11:44 Alexey Dobriyan
  2023-10-10 12:35 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Dobriyan @ 2023-10-10 11:44 UTC (permalink / raw)
  To: Jan Kara, Amir Goldstein, Matthew Bobrowski; +Cc: linux-fsdevel

Parenthesis around identifier name in declaration are useless.
This is just "put every macro argument inside parenthesis" practice.

Now "size" must be constant expression, but using comma expression in
constant expression is useless too, therefore [] will guard "size"
expression just as well as ().

Also g++ is somewhat upset about these:

	fs/notify/fanotify/fanotify.h:278:28: warning: unnecessary parentheses in declaration of ‘object_fh’ [-Wparentheses]
	  278 |         struct fanotify_fh (name);

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 fs/notify/fanotify/fanotify.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/fs/notify/fanotify/fanotify.h
+++ b/fs/notify/fanotify/fanotify.h
@@ -275,9 +275,9 @@ static inline void fanotify_init_event(struct fanotify_event *event,
 
 #define FANOTIFY_INLINE_FH(name, size)					\
 struct {								\
-	struct fanotify_fh (name);					\
+	struct fanotify_fh name;					\
 	/* Space for object_fh.buf[] - access with fanotify_fh_buf() */	\
-	unsigned char _inline_fh_buf[(size)];				\
+	unsigned char _inline_fh_buf[size];				\
 }
 
 struct fanotify_fid_event {

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fanotify: delete useless parenthesis in FANOTIFY_INLINE_FH macro
  2023-10-10 11:44 [PATCH] fanotify: delete useless parenthesis in FANOTIFY_INLINE_FH macro Alexey Dobriyan
@ 2023-10-10 12:35 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2023-10-10 12:35 UTC (permalink / raw)
  To: Alexey Dobriyan
  Cc: Jan Kara, Amir Goldstein, Matthew Bobrowski, linux-fsdevel

On Tue 10-10-23 14:44:35, Alexey Dobriyan wrote:
> Parenthesis around identifier name in declaration are useless.
> This is just "put every macro argument inside parenthesis" practice.
> 
> Now "size" must be constant expression, but using comma expression in
> constant expression is useless too, therefore [] will guard "size"
> expression just as well as ().
> 
> Also g++ is somewhat upset about these:
> 
> 	fs/notify/fanotify/fanotify.h:278:28: warning: unnecessary parentheses in declaration of ‘object_fh’ [-Wparentheses]
> 	  278 |         struct fanotify_fh (name);
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>

Yeah, ok. Added to my tree. Thanks!

								Honza

> ---
> 
>  fs/notify/fanotify/fanotify.h |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- a/fs/notify/fanotify/fanotify.h
> +++ b/fs/notify/fanotify/fanotify.h
> @@ -275,9 +275,9 @@ static inline void fanotify_init_event(struct fanotify_event *event,
>  
>  #define FANOTIFY_INLINE_FH(name, size)					\
>  struct {								\
> -	struct fanotify_fh (name);					\
> +	struct fanotify_fh name;					\
>  	/* Space for object_fh.buf[] - access with fanotify_fh_buf() */	\
> -	unsigned char _inline_fh_buf[(size)];				\
> +	unsigned char _inline_fh_buf[size];				\
>  }
>  
>  struct fanotify_fid_event {
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-10 12:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-10 11:44 [PATCH] fanotify: delete useless parenthesis in FANOTIFY_INLINE_FH macro Alexey Dobriyan
2023-10-10 12:35 ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).