From patchwork Sat Apr 15 18:55:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 9682411 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1A42E60138 for ; Sat, 15 Apr 2017 19:00:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C69425223 for ; Sat, 15 Apr 2017 19:00:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 014212823D; Sat, 15 Apr 2017 19:00:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79ACC25223 for ; Sat, 15 Apr 2017 19:00:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751616AbdDOTAd (ORCPT ); Sat, 15 Apr 2017 15:00:33 -0400 Received: from mail-dm3nam03on0041.outbound.protection.outlook.com ([104.47.41.41]:38016 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754810AbdDOS4Z (ORCPT ); Sat, 15 Apr 2017 14:56:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cnexlabs.onmicrosoft.com; s=selector1-cnexlabs-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=pUEfkbiupdnz8aApSmOw2p/vP+8zm4ewVJ25uNMHE1Y=; b=biMH2FvfJt0lVAYfoFZg+Oiii5ARY/R3e6o4pU5n9dNoVBxT+jyrFtDbcxIOgNxzvriAo6Gz6Woi/SdBa2h8OjOiZw83G9E8zn1GJM/n2UhR2HgQ4ePRua96LNvSPt7sohRy7B2H4aXk5r7qt/kNX30sCxX7gueOaZ6eIEAHKIU= Authentication-Results: fb.com; dkim=none (message not signed) header.d=none; fb.com; dmarc=none action=none header.from=cnexlabs.com; Received: from skyninja.cnexlabs.com (193.106.164.211) by CY4PR06MB2774.namprd06.prod.outlook.com (10.175.117.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.10; Sat, 15 Apr 2017 18:56:20 +0000 From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: CC: , , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 06/19] lightnvm: enable nvme size compile asserts Date: Sat, 15 Apr 2017 20:55:40 +0200 Message-ID: <20170415185553.16098-7-matias@cnexlabs.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170415185553.16098-1-matias@cnexlabs.com> References: <20170415185553.16098-1-matias@cnexlabs.com> MIME-Version: 1.0 X-Originating-IP: [193.106.164.211] X-ClientProxiedBy: AM5PR0701CA0069.eurprd07.prod.outlook.com (10.169.145.159) To CY4PR06MB2774.namprd06.prod.outlook.com (10.175.117.142) X-MS-Office365-Filtering-Correlation-Id: 6e9cc7c2-189f-4581-7681-08d484311b53 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY4PR06MB2774; X-Microsoft-Exchange-Diagnostics: 1; CY4PR06MB2774; 3:WDFamdlNuEDtUiU35BDn5V+zw2FxCk+amP2x1qrhMc6xl/mrOpZkxQo9PF0EEetvs9V8RZnYRhbHSnzRtDVeHQC4GO/+CodYKFpaDboL4Tp6nM4MoCUbZlna/xn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+a73Vn464GnzV+IobWEBh3lfMmcK/I/HE5HMG/YKSaIB4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(6041248)(20161123564025)(20161123562025)(20161123560025)(201703131423075)(201703061421075)(20161123555025)(6072148); SRVR:CY4PR06MB2774; BCL:0; PCL:0; RULEID:; SRVR:CY4PR06MB2774; X-Microsoft-Exchange-Diagnostics: 1; CY4PR06MB2774; 4:BuDIuOczOf4tnx0YXZxRbDJP1S7Jq6INLix8aFYNZpSDcOdrt1nMnRJWzET4IUtEsmE0UBbOoVb3tKW8nmk1JAcKqoQryS7/YIK1JKEyr25roxvbD5LEG7HOtxk4ojl3w7tRTtJOCc1SV8bMdZoe3uBS4HuwSyPq0ierKY2fcGLzXCzODGB5Rf5QTHhZSacemb6+mGNSIoUARJSipG/moCN1ZGvlf4VCk9Id3UG/g38qi1hFn2EzpQn+RdbUoHmjuzLseK7jQJfEBXkQgdaVOKR+z0AST3Jmf/a44sg17Rd0WKzz829LUx5k+K1qCwfvDiAXy4u5h47hsA+8SkxAYDGQL1Tyl0JVBu2CI7tV7RfG+KtTY8QvYD26WnDscKjDsJxoJzn7G1JznVoNvWuQ9vmEkwoU6dob4vIYt0btdmgXM8wUfUGxjZbfTTVvvVODrBm7bPIZmJ06VDZiR/H/LSblIRVzoxxTrXTlCVqzkimaIyQQEy5dUtmCxnF2lV+/CZ12sRAvvZ+1sqbJlTP76T/U5RMzcHBhsxgyzJdDuXebP/tPj850mP+s6Heti+nIOCAe5+/u2G2+MNt9H1rRhCpCe5IygT8ICbFlCwSH26ZPloHyg+YWbDCAWtQbX0+coqt9C/dWpOjsR6UXwg2/el3wOqjEaKssNluhmReSs+/97quNoORZTHTwpbxgR3+2R0hV29RairjDuXF2wveI6ypAicQpuKYP2rxTFTe4EpY= X-Forefront-PRVS: 02788FF38E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39400400002)(39450400003)(86362001)(305945005)(1076002)(6916009)(6666003)(25786009)(2950100002)(6486002)(2906002)(3846002)(6116002)(2870700001)(54906002)(189998001)(53936002)(53416004)(107886003)(110136004)(5660300001)(38730400002)(50986999)(76176999)(2351001)(4326008)(66066001)(5820100001)(23676002)(81166006)(47776003)(42186005)(36756003)(33646002)(50226002)(8676002)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR06MB2774; H:skyninja.cnexlabs.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjA2TUIyNzc0OzIzOjJvLzdTTnkwaW5hazBIcDRwZnp1M0FSbmg5?= =?utf-8?B?cUx4Rk9BR3IxL1dWSHBzTU1TY0Fod2w5L3RnWXR5R29iQThyOFc4Mi9CNUow?= =?utf-8?B?OWJvRUpCN1ppK2s0VVhEeStMWHdwaTloMFBhWm1BSXBDK3Z3RkFUT29WQm4w?= =?utf-8?B?ZnliQytqNTgrcEZSemxqTzhqTWpyNVlKYWtNdzU1VmpLZlE4K3gvRTQxUXhN?= =?utf-8?B?amVORTJFemZaUEpKK0dFWENtSktDRlRta0owdk5uQjBuTGhsSHVNZVBrT3dS?= =?utf-8?B?UnlEeitXUWFxYy9SZGpNTUk0OW1sNmtTVHdDUENZUWgxekh6QmExdXRQNGVt?= =?utf-8?B?UlNYZ2U1ZE5TYy9pb3U1SHg3NExIKzlSYW1BdmlYVWNydHdEMzRvS0t3MW9o?= =?utf-8?B?R3lGNW9TRHBwTGQzdHQ5M2pJVDk0OGVPb2p1dEFQcHoyeWpaR3RPaGZ5cE9H?= =?utf-8?B?cDJKODRQUUVaT0JxbDlQNlJ3bnVNam5LSzU0RTFkM0pIWHljcEVOTXg2NVo1?= =?utf-8?B?MG1nSGhoalNHdllOSkRZU2lDb1FvOVVzalZpV1RRUXBkZ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exlabs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2017 18:56:20.3963 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR06MB2774 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The asserts in _nvme_nvm_check_size are not compiled due to the function not begin called. Make sure that it is called, and also fix the wrong sizes of asserts for nvme_nvm_addr_format, and nvme_nvm_bb_tbl, which checked for number of bits instead of bytes. Reported-by: Scott Bauer Signed-off-by: Matias Bjørling --- drivers/nvme/host/lightnvm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index 4ea9c93..12c5a40 100644 --- a/drivers/nvme/host/lightnvm.c +++ b/drivers/nvme/host/lightnvm.c @@ -241,9 +241,9 @@ static inline void _nvme_nvm_check_size(void) BUILD_BUG_ON(sizeof(struct nvme_nvm_l2ptbl) != 64); BUILD_BUG_ON(sizeof(struct nvme_nvm_erase_blk) != 64); BUILD_BUG_ON(sizeof(struct nvme_nvm_id_group) != 960); - BUILD_BUG_ON(sizeof(struct nvme_nvm_addr_format) != 128); + BUILD_BUG_ON(sizeof(struct nvme_nvm_addr_format) != 16); BUILD_BUG_ON(sizeof(struct nvme_nvm_id) != 4096); - BUILD_BUG_ON(sizeof(struct nvme_nvm_bb_tbl) != 512); + BUILD_BUG_ON(sizeof(struct nvme_nvm_bb_tbl) != 64); } static int init_grps(struct nvm_id *nvm_id, struct nvme_nvm_id *nvme_nvm_id) @@ -797,6 +797,8 @@ int nvme_nvm_register(struct nvme_ns *ns, char *disk_name, int node) struct request_queue *q = ns->queue; struct nvm_dev *dev; + _nvme_nvm_check_size(); + dev = nvm_alloc_dev(node); if (!dev) return -ENOMEM;