Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3308357pxb; Sun, 20 Feb 2022 15:57:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJxA9PIcrfg5pYjhS4dMwIfV7IBW20HTZTJXUu+BaVwpsASQIBtHmkvVhQgJcn7VXzL4HZy3 X-Received: by 2002:a17:906:27db:b0:6cb:1f45:40fd with SMTP id k27-20020a17090627db00b006cb1f4540fdmr13779556ejc.605.1645401478613; Sun, 20 Feb 2022 15:57:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645401478; cv=none; d=google.com; s=arc-20160816; b=Wv5ijvrqj7/2Qt7rkhaWvl5XmYNkPmVvQahj89t7jeNv4DmHQHHPx1lhqmkGr8j8iE E18pN26bqjJ3JNEIHgo48rhaZX36D3axBa/a42Ceb/b0ZVzhMBPjWx/orsFi50yJCiFh lqzTziT9vwx+7iVz+2EDG4cJteKzAVMXl7XRRui0+U0vV3AZr4q/dgkfY+eKNq25Abme Z9aBuOXWVpEeJMH215HjEPeRFkq2IwG0IfORZlF8y3cFL0a1YluzN7BtjIGT3e1Ur6Yz 0QZt5lFX0iyy7PhJGVqOAp2JL/SwADzQKLtBC6/gOjeo154eUSQrpF+VkwhJ4S/Sx0np UCog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QPxVOPedb7VSlKJrNqeXgyqzEIVCKAODI2AGkqq7jh0=; b=AihHYFTLsxQooKPWtGyPNQdyKeGMawAHvdtsvj8aEHs/vcDIcZuHWdqFrSqwU3pgfi 027yLHb53Pv4/IZnFjBzqG+9xhIkpqLj+vrwGRDL08ONKBJbJ/MN0PsCZp/1vL+G5cK4 sZ+SMDgy/3slSk+F0Sr6zTfXCE3H6ufpHhB1N3PYbJJVFcT8w7zEEmhB9FtwlzOtMKqc 5JilNCww3DIVGVL6o1RjvrreZ6VAcyj1awcDWNC9j6ImBW4r4thp1yFX1bSE6/w3HuXo HPrhK6AgGB4ba7B/qZhBaxy/oC5gaCMrpyP0vJfgkG20fFp/pg78utMLj3/ZtdKSnPKT DtPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YGrymPtM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z28si10137626edm.453.2022.02.20.15.57.36; Sun, 20 Feb 2022 15:57:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YGrymPtM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244227AbiBTPQy (ORCPT + 99 others); Sun, 20 Feb 2022 10:16:54 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:50726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244143AbiBTPQY (ORCPT ); Sun, 20 Feb 2022 10:16:24 -0500 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 255AB34BA8 for ; Sun, 20 Feb 2022 07:16:03 -0800 (PST) Received: by mail-wr1-x430.google.com with SMTP id p9so22805088wra.12 for ; Sun, 20 Feb 2022 07:16:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QPxVOPedb7VSlKJrNqeXgyqzEIVCKAODI2AGkqq7jh0=; b=YGrymPtMsXeZaHEpHtmPZMlg3m+LYLl71bOPVMnvF/ikOOpY1R326ccQHH77Tz7CwM 66tLMVK0kGZudM/UgNRSMDqPnFKGlzlniu05V0P8tl39/xzGON45pSrOPxSOI4BpCgsZ 762VoLHvjM6+3HAPk0s84HgAZd1DjSMiG+t14TpvvkeuYgkBmjQG3wQqLRXg9pW0//o/ 3Lvakym+02l3Uuk0jwiSVjJKzj79hs2w9l+ZLy7JJXufxDFMgvs6EwPjysvzTww88L9F VUPiQN9uuBpRQkDBWdxqII9HTBtxPDWjISMr/4l6qfwI/ebblm0PpIMcvhmIb1gcmfHy i27g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QPxVOPedb7VSlKJrNqeXgyqzEIVCKAODI2AGkqq7jh0=; b=qoXHljor20ZjQ5svblFNYJ2Lt8S1VlDMKNGT0a7hBc3M4aOFIHccLuhg7/pIq6KY/U lnyohKbdm3X6k+19PWfLfxqtuVqPfKjREpVzmpyKZHEBvEzpCXeG6k9p4gKdW2Mr8cBB P92ag7PENdpSsPtFhJDQWfa+uUw8F1vEXpX8kGgB+npu9EaAQcFdMzoZbt1eMaAe7euV THejBczV43g6SoyC5tFS6Mgoo4Z8BP82VloaAwKmFDL3uQrF7EHjxcBHpzPdDOavw/nW HfmbTqDfdCHxZfFsLTupsOH7+g7TsXGcceX8iVK+Lb4b3tmzgNW2TjsYd2qdtlq29f95 /y5w== X-Gm-Message-State: AOAM532b4Y/LR+Qa35QNkJPP9qHki+ydnqh8DU8LxLjov8djeRabNEFe YVZgXV8SoHXCaU50XC+NQXnJQA== X-Received: by 2002:adf:df0b:0:b0:1e4:979f:a56f with SMTP id y11-20020adfdf0b000000b001e4979fa56fmr12356206wrl.686.1645370161675; Sun, 20 Feb 2022 07:16:01 -0800 (PST) Received: from srini-hackbox.lan (cpc90716-aztw32-2-0-cust825.18-1.cable.virginm.net. [86.26.103.58]) by smtp.gmail.com with ESMTPSA id h7sm28687749wru.41.2022.02.20.07.16.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Feb 2022 07:16:01 -0800 (PST) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Andy Shevchenko , Mika Westerberg , Srinivas Kandagatla Subject: [PATCH 13/13] thunderbolt: Drop duplicate NULL checks around nvmem_unregister() Date: Sun, 20 Feb 2022 15:15:27 +0000 Message-Id: <20220220151527.17216-14-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20220220151527.17216-1-srinivas.kandagatla@linaro.org> References: <20220220151527.17216-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Shevchenko Since nvmem_unregister() checks for NULL, no need to repeat in the caller. Drop duplicate NULL checks. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Signed-off-by: Srinivas Kandagatla --- drivers/thunderbolt/nvm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thunderbolt/nvm.c b/drivers/thunderbolt/nvm.c index 3a5336913cca..b3f310389378 100644 --- a/drivers/thunderbolt/nvm.c +++ b/drivers/thunderbolt/nvm.c @@ -154,10 +154,8 @@ int tb_nvm_add_non_active(struct tb_nvm *nvm, size_t size, void tb_nvm_free(struct tb_nvm *nvm) { if (nvm) { - if (nvm->non_active) - nvmem_unregister(nvm->non_active); - if (nvm->active) - nvmem_unregister(nvm->active); + nvmem_unregister(nvm->non_active); + nvmem_unregister(nvm->active); vfree(nvm->buf); ida_simple_remove(&nvm_ida, nvm->id); } -- 2.21.0