linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
From: Coly Li <colyli@suse.de>
To: Matteo Croce <mcroce@redhat.com>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-nvdimm@lists.01.org, linux-bcache@vger.kernel.org,
	linux-raid@vger.kernel.org, linux-mmc@vger.kernel.org,
	xen-devel@lists.xenproject.org, linux-scsi@vger.kernel.org,
	linux-nfs@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Anna Schumaker <anna.schumaker@netapp.com>,
	Song Liu <song@kernel.org>,
	Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
Subject: Re: [PATCH v3] block: refactor duplicated macros
Date: Wed, 11 Mar 2020 19:20:11 +0800	[thread overview]
Message-ID: <89925759-cbc1-e8f0-b9b3-23fd062ebbcd@suse.de> (raw)
In-Reply-To: <20200311002254.121365-1-mcroce@redhat.com>

On 2020/3/11 8:22 上午, Matteo Croce wrote:
> The macros PAGE_SECTORS, PAGE_SECTORS_SHIFT and SECTOR_MASK are defined
> several times in different flavours across the whole tree.
> Define them just once in a common header.
> 
> While at it, replace replace "PAGE_SHIFT - 9" with "PAGE_SECTORS_SHIFT" too
> and rename SECTOR_MASK to PAGE_SECTORS_MASK.
> 
> Signed-off-by: Matteo Croce <mcroce@redhat.com>

Hi Matteo,

For the bcache part, it looks good to me.

Acked-by: Coly Li <colyli@suse.de>

> ---
> v3:
> As Guoqing Jiang suggested, replace "PAGE_SHIFT - 9" with "PAGE_SECTORS_SHIFT"
> 
> v2:
> As Dan Williams suggested:
> 
>  #define PAGE_SECTORS_MASK            (~(PAGE_SECTORS - 1))
> 
>  block/blk-lib.c                  |  2 +-
>  block/blk-settings.c             |  4 ++--
>  block/partition-generic.c        |  2 +-
>  drivers/block/brd.c              |  3 ---
>  drivers/block/null_blk_main.c    | 14 +++++---------
>  drivers/block/zram/zram_drv.c    |  8 ++++----
>  drivers/block/zram/zram_drv.h    |  2 --
>  drivers/dax/super.c              |  2 +-
>  drivers/md/bcache/util.h         |  2 --
>  drivers/md/dm-bufio.c            |  6 +++---
>  drivers/md/dm-integrity.c        | 10 +++++-----
>  drivers/md/dm-table.c            |  2 +-
>  drivers/md/md.c                  |  4 ++--
>  drivers/md/raid1.c               |  2 +-
>  drivers/md/raid10.c              |  2 +-
>  drivers/md/raid5-cache.c         | 10 +++++-----
>  drivers/md/raid5.h               |  2 +-
>  drivers/mmc/core/host.c          |  3 ++-
>  drivers/nvme/host/fc.c           |  2 +-
>  drivers/nvme/target/loop.c       |  2 +-
>  drivers/scsi/xen-scsifront.c     |  4 ++--
>  fs/erofs/internal.h              |  2 +-
>  fs/ext2/dir.c                    |  2 +-
>  fs/iomap/buffered-io.c           |  2 +-
>  fs/libfs.c                       |  2 +-
>  fs/nfs/blocklayout/blocklayout.h |  2 --
>  fs/nilfs2/dir.c                  |  2 +-
>  include/linux/blkdev.h           |  4 ++++
>  include/linux/device-mapper.h    |  1 -
>  mm/page_io.c                     |  4 ++--
>  mm/swapfile.c                    | 12 ++++++------
>  31 files changed, 56 insertions(+), 65 deletions(-)
> 

[snipped]

> diff --git a/drivers/md/bcache/util.h b/drivers/md/bcache/util.h
> index c029f7443190..55196e0f37c3 100644
> --- a/drivers/md/bcache/util.h
> +++ b/drivers/md/bcache/util.h
> @@ -15,8 +15,6 @@
>  
>  #include "closure.h"
>  
> -#define PAGE_SECTORS		(PAGE_SIZE / 512)
> -
>  struct closure;
>  
>  #ifdef CONFIG_BCACHE_DEBUG

[snipped]


-- 

Coly Li
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

  parent reply	other threads:[~2020-03-11 11:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11  0:22 [PATCH v3] block: refactor duplicated macros Matteo Croce
2020-03-11  2:42 ` Martin K. Petersen
2020-03-11 11:20 ` Coly Li [this message]
2020-03-11 12:58 ` Jens Axboe

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=89925759-cbc1-e8f0-b9b3-23fd062ebbcd@suse.de \
    --to=colyli@suse.de \
    --cc=anna.schumaker@netapp.com \
    --cc=axboe@kernel.dk \
    --cc=guoqing.jiang@cloud.ionos.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mcroce@redhat.com \
    --cc=song@kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=xen-devel@lists.xenproject.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 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).