Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1975361rwo; Thu, 3 Aug 2023 02:53:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlE/YKDErloFFSQ+ApOjoE5d6f8PObVlfuRHTTmTQQk995lMKcAuAUgU6iWxzKhmr3pxAQYn X-Received: by 2002:a37:ac0f:0:b0:767:3fb8:12dd with SMTP id e15-20020a37ac0f000000b007673fb812ddmr16480415qkm.38.1691056436400; Thu, 03 Aug 2023 02:53:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691056436; cv=none; d=google.com; s=arc-20160816; b=j/PUg2bJAurrK0kxakKiyqn/7h8y+XCFqsF22zmtokT0n80InKFFZJ8UymMCxw2D2q +TjnTsDhWssp60+2kIXnuGYUBvZGB7zQUMf/WWRo8Ke7X4iiXqy76eSZkipDna9GNOUy 0H5NxfeT2sbdZPzuQRFoL9omaUgHjM+enxOhEH8eODDUA0jJ8Pz4JnG+wuuxXABMiIEf Jl4nhUNDvTI07m632BTtOsrVOj6jnZQaBpwEcX47JgzXwdRbMiwN2LY+a8MqiJgIziP2 kEM6aiRgR33KDL0tO38sYkJp+ctHW4PR5G8uw5K5QZosVXnz+a4ZMrRVkQrINpwa5HA7 PoDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=/z/4s5dyaSjuAqiaUCYg3Ho7Tq3br7LpD9dTiNzdsyU=; fh=nzjLerhcGV9/yfz5lOFXJvGF3j5XyAPzNkrOEPwhxbE=; b=GvDl7m9MGwNj0PjIWBo67sMTmF0SV/YExspelFqNdQilACckz6Qyq88oSbXXGjLeIv UNMbKHrt3yyiBKv6SxoWAZ0fIhi0oSuv7OY7CJyddWe01OfJp7qgcQ6b2Anp3xk5VdDZ CsxhDzGuMSMOxuAHpJcmgq1V7szKROWT1TZvrdcf99zTNe/Reh4KgcpMpfpkY22l9vr0 cq9QJpxUvUStSqRVD6iKX1s/GypDbcoAGyhl8vzpxsVOjdfAYlAb1HV4JDLXR0XXgltU 8Fx0nFG0x0rlvCxdiMOlq+GATyu2gIsS/LKLqgoRDyyQ/C/o+zAY/6N6nVN8OCePR9CU 0HLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=hTpTJSzM; 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=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bt17-20020a17090af01100b0025ea4dd9071si2697729pjb.61.2023.08.03.02.53.43; Thu, 03 Aug 2023 02:53:56 -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=@gmx.de header.s=s31663417 header.b=hTpTJSzM; 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=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232546AbjHCIRR (ORCPT + 99 others); Thu, 3 Aug 2023 04:17:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231766AbjHCIQg (ORCPT ); Thu, 3 Aug 2023 04:16:36 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97F53273E; Thu, 3 Aug 2023 01:10:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691050245; x=1691655045; i=deller@gmx.de; bh=dfiBLyzpVYXFy3yK9Npb4p0ssJPM4Ud7kOOxIWKf0lc=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=hTpTJSzMRHrE8odnN1cBnRxduE6UIe38TX5C5DZ1ZLoPGPJCEbjvwqyflDXFoPDeS2K0VWZ SoJ1xHQ6K24uw0rj/LpHTNdmsT4bNnJq9rjKH93aaRdnWXeQHMgDesePXzZQHFc/nesvBsLlv 1sjzMeVsytP8yOXV+ZDWbHLcDXvBe+4FKSZYAucAnel35/K6YhdMJm5Q0Y9N7n5t5+FZ7WXbf sjaA2ayFAXgx1GggdTJiplaeKtWzG7qtDrQVZGVevS7nrf3Wq151lAnsVo6fIJNq4ZtNpm3JT QmyaLh7NVrxOmzn6q9x4TOsLfkdkyI3FxD8lUaYAHk838lwBrtcg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.20.60] ([94.134.147.53]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MC30P-1qYsLg3AXV-00COKo; Thu, 03 Aug 2023 10:10:45 +0200 Message-ID: Date: Thu, 3 Aug 2023 10:10:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 1/2] parport: gsc: remove DMA leftover code Content-Language: en-US To: Arnd Bergmann , "James E.J. Bottomley" , Sudip Mukherjee Cc: Arnd Bergmann , linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230726150944.2265044-1-arnd@kernel.org> From: Helge Deller In-Reply-To: <20230726150944.2265044-1-arnd@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:m7Yr6Wb3MSwoyc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sUFPg//a+JgW+2+f/DIKaC5+8RsV1+BwJ3VMQcnaQV+80SlXtzkH72HqctRa5bCFNGO V+kzxJF1nO5PkyJJZQYGvVX2f0s0HhpeuQRGSOq19WnEi2EEZ5Ynuj5ezoRjKeQyRdQ0cc23S EDIuE0kEn7oMswKQMDS6q5wCkQ8= X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,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 On 7/26/23 17:09, Arnd Bergmann wrote: > From: Arnd Bergmann > > This driver does not actually work with DMA mode, but still tries > to call ISA DMA interface functions that are stubbed out on > parisc, resulting in a W=3D1 build warning: > > drivers/parport/parport_gsc.c: In function 'parport_remove_chip': > drivers/parport/parport_gsc.c:389:20: warning: suggest braces around emp= ty body in an 'if' statement [-Wempty-body] > 389 | free_dma(p->dma); > > Remove the corresponding code as a prerequisite for turning on -Wempty-b= ody > by default in all kernels. > > Signed-off-by: Arnd Bergmann Thanks Arnd! I've added it to the parisc for-next git tree. Helge > --- > drivers/parport/parport_gsc.c | 28 ++++------------------------ > drivers/parport/parport_gsc.h | 7 ------- > 2 files changed, 4 insertions(+), 31 deletions(-) > > diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc= .c > index 0dcc497b0449a..5e4475254bd0a 100644 > --- a/drivers/parport/parport_gsc.c > +++ b/drivers/parport/parport_gsc.c > @@ -28,7 +28,6 @@ > #include > > #include > -#include > #include > #include > > @@ -226,9 +225,9 @@ static int parport_PS2_supported(struct parport *pb) > > /* --- Initialisation code -------------------------------- */ > > -struct parport *parport_gsc_probe_port(unsigned long base, > +static struct parport *parport_gsc_probe_port(unsigned long base, > unsigned long base_hi, int irq, > - int dma, struct parisc_device *padev) > + struct parisc_device *padev) > { > struct parport_gsc_private *priv; > struct parport_operations *ops; > @@ -250,12 +249,9 @@ struct parport *parport_gsc_probe_port(unsigned lon= g base, > } > priv->ctr =3D 0xc; > priv->ctr_writable =3D 0xff; > - priv->dma_buf =3D NULL; > - priv->dma_handle =3D 0; > p->base =3D base; > p->base_hi =3D base_hi; > p->irq =3D irq; > - p->dma =3D dma; > p->modes =3D PARPORT_MODE_PCSPP | PARPORT_MODE_SAFEININT; > p->ops =3D ops; > p->private_data =3D priv; > @@ -286,17 +282,9 @@ struct parport *parport_gsc_probe_port(unsigned lon= g base, > if (p->irq =3D=3D PARPORT_IRQ_AUTO) { > p->irq =3D PARPORT_IRQ_NONE; > } > - if (p->irq !=3D PARPORT_IRQ_NONE) { > + if (p->irq !=3D PARPORT_IRQ_NONE) > pr_cont(", irq %d", p->irq); > > - if (p->dma =3D=3D PARPORT_DMA_AUTO) { > - p->dma =3D PARPORT_DMA_NONE; > - } > - } > - if (p->dma =3D=3D PARPORT_DMA_AUTO) /* To use DMA, giving the irq > - is mandatory (see above) */ > - p->dma =3D PARPORT_DMA_NONE; > - > pr_cont(" ["); > #define printmode(x) \ > do { \ > @@ -321,7 +309,6 @@ do { \ > pr_warn("%s: irq %d in use, resorting to polled operation\n", > p->name, p->irq); > p->irq =3D PARPORT_IRQ_NONE; > - p->dma =3D PARPORT_DMA_NONE; > } > } > > @@ -369,8 +356,7 @@ static int __init parport_init_chip(struct parisc_de= vice *dev) > pr_info("%s: enhanced parport-modes not supported\n", __func__); > } > > - p =3D parport_gsc_probe_port(port, 0, dev->irq, > - /* PARPORT_IRQ_NONE */ PARPORT_DMA_NONE, dev); > + p =3D parport_gsc_probe_port(port, 0, dev->irq, dev); > if (p) > parport_count++; > dev_set_drvdata(&dev->dev, p); > @@ -382,16 +368,10 @@ static void __exit parport_remove_chip(struct pari= sc_device *dev) > { > struct parport *p =3D dev_get_drvdata(&dev->dev); > if (p) { > - struct parport_gsc_private *priv =3D p->private_data; > struct parport_operations *ops =3D p->ops; > parport_remove_port(p); > - if (p->dma !=3D PARPORT_DMA_NONE) > - free_dma(p->dma); > if (p->irq !=3D PARPORT_IRQ_NONE) > free_irq(p->irq, p); > - if (priv->dma_buf) > - dma_free_coherent(&priv->dev->dev, PAGE_SIZE, > - priv->dma_buf, priv->dma_handle); > kfree (p->private_data); > parport_put_port(p); > kfree (ops); /* hope no-one cached it */ > diff --git a/drivers/parport/parport_gsc.h b/drivers/parport/parport_gsc= .h > index 9301217edf12c..d447a568c2570 100644 > --- a/drivers/parport/parport_gsc.h > +++ b/drivers/parport/parport_gsc.h > @@ -63,8 +63,6 @@ struct parport_gsc_private { > int writeIntrThreshold; > > /* buffer suitable for DMA, if DMA enabled */ > - char *dma_buf; > - dma_addr_t dma_handle; > struct pci_dev *dev; > }; > > @@ -199,9 +197,4 @@ extern void parport_gsc_inc_use_count(void); > > extern void parport_gsc_dec_use_count(void); > > -extern struct parport *parport_gsc_probe_port(unsigned long base, > - unsigned long base_hi, > - int irq, int dma, > - struct parisc_device *padev); > - > #endif /* __DRIVERS_PARPORT_PARPORT_GSC_H */