Received: by 10.223.185.116 with SMTP id b49csp1621679wrg; Wed, 21 Feb 2018 23:45:40 -0800 (PST) X-Google-Smtp-Source: AH8x225NClDU3IpanQ+K3SHgOvLc9O13+2TTNMXSwxlaRAsu7NXS6y10Pd2QhQsRkgSWabcKITBk X-Received: by 10.98.56.150 with SMTP id f144mr6042238pfa.150.1519285540290; Wed, 21 Feb 2018 23:45:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519285540; cv=none; d=google.com; s=arc-20160816; b=f5WGlr+OTf8FqG/fY22XbCWr/wSV22xM4GWM3pOmPpVrERT/rZcEANx/mfzJgkZCZq LvNsQTNY+0oAfOV3HLs5VwaHAd6ZdKf+90CQczWIt60gmU3Kx6VHxpZmfq299QAPui+T gzWNbO1W0T0qlZ0H6BcrSP8OE+5Rgf2M5nGdsTwV2AdYVJFQa6tFkUMx4Oz/jAP4tfT2 umYUeF96pbWMl4O2T0xgxdszs82SfY+7fVH1PQveJDwwfS18kR/Qe6UAsXXbmmUfVS8T 7GpXglAY19yOfGiThF/bBV5BkXOoUJJi2kbb1tyd8Sc8FGQ/b9kampMw4olwTdEO7O4a yV+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=/wFYC1MujZuVbteUkwbFEW6tzb5NPqbz54hmDc4Xx5E=; b=Dan6P8RxpMYdRRUYuipSm77VSgoKVB+SKBCmgrjWdM8HHqV6yTOG/yAJQA1dXNLAJ8 wU48SD+2+du/Qis81/PhBgCZnprhiJYAConPmJOl6Q8Cd7/TAD0MVFuIODIBBqqFHNFC FuOtCDx4+/CekZ4wyEp3Ve664NKn+grmaOzamDRVze+w9UWgXm+184lxYQgGtEXAzO+X BmdPfSkgy95FS+cGdgzFtVISvVrb3Pd4XZqmwwp0liy4qUmm9mnaFpoMCTrTmxmNyYGI WYpVEkikvHwv3zrirCSIw+uqe31TRUbZpiPh0Pn7FdlDl9R23gR2UAl7MzBk0n91+OhD QBUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=ytP4B91P; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc6-v6si1121029plb.250.2018.02.21.23.45.26; Wed, 21 Feb 2018 23:45:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=ytP4B91P; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752659AbeBVHoE (ORCPT + 99 others); Thu, 22 Feb 2018 02:44:04 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:35695 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751669AbeBVHoC (ORCPT ); Thu, 22 Feb 2018 02:44:02 -0500 Received: by mail-lf0-f66.google.com with SMTP id 70so6046939lfw.2 for ; Wed, 21 Feb 2018 23:44:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=/wFYC1MujZuVbteUkwbFEW6tzb5NPqbz54hmDc4Xx5E=; b=ytP4B91PedZHRJOCengmTfPsOWaL0gFIF8epee2hd6P9D1VhkkS83FiAQEI7ZoiyIU Hbum8QYikno/S5bYr1A4H5Nwsz5Hqig3d4CV6eIVAB9b3LbFz42vDoKMDqYQbohrTEfD kLLC6swE1BZJkYVVzZyyT0xP6hgJ5b9Rapw1fsZRVfGSYw4ShrhIVv/InhGgutEiimiP Jc+TXXq2vxXuPjh/bLNR/0pOA5zi5uGyV7IdLd6E5klUQrxTbHtgxUZKlLW4VeOgujf1 0rTDVzfgKYgeJgCDz0x++XQF0BoIazTpXiCqnlOm2LGIB4JtfXDgUHG22MIHDcAUZo9z SJbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/wFYC1MujZuVbteUkwbFEW6tzb5NPqbz54hmDc4Xx5E=; b=KjEZf4q5+vD7EbDdu5zk5kevkJt7puFTwvq/tB8mc4A4MNnFU48YtQ9OX7BRk4fKo8 eej4hV3Qu6NHZJ7puKjgnk+pzC6zkXxQx0ssC3a8Ti5OvHVmQCUnBYtCMnbUj045Aww4 5GOTZgUAyzt0Zk7yWveL/LDgoh8CWJlqyndBi5v7EUo2zn2lLQOZe+IYQtPT2uW89AxP 6nxSJgJWIiqSXJ/wykH/xUotFadPEVhonZrm+qrWHl64NwfQ1+09C9zXFDoImGetDAg/ 4MK1gmSLDVCXdg5qnqqkU6sbD+u9vWyQnNaB6HiOs/itmk6Ken/cgGiST+bbs9zuYT7C T8ag== X-Gm-Message-State: APf1xPD0j9EvvPAk7mumf/kpbhewmcSDSZjM3XZFZumAt+bCsGMYmKne 3iHTU7RIECd4rdkkE8Y/4ivCYg== X-Received: by 10.25.233.23 with SMTP id g23mr3801918lfh.99.1519285440968; Wed, 21 Feb 2018 23:44:00 -0800 (PST) Received: from [192.168.0.10] (x1-6-a4-08-f5-18-3c-3a.cpe.webspeed.dk. [188.176.29.198]) by smtp.googlemail.com with ESMTPSA id n15sm6491293lfn.15.2018.02.21.23.44.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 23:44:00 -0800 (PST) Subject: Re: [PATCH 07/20] lightnvm: rename sect_* to sec_* To: =?UTF-8?Q?Javier_Gonz=c3=a1lez?= Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, =?UTF-8?Q?Javier_Gonz=c3=a1lez?= References: <1519205218-26994-1-git-send-email-javier@cnexlabs.com> <1519205218-26994-8-git-send-email-javier@cnexlabs.com> From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: <7dc355a2-b3a2-28f3-a595-42822129f456@lightnvm.io> Date: Thu, 22 Feb 2018 08:43:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1519205218-26994-8-git-send-email-javier@cnexlabs.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/21/2018 10:26 AM, Javier González wrote: > Rename abbreviations for sector from sect_* to sec_* as most of the code > uses this format and it is confusing when using the different > structures. > > Signed-off-by: Javier González > --- > drivers/lightnvm/pblk-init.c | 8 ++++---- > drivers/lightnvm/pblk-sysfs.c | 4 ++-- > drivers/lightnvm/pblk.h | 8 ++++---- > drivers/nvme/host/lightnvm.c | 8 ++++---- > include/linux/lightnvm.h | 8 ++++---- > 5 files changed, 18 insertions(+), 18 deletions(-) > > diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c > index 455fc63a9409..6bf51ef8f516 100644 > --- a/drivers/lightnvm/pblk-init.c > +++ b/drivers/lightnvm/pblk-init.c > @@ -179,16 +179,16 @@ static int pblk_set_addrf_12(struct nvm_geo *geo, > dst->blk_len = src->blk_len; > dst->pg_len = src->pg_len; > dst->pln_len = src->pln_len; > - dst->sect_len = src->sect_len; > + dst->sec_len = src->sec_len; > > - dst->sect_offset = 0; > - dst->pln_offset = dst->sect_len; > + dst->sec_offset = 0; > + dst->pln_offset = dst->sec_len; > dst->ch_offset = dst->pln_offset + dst->pln_len; > dst->lun_offset = dst->ch_offset + dst->ch_len; > dst->pg_offset = dst->lun_offset + dst->lun_len; > dst->blk_offset = dst->pg_offset + dst->pg_len; > > - dst->sec_mask = ((1ULL << dst->sect_len) - 1) << dst->sect_offset; > + dst->sec_mask = ((1ULL << dst->sec_len) - 1) << dst->sec_offset; > dst->pln_mask = ((1ULL << dst->pln_len) - 1) << dst->pln_offset; > dst->ch_mask = ((1ULL << dst->ch_len) - 1) << dst->ch_offset; > dst->lun_mask = ((1ULL << dst->lun_len) - 1) << dst->lun_offset; > diff --git a/drivers/lightnvm/pblk-sysfs.c b/drivers/lightnvm/pblk-sysfs.c > index 5eb21a279361..81288aa9162a 100644 > --- a/drivers/lightnvm/pblk-sysfs.c > +++ b/drivers/lightnvm/pblk-sysfs.c > @@ -128,7 +128,7 @@ static ssize_t pblk_sysfs_ppaf(struct pblk *pblk, char *page) > ppaf->blk_offset, ppaf->blk_len, > ppaf->pg_offset, ppaf->pg_len, > ppaf->pln_offset, ppaf->pln_len, > - ppaf->sect_offset, ppaf->sect_len); > + ppaf->sec_offset, ppaf->sec_len); > > sz += snprintf(page + sz, PAGE_SIZE - sz, > "device:ch:%d/%d,lun:%d/%d,blk:%d/%d,pg:%d/%d,pl:%d/%d,sec:%d/%d\n", > @@ -137,7 +137,7 @@ static ssize_t pblk_sysfs_ppaf(struct pblk *pblk, char *page) > geo_ppaf->blk_offset, geo_ppaf->blk_len, > geo_ppaf->pg_offset, geo_ppaf->pg_len, > geo_ppaf->pln_offset, geo_ppaf->pln_len, > - geo_ppaf->sect_offset, geo_ppaf->sect_len); > + geo_ppaf->sec_offset, geo_ppaf->sec_len); > > return sz; > } > diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h > index 1f32284b0aec..4f7a365436f1 100644 > --- a/drivers/lightnvm/pblk.h > +++ b/drivers/lightnvm/pblk.h > @@ -957,7 +957,7 @@ static inline struct ppa_addr addr_to_gen_ppa(struct pblk *pblk, u64 paddr, > ppa.g.lun = (paddr & ppaf->lun_mask) >> ppaf->lun_offset; > ppa.g.ch = (paddr & ppaf->ch_mask) >> ppaf->ch_offset; > ppa.g.pl = (paddr & ppaf->pln_mask) >> ppaf->pln_offset; > - ppa.g.sec = (paddr & ppaf->sec_mask) >> ppaf->sect_offset; > + ppa.g.sec = (paddr & ppaf->sec_mask) >> ppaf->sec_offset; > > return ppa; > } > @@ -973,7 +973,7 @@ static inline u64 pblk_dev_ppa_to_line_addr(struct pblk *pblk, > paddr |= (u64)p.g.lun << ppaf->lun_offset; > paddr |= (u64)p.g.pg << ppaf->pg_offset; > paddr |= (u64)p.g.pl << ppaf->pln_offset; > - paddr |= (u64)p.g.sec << ppaf->sect_offset; > + paddr |= (u64)p.g.sec << ppaf->sec_offset; > > return paddr; > } > @@ -998,7 +998,7 @@ static inline struct ppa_addr pblk_ppa32_to_ppa64(struct pblk *pblk, u32 ppa32) > ppa64.g.blk = (ppa32 & ppaf->blk_mask) >> ppaf->blk_offset; > ppa64.g.pg = (ppa32 & ppaf->pg_mask) >> ppaf->pg_offset; > ppa64.g.pl = (ppa32 & ppaf->pln_mask) >> ppaf->pln_offset; > - ppa64.g.sec = (ppa32 & ppaf->sec_mask) >> ppaf->sect_offset; > + ppa64.g.sec = (ppa32 & ppaf->sec_mask) >> ppaf->sec_offset; > } > > return ppa64; > @@ -1022,7 +1022,7 @@ static inline u32 pblk_ppa64_to_ppa32(struct pblk *pblk, struct ppa_addr ppa64) > ppa32 |= ppa64.g.blk << ppaf->blk_offset; > ppa32 |= ppa64.g.pg << ppaf->pg_offset; > ppa32 |= ppa64.g.pl << ppaf->pln_offset; > - ppa32 |= ppa64.g.sec << ppaf->sect_offset; > + ppa32 |= ppa64.g.sec << ppaf->sec_offset; > } > > return ppa32; > diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c > index bd97672e0b4f..cca32da05316 100644 > --- a/drivers/nvme/host/lightnvm.c > +++ b/drivers/nvme/host/lightnvm.c > @@ -262,21 +262,21 @@ static void nvme_nvm_set_addr_12(struct nvm_addr_format_12 *dst, > dst->blk_len = src->blk_len; > dst->pg_len = src->pg_len; > dst->pln_len = src->pln_len; > - dst->sect_len = src->sec_len; > + dst->sec_len = src->sec_len; > > dst->ch_offset = src->ch_offset; > dst->lun_offset = src->lun_offset; > dst->blk_offset = src->blk_offset; > dst->pg_offset = src->pg_offset; > dst->pln_offset = src->pln_offset; > - dst->sect_offset = src->sec_offset; > + dst->sec_offset = src->sec_offset; > > dst->ch_mask = ((1ULL << dst->ch_len) - 1) << dst->ch_offset; > dst->lun_mask = ((1ULL << dst->lun_len) - 1) << dst->lun_offset; > dst->blk_mask = ((1ULL << dst->blk_len) - 1) << dst->blk_offset; > dst->pg_mask = ((1ULL << dst->pg_len) - 1) << dst->pg_offset; > dst->pln_mask = ((1ULL << dst->pln_len) - 1) << dst->pln_offset; > - dst->sec_mask = ((1ULL << dst->sect_len) - 1) << dst->sect_offset; > + dst->sec_mask = ((1ULL << dst->sec_len) - 1) << dst->sec_offset; > } > > static int nvme_nvm_setup_12(struct nvme_nvm_id12 *id, > @@ -956,7 +956,7 @@ static ssize_t nvm_dev_attr_show_ppaf(struct nvm_addr_format_12 *ppaf, > ppaf->pln_offset, ppaf->pln_len, > ppaf->blk_offset, ppaf->blk_len, > ppaf->pg_offset, ppaf->pg_len, > - ppaf->sect_offset, ppaf->sect_len); > + ppaf->sec_offset, ppaf->sec_len); > } > > static ssize_t nvm_dev_attr_show_12(struct device *dev, > diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h > index 02f1fd617781..ccc5faa63cb7 100644 > --- a/include/linux/lightnvm.h > +++ b/include/linux/lightnvm.h > @@ -163,14 +163,14 @@ struct nvm_addr_format_12 { > u8 blk_len; > u8 pg_len; > u8 pln_len; > - u8 sect_len; > + u8 sec_len; > > u8 ch_offset; > u8 lun_offset; > u8 blk_offset; > u8 pg_offset; > u8 pln_offset; > - u8 sect_offset; > + u8 sec_offset; > > u64 ch_mask; > u64 lun_mask; > @@ -399,7 +399,7 @@ static inline struct ppa_addr generic_to_dev_addr(struct nvm_tgt_dev *tgt_dev, > l.ppa |= ((u64)r.g.blk) << ppaf->blk_offset; > l.ppa |= ((u64)r.g.pg) << ppaf->pg_offset; > l.ppa |= ((u64)r.g.pl) << ppaf->pln_offset; > - l.ppa |= ((u64)r.g.sec) << ppaf->sect_offset; > + l.ppa |= ((u64)r.g.sec) << ppaf->sec_offset; > > return l; > } > @@ -419,7 +419,7 @@ static inline struct ppa_addr dev_to_generic_addr(struct nvm_tgt_dev *tgt_dev, > l.g.blk = (r.ppa & ppaf->blk_mask) >> ppaf->blk_offset; > l.g.pg = (r.ppa & ppaf->pg_mask) >> ppaf->pg_offset; > l.g.pl = (r.ppa & ppaf->pln_mask) >> ppaf->pln_offset; > - l.g.sec = (r.ppa & ppaf->sec_mask) >> ppaf->sect_offset; > + l.g.sec = (r.ppa & ppaf->sec_mask) >> ppaf->sec_offset; > > return l; > } > Looks good, I'll pick up when rebased. This could properly be part of another patch set with cleanups, as it is not 2.0 specific.