All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] zonefs: delete useless complex macro definitions
       [not found] <20210512064454.59664-1-wjc@cdjrlc.com>
@ 2021-05-12 10:53 ` Damien Le Moal
  0 siblings, 0 replies; only message in thread
From: Damien Le Moal @ 2021-05-12 10:53 UTC (permalink / raw)
  To: jinchao, Naohiro Aota; +Cc: linux-fsdevel, linux-kernel

On 2021/05/12 15:45, jinchao wrote:
> Fixes checkpatch.pl error: Macros with complex values should be enclosed
> in parentheses. By deleting the macro definition

I would suggest something like this:

Avoid checkpatch and other static code analyzer warnings about macros with
complex values not being enclosed in parenthesis by removing the show_dev() macro.

> 
> Signed-off-by: jinchao <wjc@cdjrlc.com>

Please sign with your full name. From your other email, reading your name in
Chinese, if I am not mistaken, it should be:

Signed-off-by: Jinchao Wang <wjc@cdjrlc.com>

> ---
>  fs/zonefs/trace.h | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/zonefs/trace.h b/fs/zonefs/trace.h
> index 5b0c87d331a1..1f98713774f5 100644
> --- a/fs/zonefs/trace.h
> +++ b/fs/zonefs/trace.h
> @@ -17,7 +17,6 @@
>  
>  #include "zonefs.h"
>  
> -#define show_dev(dev) (MAJOR(dev), MINOR(dev))
>  
>  TRACE_EVENT(zonefs_zone_mgmt,
>  	    TP_PROTO(struct inode *inode, enum req_opf op),
> @@ -38,7 +37,7 @@ TRACE_EVENT(zonefs_zone_mgmt,
>  				   ZONEFS_I(inode)->i_zone_size >> SECTOR_SHIFT;
>  	    ),
>  	    TP_printk("bdev=(%d,%d), ino=%lu op=%s, sector=%llu, nr_sectors=%llu",
> -		      show_dev(__entry->dev), (unsigned long)__entry->ino,
> +		      MAJOR(__entry->dev), MINOR(__entry->dev), (unsigned long)__entry->ino,
>  		      blk_op_str(__entry->op), __entry->sector,
>  		      __entry->nr_sectors
>  	    )

Please rewrap the arguments to avoid the long lines. E.g.:

TP_printk("bdev=(%d,%d), ino=%lu op=%s, sector=%llu, nr_sectors=%llu",
	  MAJOR(__entry->dev), MINOR(__entry->dev),
	  (unsigned long)__entry->ino,
	  blk_op_str(__entry->op), __entry->sector,
	  __entry->nr_sectors
)

> @@ -64,7 +63,7 @@ TRACE_EVENT(zonefs_file_dio_append,
>  			   __entry->ret = ret;
>  	    ),
>  	    TP_printk("bdev=(%d, %d), ino=%lu, sector=%llu, size=%zu, wpoffset=%llu, ret=%zu",
> -		      show_dev(__entry->dev), (unsigned long)__entry->ino,
> +		      MAJOR(__entry->dev), MINOR(__entry->dev), (unsigned long)__entry->ino,
>  		      __entry->sector, __entry->size, __entry->wpoffset,
>  		      __entry->ret
>  	    )
> @@ -88,7 +87,7 @@ TRACE_EVENT(zonefs_iomap_begin,
>  			   __entry->length = iomap->length;
>  	    ),
>  	    TP_printk("bdev=(%d,%d), ino=%lu, addr=%llu, offset=%llu, length=%llu",
> -		      show_dev(__entry->dev), (unsigned long)__entry->ino,
> +		      MAJOR(__entry->dev), MINOR(__entry->dev), (unsigned long)__entry->ino,
>  		      __entry->addr, __entry->offset, __entry->length
>  	    )
>  );
> 


-- 
Damien Le Moal
Western Digital Research

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-12 10:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210512064454.59664-1-wjc@cdjrlc.com>
2021-05-12 10:53 ` [PATCH] zonefs: delete useless complex macro definitions Damien Le Moal

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.