Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp148588pxa; Tue, 18 Aug 2020 19:12:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsW9GVnQWlpuQ1K6z/9SgGMRfgPPxom9+Y0oEgv6uB+waIoPvRLRlptbjUI5g0c7eV/ha9 X-Received: by 2002:a17:906:4882:: with SMTP id v2mr22718252ejq.302.1597803170309; Tue, 18 Aug 2020 19:12:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597803170; cv=none; d=google.com; s=arc-20160816; b=aQ3grp1+Gu7tJDuQCEbbkTeqDwpZUoI4w8kmLEmTLq2j8PorY5lKId8hS9Xv7XDycg /xfZzxYNb+L1CHmELCMZiuiAj2TbqbdMllYVKDaPV9c9shIm3oKMAxFt0DPVAP0nRrP1 YsYzNMyY36yZw/zrZKAbhisZfz9yE3aZPln45E6G2wH7X7cywQGLubO2XimKjAYwn9q0 yTwbKlmWRI9BnIQ5sfbVf1/OyAoPLNq+Dhf0xRx4mn/B2/44T1oL6j4WvgasorXNkKFB C2XBWbO+v/O5eJSQdq2gWVxgMaJNOZWUo8QNzzzgbguT/ioGlTASiGg1NwO8R3dJnvVM ONIQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=vWZ8f/Bbf19Z/hgmQtTZ8gKX8QL4zH8XzVEMoDS0wqc=; b=OeCpVssg71v4j5S1oNqv7nTRi8ebDYdy/kSgvJOomYoFzsrCKI8REJWbglZUmy13fQ JcdGEn4VSYJwYkc69ieaUe9joetGbiueRnhhAgqjZ4d3AGsSMoPySPSM4ipWMyztRgi3 SHCyPdNgs1LWsdz8nSr2o70/16n/z6XM6insCXjc+IRchfMQOii2asB/XbBC/WzLV5GF Z5eWtLtiD2zGrkflh97HOo8716OBWw86H6+LQPUgxv+HYt8bg80IzG6lZ+FOgsIf4V2/ 7D8qQmctXizTVebiKNtAttEj0nASHqKprg1yOjO5a/xNIhB4iSeyJe2CNLFVj09k0Oc4 HENg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z5si14503281ejd.322.2020.08.18.19.12.26; Tue, 18 Aug 2020 19:12:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727077AbgHSCF7 (ORCPT + 99 others); Tue, 18 Aug 2020 22:05:59 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9839 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726876AbgHSCFt (ORCPT ); Tue, 18 Aug 2020 22:05:49 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id A6539BF6B7B2A3CC8183; Wed, 19 Aug 2020 10:05:45 +0800 (CST) Received: from DESKTOP-C3MD9UG.china.huawei.com (10.174.177.253) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Wed, 19 Aug 2020 10:05:35 +0800 From: Zhen Lei To: Oliver O'Halloran , Dan Williams , Vishal Verma , "Dave Jiang" , Ira Weiny , Markus Elfring , linux-nvdimm , linux-kernel CC: Zhen Lei Subject: [PATCH v2 4/4] libnvdimm/region: reduce an unnecessary if branch in nd_region_create() Date: Wed, 19 Aug 2020 10:05:03 +0800 Message-ID: <20200819020503.3079-5-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20200819020503.3079-1-thunder.leizhen@huawei.com> References: <20200819020503.3079-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.177.253] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The "else" branch can only be entered when ndr_desc->flush is NULL. After replaced "NULL" with "ndr_desc->flush", we will find that the statements in "if..else.." are the same. No functional change. Signed-off-by: Zhen Lei --- drivers/nvdimm/region_devs.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c index ef23119db574663..7cf9c7d857909ce 100644 --- a/drivers/nvdimm/region_devs.c +++ b/drivers/nvdimm/region_devs.c @@ -1131,10 +1131,7 @@ static struct nd_region *nd_region_create(struct nvdimm_bus *nvdimm_bus, nd_region->ndr_size = resource_size(ndr_desc->res); nd_region->ndr_start = ndr_desc->res->start; nd_region->align = default_align(nd_region); - if (ndr_desc->flush) - nd_region->flush = ndr_desc->flush; - else - nd_region->flush = NULL; + nd_region->flush = ndr_desc->flush; nd_device_register(dev); -- 1.8.3