Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp323657rwb; Tue, 4 Oct 2022 04:43:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4hseYgD+snEdmpbRYz0Gf6aLlYHURAQcHzBeq5wpubi0H8t0lXMZy/vtpMt+9UgzaJlI2f X-Received: by 2002:a50:9344:0:b0:448:ce76:7c81 with SMTP id n4-20020a509344000000b00448ce767c81mr23402556eda.187.1664883837173; Tue, 04 Oct 2022 04:43:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664883837; cv=none; d=google.com; s=arc-20160816; b=MK3dPpjwmLGtle09ehgzwckHYhXnXR7ZikziVfrD95DgvkorSiHiaIdYddBLZ9mWAA fxTnmoKPfhiUVbK6j9h+q8B8t21UQZZDAfJUgdjI/5Zk51FuWb6IKevUdoIzefdfC7yU e7ess/lCQzBRlLemG2wwqTLpJ9TGMzjdX4nJ8nwmbExSAgTZV8W9ox2FoL4P6EhFgXPN uCnYfYW2Ol07miSK4daHLiv1CmmKVWDzBdWvuuithtfeAJJ2jQ0JR5Ycp5vNGeXHzHk8 Zk+VPU07kkM0kSYAtMLI+KSR8LNdTnjIWKmndYDoY3H0/TAhVjlK0+TINeh4QIKUIXmC 2/dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=Rxicy40jgLKhaLWBacQKzgfQbsstDStskTfrCAwrogM=; b=OMOATk3r40FRTZ6t8rYrNKb5xqLYCgkuGz8KXUW+JWPcmcGXzilRVfXgnabQmFcNcd CiXntvw1svHxdPtvOauKp9vNZq8Pz0Cmr05jgs0gDieEoj+tpg721VdtwtTwb3K+3LWa MTv9ex2WBxWMy9cn1U2mcypHh7wY+Y6jkDM9z39ScuMSR8xe65m32fYeomfhk+XKKZdQ NCtdt8Ocm7m2aALzXS5bLn9Dcs6S101ckTK1w9lFpnq09cEjqf8WijuAZJMnp+yAXGTp vmAPgY8MO3jJQ7aCf8ZhyyDYjRycBG5lEu8Q3eSw4p5EgWxdQlzIO2oO3MrQxRJmWGD/ 43vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=bIUzx4It; 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 f18-20020a056402355200b00457e9f88b90si11823999edd.246.2022.10.04.04.43.32; Tue, 04 Oct 2022 04:43:57 -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=bIUzx4It; 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 S229641AbiJDLKi (ORCPT + 99 others); Tue, 4 Oct 2022 07:10:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229810AbiJDLKG (ORCPT ); Tue, 4 Oct 2022 07:10:06 -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 D784B13CDA; Tue, 4 Oct 2022 04:10:02 -0700 (PDT) Received: from [192.168.10.9] (unknown [39.45.148.204]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 89FA1660225F; Tue, 4 Oct 2022 12:09:59 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1664881800; bh=AvdV9cCb9MyFUjPM+yXgi5qVq0iERQTeijLa2X2YNUE=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=bIUzx4Itf+luuKI3l69mI+QwJDdTse1Gehqbh9UIsH/HbZ93+iBxy7q+u8MxqkfYg Bnrlp8tZs5nplFmwrrv6/51r6ujXdW8lAiJuXBVHI40hFK901o+vZxDwKR+JMWNFmT bQFk4PUlGAR1uqV4w4b4C/BLCyl2tYU8l1ub2tK0I1Zu/L3TnGjY9H9V7CCeZeVKQI cgf0GZPJm+1gqNMmRvkO097YhplUpOx7IC0z9EfwLDbm0Qu3qGl9/6mKJuImoa/hWe pIKNm0a4QhoGnPKS7yCZ60KNXXUwEq86RP6j8bruZDPOhNBNQrqwiUM/e3886T0SGZ wiQLqqBtC8Zjw== Message-ID: <01ae2244-99cd-e96d-1bb7-6082da017cc8@collabora.com> Date: Tue, 4 Oct 2022 16:09:55 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Cc: usama.anjum@collabora.com, kernel@collabora.com, kernel-janitors@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] spi: Remove the dead code Content-Language: en-US To: Mark Brown References: <20221004055620.371732-1-usama.anjum@collabora.com> From: Muhammad Usama Anjum In-Reply-To: <20221004055620.371732-1-usama.anjum@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 Please disregard this patch. This is wrong and not needed. On 10/4/22 10:56 AM, Muhammad Usama Anjum wrote: > 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; -- Muhammad Usama Anjum