Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5753537rwb; Wed, 7 Sep 2022 07:33:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR6KEazhGVFwCEYe230FIPmdwFLtqI6rrEHQbmfrmaRwBTsYtYFxMTdhZbqHPtAo8hnE2sAD X-Received: by 2002:a63:560a:0:b0:42a:7b1d:4e08 with SMTP id k10-20020a63560a000000b0042a7b1d4e08mr3716604pgb.594.1662561183208; Wed, 07 Sep 2022 07:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662561183; cv=none; d=google.com; s=arc-20160816; b=UdQp0LP4OzwLnarceTVEgmLFNzmF9qXU73eMeQSIgMGr9T+jOxMRWGLo00D/LaK+1c yXMaf+/s67iRiK3z0+ipYCWYZuVE3hSf2xSDgeIGCTQldN13Vgw2MoSU2C/b/VKyJp27 NUySz0FexntQ2+rnnt43/bvz1jPVGK4m1FJDz9hiaZxtA74komWdnxpUeoIhyMdGIQMr cYl17UqiMbJ/OpQCIl+0Y4U32lWU9qpF+C8FkUTkxYFQy1qorVRG2uhMUrMhqpNt0Do7 IEW0zwcAekCyW0DhnZPv0/vmshzPSjgUp08Lc7zaAc8BLgtrjKhrgm7tTgKCqeQSdwMK 33yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :feedback-id:dkim-signature:dkim-signature; bh=x8FEmyd46Ech5SbUlxrK+zLn7yS/pATtQbRStypEsQk=; b=lxNmuLqYd1zmsMuUjAJBubO316NsKwjBouwTrB1FHb/FEWjJUFR1WwTFzIkhyKob1v Jxci3eK7g4poU0i280u8sixLGlnfCQYe5KRixmT7G+fpGw+03qLNum8dTHWeEgkrVWHx 4yV2smzsVITE3Syjs97ir5QXr7rPyzqO0Eeztoz+iAgCNmZHXs2SAvkrAq2Oq9EWUMXo Lzt3tX6iWztoOjWZqw/EXOrbc0IHPVhjoP/b6B/uXWmZx0ZbaPyVCS63AcbgVeoNAmty 9CBdisxzgi35C3hjtR6vSTyr90kem5J88JKWPzcwUoQGYLdubHEAhNVTJWNz+DyAkkAF SMJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=R98+L5TR; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Z1Oz5b5i; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020a056a00190700b0052da2ea956csi14038740pfi.371.2022.09.07.07.32.50; Wed, 07 Sep 2022 07:33:03 -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=@arndb.de header.s=fm1 header.b=R98+L5TR; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Z1Oz5b5i; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229669AbiIGNsR (ORCPT + 99 others); Wed, 7 Sep 2022 09:48:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229655AbiIGNsP (ORCPT ); Wed, 7 Sep 2022 09:48:15 -0400 Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 256A2B48C; Wed, 7 Sep 2022 06:48:14 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id A507B580392; Wed, 7 Sep 2022 09:48:11 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute3.internal (MEProxy); Wed, 07 Sep 2022 09:48:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1662558491; x= 1662562091; bh=x8FEmyd46Ech5SbUlxrK+zLn7yS/pATtQbRStypEsQk=; b=R 98+L5TR/6KxWm9Rz3/V2adnKa0kBcUdCYyi8h7CcO3sM2Z057GdgQ5FU5v2B7n6/ Dw003SC1kdbbbzv9O5IAQsJRyHXXo5T432pCE+Rl05dk7UJLo9nQwKn4csyxyJ4N uX7EzPHwsH9lvB2zdu5o1PUMg6bwv2oJNZTpiLCS4EOkHsN23hOMXUiWYkf/wHYA SzkuM/o78nIBG7VMY27LVTufzB8KvclMHDzKt0by8FvrMf15fOpVGd+WTQIsAwHe Gy8ygWPsnnln6veJ3EWCxP+VbwZkBuzUKY7XrOMz9dtML4htjEgA0kUEVUV9HO+k x+ws+j/JVJGDfdkEt5eXA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1662558491; x= 1662562091; bh=x8FEmyd46Ech5SbUlxrK+zLn7yS/pATtQbRStypEsQk=; b=Z 1Oz5b5imBIqKK8mQc+QM2nx6VJZBc+1wP36WSriFxKeRKlBDK/+rce9sjnb9ZNLp o9XUK2YDCPfGkV8QWHsf80IpaTvY3ygbGK1lM8lHUkSYqtKPA/OGxWWIhdhK1GCG f/Y99HUH5anBPFdlovtHZ40m+N6tBvJj9zIXUM0T/CIsIiyPXtHCVYzZl/m3ehUT EzpWVzz4145kDKjyZtdM34BSmT0VBr30BP8GnZ+pqd0oaPVX0gaHeBtr6Bi4W0L/ 6KSW3Pq6dbKmgx9+DsOunxftgk6oarQIGhYeCTG4OS5YIg7uWBbfVxFNx3M/4s0V yDVYK4PPi/a25+VqpYBOQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedttddgieekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpeelfefgueeviefgudduueefueffkeelleeijeelkefgudfgueelledtuddu ieegvdenucffohhmrghinhepghhouggsohhlthdrohhrghenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 0E14FB60083; Wed, 7 Sep 2022 09:48:09 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-927-gf4c98c8499-fm-20220826.002-gf4c98c84 Mime-Version: 1.0 Message-Id: In-Reply-To: References: <20220906104805.23211-1-jslaby@suse.cz> <4e9b4471-a6f2-4b16-d830-67d253ae4e6a@linux.intel.com> <715b40ba-1bcc-4582-bed1-ef41126c7b94@www.fastmail.com> Date: Wed, 07 Sep 2022 15:47:37 +0200 From: "Arnd Bergmann" To: =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , "Greg Kroah-Hartman" Cc: "Jiri Slaby" , "Johan Hovold" , linux-serial , LKML , "Tobias Klauser" , "Richard Genoud" , "Nicolas Ferre" , "Alexandre Belloni" , "Claudiu Beznea" , "Vladimir Zapolskiy" , "Liviu Dudau" , "Sudeep Holla" , "Lorenzo Pieralisi" , "Shawn Guo" , "Sascha Hauer" , "Pengutronix Kernel Team" , "Fabio Estevam" , "NXP Linux Team" , =?UTF-8?Q?Andreas_F=C3=A4rber?= , "Manivannan Sadhasivam" , "Russell King" , "Florian Fainelli" , bcm-kernel-feedback-list@broadcom.com, =?UTF-8?Q?Pali_Roh=C3=A1r?= , "Kevin Cernekee" , "Palmer Dabbelt" , "Paul Walmsley" , "Orson Zhai" , "Baolin Wang" , "Chunyan Zhang" , "Patrice Chotard" , linux-riscv@lists.infradead.org Subject: Re: [PATCH v3 0/4] tty: TX helpers Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, 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 Wed, Sep 7, 2022, at 2:56 PM, Ilpo J=C3=A4rvinen wrote: > On Wed, 7 Sep 2022, Greg Kroah-Hartman wrote: >> Ok, no, I don't understand what Arnd meant here then :( > > I think he did just 2 things (compared with 2/4 of this series): > > - __DEFINE_UART_PORT_TX_HELPER() doesn't create a function but just wr= aps=20 > the macro body with ({ }). Therefore, a driver must use it inside=20 > a function rather than the macro creating a new function with name. > - Use lowercase instead of uppercase (this is a trivial change) > > When a driver is using these "function" that are just made look functi= ons=20 > but are macros for real, it will not add function-pointer-indirection-= call=20 > per character but pulls the whole loop from the macro into the functio= n=20 > in the driver and injects those putchar, etc. directly into that loop.=20 > ...It is just like read_poll_timeout() constructs the loop. Right, the example I was thinking of was wait_event(), which is another common macro that takes expressions as arguments but gets used like a function call. Same thing really. Note that even with an always_inline function that takes a function pointer argument, anything from gcc-4.7 up has no=20 problem inlining through that, so it should not be any less efficient though it might not help readability either. See https://godbolt.org/z/o8GGG8TzM for an example of that. Arnd