From patchwork Mon Nov 28 21:39:03 2016 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: 9450511 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 4392F60756 for ; Mon, 28 Nov 2016 21:40:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 363D727F94 for ; Mon, 28 Nov 2016 21:40:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B39E28047; Mon, 28 Nov 2016 21:40:50 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 0EB6627F94 for ; Mon, 28 Nov 2016 21:40:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755625AbcK1Vkq (ORCPT ); Mon, 28 Nov 2016 16:40:46 -0500 Received: from mail-wj0-f196.google.com ([209.85.210.196]:32969 "EHLO mail-wj0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755581AbcK1Vjs (ORCPT ); Mon, 28 Nov 2016 16:39:48 -0500 Received: by mail-wj0-f196.google.com with SMTP id kp2so15789241wjc.0 for ; Mon, 28 Nov 2016 13:39:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jlerp6cSWKFqn2J5XunPS5GZMSN7go6BPOR+WV2VH3A=; b=gTW+CVw3XiS1vdMVu+lxXtQHN+4Zi/nY5LAHr5htrZmyJbk7wyCwmy4BkTsq9aSULK KYHzj+9JQEaxzfebQnYvRmrtzNUPNEr7mFpwiyogkf5WVKCOUlZx7ENfTiV8MRCTuHTH uJpJgZJnVv9m+i7VZqB3fZq5kE0yvWhumqt3k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jlerp6cSWKFqn2J5XunPS5GZMSN7go6BPOR+WV2VH3A=; b=VcwgBoB0tCmC2eSQcht4fvv0RZNhW3rRkZr58e4puzsovrTqj4PtxfMH3Wbos9YsRU d/Lvc/oTFdt8ArWv84d868Dygug5049tLQM69WKN07mCUJLh3gH6YSiTMwrjl389XREq rdLbbaFSgVqtY0pJoQYZaQ/vNYacyOo4apsbivNS4hLR+AQYRxz10m/0IzjQJn6ojRjk 3WmvAPY3MXsVNQ1r+5BS1xKhR82pRfs+k98ir8be+rWLJNwHlx3k2zeJMjgExxym9CKh TOltK+g0YuPIpXKR7oMqEwemoe0X4DKJkjm1WmAMnDY0nJDenP5W/14KCwy9uFBKhyVV AWoA== X-Gm-Message-State: AKaTC03AfheWuNwCKiiYoaCeJ0U/2anPYX4kM6XCAe3zOhH2nqeuiaaJltgLIcV8G6eJVA== X-Received: by 10.194.177.197 with SMTP id cs5mr23827413wjc.6.1480369187214; Mon, 28 Nov 2016 13:39:47 -0800 (PST) Received: from Macroninja.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id w79sm30825843wmw.0.2016.11.28.13.39.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Nov 2016 13:39:46 -0800 (PST) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: axboe@fb.com, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 12/23] lightnvm: use constant name instead of value Date: Mon, 28 Nov 2016 22:39:03 +0100 Message-Id: <20161128213914.12516-13-m@bjorling.me> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161128213914.12516-1-m@bjorling.me> References: <20161128213914.12516-1-m@bjorling.me> MIME-Version: 1.0 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 From: Javier González There is a constant to refer to free blocks. Use it when marking bad blocks instead of using a constant value Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/gennvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/lightnvm/gennvm.c b/drivers/lightnvm/gennvm.c index e969e3a..aee5b72 100644 --- a/drivers/lightnvm/gennvm.c +++ b/drivers/lightnvm/gennvm.c @@ -279,7 +279,7 @@ static int gen_block_bb(struct gen_dev *gn, struct ppa_addr ppa, lun = &gn->luns[(dev->luns_per_chnl * ppa.g.ch) + ppa.g.lun]; for (i = 0; i < nr_blks; i++) { - if (blks[i] == 0) + if (blks[i] == NVM_BLK_T_FREE) continue; blk = &lun->vlun.blocks[i];