Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1673750ybe; Wed, 11 Sep 2019 19:59:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhsrBTH0kdpFM59TOTfoM4eE3ISMRXp2WlDVqKJSDgmnQrgyxRR+IoIxUlJx6pBVSUJ8Zy X-Received: by 2002:aa7:c24b:: with SMTP id y11mr39494754edo.214.1568257162275; Wed, 11 Sep 2019 19:59:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568257162; cv=none; d=google.com; s=arc-20160816; b=DzEsyLMDphsByCtalEv9kxJ6Nuf5t6QxV78b+LC1XfTiKn3iMzKCOE+n7d8zrzpglQ QQmDTL47ML+Ptu7gL0bLC43NlZspY48xuf4AfOMZxbG1P79pSdwOWQfPbCn/UXF7peHF 86qdSrbphU8E1gIjGoncF5OZeDXSIs/EACmWOJjP86QfranM4sMx96P1Kd2mFdp+SaOk ys8/VqfC7Q/5cfKUM6/L093kWKFIjtcwTYSl6wrW9vWp/GJ1ChMzRYNoxz7+fNOZ05L8 ZXj7AeWBrSGGXUNjdRegL3GOvyGGKas17YXNnoPDOcP7vXgPUoQzy9xbNJgUSyxOMSHZ EEOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=0gi/GO6WBvJ7MMy1JgDc2Z+Y/X9y5BipFQwPeSG0gkY=; b=JEkYTZwvDdHSW1DTat7QVbDdgt/SBD5lZ8exuyJqWEX3ZevLB6D5sCEvQCnif0ZU8D 7cG9remn7mbR4eDcmux9R7QYhCGuYCAltGp9R5GqwNxss3K6j7qKMKALxYm4cnkJHRQd A5IW2f4O58SgjhbYik26GI8k2CE9ilFXVkRxDQxxVhrjgpLNYI5m/haty3XTrvC5UwfT v5mHd1NZVf5FJajVI12T1wyPCfrhDBUDt4pVr3VgNpoyauC3fHPu+TWybhsqOr54d3eR zpCT2W9arTBxiRYMcnMH1+e+jx0yVAbB7oiMCrRmX8V7EuIL/IpxrdmJA1XT8dZ8kPyP f1ow== ARC-Authentication-Results: i=1; mx.google.com; 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 q18si3701400ejp.226.2019.09.11.19.58.59; Wed, 11 Sep 2019 19:59:22 -0700 (PDT) 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; 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 S1729534AbfILCz0 (ORCPT + 99 others); Wed, 11 Sep 2019 22:55:26 -0400 Received: from smtprelay0247.hostedemail.com ([216.40.44.247]:49341 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728947AbfILCzY (ORCPT ); Wed, 11 Sep 2019 22:55:24 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id EF03A8024B45; Thu, 12 Sep 2019 02:55:22 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::,RULES_HIT:41:69:355:379:541:800:960:966:973:988:989:1260:1345:1359:1437:1534:1542:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:3138:3139:3140:3141:3142:3353:3865:3867:3868:3871:4250:4321:4385:5007:6261:6630:7904:9592:10004:10848:11026:11473:11658:11914:12043:12048:12291:12296:12297:12555:12683:12895:12986:14096:14110:14181:14394:14721:21080:21433:21451:21627:30054,0,RBL:47.151.152.152:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:0,LUA_SUMMARY:none X-HE-Tag: feast04_861bb7d71dd62 X-Filterd-Recvd-Size: 3643 Received: from joe-laptop.perches.com (unknown [47.151.152.152]) (Authenticated sender: joe@perches.com) by omf16.hostedemail.com (Postfix) with ESMTPA; Thu, 12 Sep 2019 02:55:21 +0000 (UTC) From: Joe Perches To: Dan Williams , Vishal Verma , Dave Jiang , Keith Busch , Ira Weiny Cc: Dan Carpenter , linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/13] nvdimm: btt.h: Neaten #defines to improve readability Date: Wed, 11 Sep 2019 19:54:39 -0700 Message-Id: X-Mailer: git-send-email 2.15.0 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use tab alignment to make the content and macro a bit more intelligible. Use the BIT and BIT_ULL macros. Convert MAP_LBA_MASK to use the already defined shift masks. Signed-off-by: Joe Perches --- drivers/nvdimm/btt.h | 54 ++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/nvdimm/btt.h b/drivers/nvdimm/btt.h index 1da76da3e159..fb0f4546153f 100644 --- a/drivers/nvdimm/btt.h +++ b/drivers/nvdimm/btt.h @@ -10,34 +10,34 @@ #include #include -#define BTT_SIG_LEN 16 -#define BTT_SIG "BTT_ARENA_INFO\0" -#define MAP_ENT_SIZE 4 -#define MAP_TRIM_SHIFT 31 -#define MAP_TRIM_MASK (1 << MAP_TRIM_SHIFT) -#define MAP_ERR_SHIFT 30 -#define MAP_ERR_MASK (1 << MAP_ERR_SHIFT) -#define MAP_LBA_MASK (~((1 << MAP_TRIM_SHIFT) | (1 << MAP_ERR_SHIFT))) -#define MAP_ENT_NORMAL 0xC0000000 -#define LOG_GRP_SIZE sizeof(struct log_group) -#define LOG_ENT_SIZE sizeof(struct log_entry) -#define ARENA_MIN_SIZE (1UL << 24) /* 16 MB */ -#define ARENA_MAX_SIZE (1ULL << 39) /* 512 GB */ -#define RTT_VALID (1UL << 31) -#define RTT_INVALID 0 -#define BTT_PG_SIZE 4096 -#define BTT_DEFAULT_NFREE ND_MAX_LANES -#define LOG_SEQ_INIT 1 - -#define IB_FLAG_ERROR 0x00000001 -#define IB_FLAG_ERROR_MASK 0x00000001 - -#define ent_lba(ent) (ent & MAP_LBA_MASK) -#define ent_e_flag(ent) (!!(ent & MAP_ERR_MASK)) -#define ent_z_flag(ent) (!!(ent & MAP_TRIM_MASK)) -#define set_e_flag(ent) (ent |= MAP_ERR_MASK) +#define BTT_SIG_LEN 16 +#define BTT_SIG "BTT_ARENA_INFO\0" +#define MAP_ENT_SIZE 4 +#define MAP_TRIM_SHIFT 31 +#define MAP_TRIM_MASK BIT(MAP_TRIM_SHIFT) +#define MAP_ERR_SHIFT 30 +#define MAP_ERR_MASK BIT(MAP_ERR_SHIFT) +#define MAP_LBA_MASK (~(MAP_TRIM_MASK | MAP_ERR_MASK)) +#define MAP_ENT_NORMAL 0xC0000000 +#define LOG_GRP_SIZE sizeof(struct log_group) +#define LOG_ENT_SIZE sizeof(struct log_entry) +#define ARENA_MIN_SIZE BIT(24) /* 16 MB */ +#define ARENA_MAX_SIZE BIT_ULL(39) /* 512 GB */ +#define RTT_VALID BIT(31) +#define RTT_INVALID 0 +#define BTT_PG_SIZE 4096 +#define BTT_DEFAULT_NFREE ND_MAX_LANES +#define LOG_SEQ_INIT 1 + +#define IB_FLAG_ERROR 0x00000001 +#define IB_FLAG_ERROR_MASK 0x00000001 + +#define ent_lba(ent) ((ent) & MAP_LBA_MASK) +#define ent_e_flag(ent) (!!((ent) & MAP_ERR_MASK)) +#define ent_z_flag(ent) (!!((ent) & MAP_TRIM_MASK)) +#define set_e_flag(ent) ((ent) |= MAP_ERR_MASK) /* 'normal' is both e and z flags set */ -#define ent_normal(ent) (ent_e_flag(ent) && ent_z_flag(ent)) +#define ent_normal(ent) (ent_e_flag(ent) && ent_z_flag(ent)) enum btt_init_state { INIT_UNCHECKED = 0, -- 2.15.0