Received: by 2002:a05:6504:5087:b0:1e5:d399:13c4 with SMTP id i7csp13305ltq; Mon, 3 Oct 2022 23:27:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4XXYODxsVTmdTifQ1tQOgtA1O/5XUBEZgZFVoxxp+2xvNqPYpDETfao/yhn4FHjzXHAAPN X-Received: by 2002:a17:902:da8f:b0:178:399b:89bb with SMTP id j15-20020a170902da8f00b00178399b89bbmr25938809plx.57.1664864859829; Mon, 03 Oct 2022 23:27:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664864859; cv=none; d=google.com; s=arc-20160816; b=LsqaZNsOYUsUw7VqRoZNpQwScIGnJLL7dyRXhSKzwzYFMDglhcXcGwlzeilJ2IoXVZ las27IrQsGEmyMMT0NbLE1t4I5Z4LA8Miopy9YvSZPxxd+WLUGBfC78ICs94Y8CEhD8p Kx5oTz7ZH+EbJi5NrY4weCQJxVJZ+i26wHbVcFRBX64JpxQLgfSxiKZTVVYhlHJ6lmzT rmqcepJdA0jdd3V4cNxNbWOQd9EBTN7s+9XhMGRf+GEtddhcUqGKsV/IhxIn7kCNtJyt EpVnB/7TUwzdbVvPt7oXC3ObxsHffpohCcCfDnGeCPM6uIi0ndfm+O3lSFMy3CIy4o6w m6gw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=KDh1B1B9hes50EYtgoXmOtymXaoH1NcORTkaaL6qEow=; b=GWrKzyFG8qMTsbUnLVVJfPI5xWS6k5pTRRCoFo+Jkmk7yC1wDTAl5PoxGNS6X/mqoJ yZ06vm9GxqDEwk4orHg8JS4I1FbSn57ljclOWANNyw+gUfTbkmeK2IbozyAXbRfRtJzU EEsxvBeTSZNsiD9H98K78z/Fgle31qO+Kqh1lxSRDXmenwdaAsMeVgUdsdoyR93KJZwV Ld0SenDHTChivR4KKZn3ESnwx9LX2gEDc7wracXpe401vLGin5igrA2pSPtkuMBlsgIT kQA3oyt09mmg+SXfmFeoRyu4GuaFs/TsYb+HgycdryNlEgoU5KTKwH5EqXULcpNSmxH0 fY8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="eXEp/RGD"; 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=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i186-20020a6387c3000000b0045131d08c18si3908453pge.244.2022.10.03.23.27.27; Mon, 03 Oct 2022 23:27:39 -0700 (PDT) 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=@collabora.com header.s=mail header.b="eXEp/RGD"; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229636AbiJDF4j (ORCPT + 99 others); Tue, 4 Oct 2022 01:56:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbiJDF4g (ORCPT ); Tue, 4 Oct 2022 01:56:36 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA3311F9EB; Mon, 3 Oct 2022 22:56:35 -0700 (PDT) Received: from lenovo.Home (unknown [39.45.148.204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madras.collabora.co.uk (Postfix) with ESMTPSA id B9C07660225F; Tue, 4 Oct 2022 06:56:32 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1664862994; bh=f5Z8WG3ZUTCNEZp4bLoVlduba3LPHIynOslY10NmbPU=; h=From:To:Cc:Subject:Date:From; b=eXEp/RGDrO4ptD0wWxshIrv2xLq+1oYDvfIkZsRSBI1JEUmZ/wKEcO8keYGq5tmt+ GAM23VjYdwMQIeRqoSY+rq74gyw+Abrh35s3iUxqU0gVNmbDt0OF7AegXFkjD35UgQ cStYjy5awtCqAKV2vDdpuArmzT/2ObvKgrsjwpZgMfoLdc1aEaYuRyP0DccXpg/BbE tahmBYKdlYMgXB2+dpIe+QMod7ca0CS3d4c/qh/4TEKLYt7N0wZPtwE2j+FYoD4cxY ah4rZvvSqsF//AtludgcK8R/Jbj8ygTZKFaVdzeDRKK1NXSUyCdzgSQz5dPw06c73X UGcpUVD8vIIkQ== From: Muhammad Usama Anjum To: Mark Brown Cc: Muhammad Usama Anjum , kernel@collabora.com, kernel-janitors@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] spi: Remove the dead code Date: Tue, 4 Oct 2022 10:56:20 +0500 Message-Id: <20221004055620.371732-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.30.2 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,SPF_HELO_NONE,SPF_PASS 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 The vmallocated_buf is being checked if it is true inside the body of a if condition which has already checked if it is true. Remove the duplication and dead code as a result. Signed-off-by: Muhammad Usama Anjum --- drivers/spi/spi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 44e4352d948b..4c51cd4e4ab0 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1057,10 +1057,7 @@ static int spi_map_buf_attrs(struct spi_controller *ctlr, struct device *dev, min = min_t(size_t, desc_len, min_t(size_t, len, PAGE_SIZE - offset_in_page(buf))); - if (vmalloced_buf) - vm_page = vmalloc_to_page(buf); - else - vm_page = kmap_to_page(buf); + vm_page = vmalloc_to_page(buf); if (!vm_page) { sg_free_table(sgt); return -ENOMEM; -- 2.30.2