Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp486470rdh; Thu, 26 Oct 2023 07:38:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3N8R7HrzocvsduHb5kYtYKEL2h6wsT0AecpHUR7SNx4+FKaRccFNGnnGPMQQnUCYu78VK X-Received: by 2002:a25:aa2e:0:b0:da0:4201:44ff with SMTP id s43-20020a25aa2e000000b00da0420144ffmr7480365ybi.36.1698331083124; Thu, 26 Oct 2023 07:38:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698331083; cv=none; d=google.com; s=arc-20160816; b=q+qTFGBXMNqBN10PKYuyFcfi9q1GdXJ3gzVos8UQTYw2gKU9yDnLpKauUk+Jk3ePot j28Jv5rlLUGwfu9EfoHzcGdgWrjYSka7TGoWQ3WhyiNuqZbrIbm7J24lr/vi1hkJm1cD 5Ollw067uM0mjHacJVTSQ/bOgSbX3Kfe2JhXLClkVcra0Jybrvu4goQOzfg9Ee1IIHF9 sZn0SXqzV/XvUK9g/oFGImWMxd8fvT2sPTFlg3n3leOJZGNBgeYszsQt/1Xkg0IxYK12 ajOtjUo9/aHEDmC4FcBP8tr6YhdJMdHZ2bAMyZFsBWUDM6an4sqO0TM4UY9zGuOqFkld 6wyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:message-id:subject:from :to:cc:date:content-transfer-encoding:mime-version:dkim-signature; bh=pzSuZl465f+Jw66lZVHayZUu0n4I8LWguWFqGsE/18w=; fh=WjUF1AzEpurM/OuBU9V9+iAy4oi7QMdSAJ5vUer31T0=; b=fn20PRizQbwcN92++Xf7t1iS8373PoYMn6zN/P2A5cBHTBOWui6HqTI8Jn0jSinevj +VS1cZsVZoKma6dfabjo9po/IBDN4j0AIk4hG/neWlaiglKFU8MPjCMLFUDiA4qZvnr/ 7g8YvAw3h8dUeMnwRaboHd4wtxxaYNmpPjWKhN4GF7oMhIo8cpZM+htYhw7g9qaR4PMj Prd2Xaw09pyoUlXk02+XeGh5vfr3WG+4if/1mL6peR1/YHOTbs45zI3k8Z7zi2sPxLWG BpYU+muj+Wp4X1Kntro07Lzt3Crqje351+wrecfdXv7CGYEHO0fqG7OdSaeBjPj6O8VZ U2uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=DbDoxLgb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id 187-20020a2511c4000000b00da0cbb01ee5si249884ybr.657.2023.10.26.07.38.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 07:38:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=DbDoxLgb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 3916F837EA62; Thu, 26 Oct 2023 07:37:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345293AbjJZOhp (ORCPT + 99 others); Thu, 26 Oct 2023 10:37:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345180AbjJZOho (ORCPT ); Thu, 26 Oct 2023 10:37:44 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C4BB91; Thu, 26 Oct 2023 07:37:42 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 4EEF31BF212; Thu, 26 Oct 2023 14:37:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1698331060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pzSuZl465f+Jw66lZVHayZUu0n4I8LWguWFqGsE/18w=; b=DbDoxLgbqro29XdM0gY29MtYs4ooiF4qgT22KXvka2hhLiMVQ+xQ6ULB0R7LvOQ4hmZ3zs mxea+1SLXuVzs6Fa3+JaKb1QxexFrmfdQIoUg6Zdtg8vhTivKsxTLHdhdpcAAS3ojjzWbR IMkeLWrlLREm+bvTYa5dOnaaQ/oM2bvdQWMljFsAO7JlLXLoJZQoQ+SRyqkZJv22AR/A8y zhnTC+fN6abIHKo1BAO0m9II2/+RdiXwN2caWR7oTSkQsKEo3zqw7kHfyJ7lnbHF2Yh+4z uVeZFlY6ovF0wYb4gHEgUij/5/NQ1j8uEL8L0LWrNfmfJd/mq59yuVbqdq7UMg== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 26 Oct 2023 16:37:39 +0200 Cc: "Russell King" , "Greg Kroah-Hartman" , "Jiri Slaby" , , , "Linus Walleij" , "Gregory CLEMENT" , "Alexandre Belloni" , "Thomas Petazzoni" , "Vladimir Kondratiev" , "Tawfik Bayouk" To: "Hugo Villeneuve" From: =?utf-8?q?Th=C3=A9o_Lebrun?= Subject: Re: [PATCH 4/6] tty: serial: amba-pl011: replace TIOCMBIT macros by static functions Message-Id: X-Mailer: aerc 0.15.2 References: <20231026-mbly-uart-v1-0-9258eea297d3@bootlin.com> <20231026-mbly-uart-v1-4-9258eea297d3@bootlin.com> <20231026102424.81c0f7487df505d2ed92cf13@hugovil.com> In-Reply-To: <20231026102424.81c0f7487df505d2ed92cf13@hugovil.com> X-GND-Sasl: theo.lebrun@bootlin.com X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 26 Oct 2023 07:37:58 -0700 (PDT) Hello, On Thu Oct 26, 2023 at 4:24 PM CEST, Hugo Villeneuve wrote: > On Thu, 26 Oct 2023 12:41:21 +0200 > Th=C3=A9o Lebrun wrote: > > The driver uses two TIOCMBIT macros inside pl011_{get,set}_mctrl to > > simplify the logic. Those look scary to checkpatch because they contain > > ifs without do-while loops. > >=20 > > Avoid the macros by creating small equivalent static functions; that > > lets the compiler do its type checking & avoids checkpatch errors. > >=20 > > For the second instance __assign_bit is not usable because it deals wit= h > > unsigned long pointers whereas we have an unsigned int in > > pl011_set_mctrl. > >=20 > > Signed-off-by: Th=C3=A9o Lebrun > > --- > > drivers/tty/serial/amba-pl011.c | 46 +++++++++++++++++++++------------= -------- > > 1 file changed, 24 insertions(+), 22 deletions(-) > >=20 > > diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-= pl011.c > > index 0d53973374de..bb3082c4d35c 100644 > > --- a/drivers/tty/serial/amba-pl011.c > > +++ b/drivers/tty/serial/amba-pl011.c > > @@ -1087,7 +1087,6 @@ static void pl011_dma_rx_poll(struct timer_list *= t) > > */ > > if (jiffies_to_msecs(jiffies - dmarx->last_jiffies) > > > uap->dmarx.poll_timeout) { > > - > > This should go into a separate patch, or simply be merged with one > of your other coding style/whitespace cleanup patches. Indeed, added to "tty: serial: amba-pl011: cleanup driver". Thanks. Regards, -- Th=C3=A9o Lebrun, Bootlin Embedded Linux and Kernel engineering https://bootlin.com