Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1767400rwn; Fri, 9 Sep 2022 03:55:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR6sCjq+/s3w1vDRk/ZGATzarbJYjxCR7Hmw/A5DlneiO5xbm0pocLw0eAt+mMhPQW2B5H8c X-Received: by 2002:a05:6402:3596:b0:450:c4d9:a04b with SMTP id y22-20020a056402359600b00450c4d9a04bmr5762416edc.218.1662720907588; Fri, 09 Sep 2022 03:55:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662720907; cv=none; d=google.com; s=arc-20160816; b=z3sVQNvjrSF9X1sA7XgvfLB2ooBIufzsOydDVVDUuBfK4T6K7Tj37+Rmdrs+WH0cZ/ m70xg7pKHQvwKMl2oM9MGu3NVVb02Pq0Cy0v0ZP7eXeSk43h/Wq78dIQ9XlSo3s4ggs0 p2DTa1xcBxydhfC72H6oQRXmJatXV60/R1xO/iwO8fHycjsYAWQMhj5kX1Pa7ut7192F denQvNAHzPyuChD/RYwdAd6m3q1I8WWYg7Xq8AKis3N76EaRt9gqkl0ZfDHaxFjRsGWR OR1fv+OSGcCUrfRW0LtmPvwx3xo/afEM2/yejDXhdlDJz43F+BN5HJB8ZXInTNoRqelw tZ+Q== 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:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=GagilPxqP4vgEIRQpipTIIkrScgT2/c3h/h3daNSK+w=; b=XZLqr7HMeWT3pGxdAkzV8TeWsY4mhnSi/jl0c2hw4ALOI3EAHS6vOJYpZ2IhAWUl07 yb9azRS05HJm4TGCAZT9A47eOGg1pW9Iv9/iqT2lXe/8fadyA1PjYsmYkVp34MLIrGse Lm5AA/VtrGI0at0pVWf5xzJ4bwURvr0MfbPesCdqqsCBq78DKqUy0QdGnGi0vUdtMv28 YWNL2Mpim3ojsUGLjxYoy1bimpfGS1SBy//uMhAA9s5AuizgrLnFKO6wDnxU1LahxzGE Y52JY+GB6nBfIOQnmGPEegqAqSed1RWpJaf5UakxGCcBki3tziNiGaEVX6gxYi/7+OLL Z9Mw== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds19-20020a170907725300b0073beb963ce6si187059ejc.345.2022.09.09.03.54.41; Fri, 09 Sep 2022 03:55:07 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230287AbiIIKxM (ORCPT + 99 others); Fri, 9 Sep 2022 06:53:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230107AbiIIKxJ (ORCPT ); Fri, 9 Sep 2022 06:53:09 -0400 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C75012F235; Fri, 9 Sep 2022 03:53:08 -0700 (PDT) Received: by mail-ej1-f41.google.com with SMTP id lz22so3093719ejb.3; Fri, 09 Sep 2022 03:53:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=GagilPxqP4vgEIRQpipTIIkrScgT2/c3h/h3daNSK+w=; b=Q+nXwv1ofMvlO4HRJfePVdasS2nsqZ3vXuuwdjKqBoeyzuO/sIGo4yd+dWJHJfIq/8 N3C+PhRVxfmF6XA+kR6mwUOEFqUPTU2Ow3dgNP1j0kSElDzg++7nOt/0OiImCtlfoBup Gyr5vz8b7xkUX3heQMMrmNYwdDjy23ODEAHBhNZnW343dEkgSFmycI+8JUU7PAGNMbne o0glebGEmXRVRtC5pqCtC/079hMne6kvKeP+//PPXes+cWveajfiDDTfmlolCGYmfow0 k26SSbki3Aohk7VoyRWEIG77MK4nvS3Qgj3p1viPLeF4BMl/k0OauH8N/TQ5nQ2UYSXo qJwA== X-Gm-Message-State: ACgBeo2LFJusDK8BvoiQIpiux00/Mqu0O6JC1p1htHvLwHKGEHlkmoIB gerJM8ScVxJ79ADcLb2eRCo= X-Received: by 2002:a17:907:75f5:b0:77a:7a93:feb4 with SMTP id jz21-20020a17090775f500b0077a7a93feb4mr103503ejc.582.1662720787030; Fri, 09 Sep 2022 03:53:07 -0700 (PDT) Received: from ?IPV6:2a0b:e7c0:0:107::70f? ([2a0b:e7c0:0:107::70f]) by smtp.gmail.com with ESMTPSA id ky21-20020a170907779500b007707e4d1835sm138549ejc.10.2022.09.09.03.53.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Sep 2022 03:53:06 -0700 (PDT) Message-ID: <5feff23c-9458-616c-66ce-13cca5829162@kernel.org> Date: Fri, 9 Sep 2022 12:53:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH v3 0/4] tty: TX helpers Content-Language: en-US To: Arnd Bergmann , Russell King , Greg Kroah-Hartman Cc: =?UTF-8?Q?Ilpo_J=c3=a4rvinen?= , 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 , 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 References: <20220906104805.23211-1-jslaby@suse.cz> <4e9b4471-a6f2-4b16-d830-67d253ae4e6a@linux.intel.com> <715b40ba-1bcc-4582-bed1-ef41126c7b94@www.fastmail.com> <2197faa3-0217-41e0-8ff0-b5396561c623@www.fastmail.com> From: Jiri Slaby In-Reply-To: <2197faa3-0217-41e0-8ff0-b5396561c623@www.fastmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 07. 09. 22, 16:56, Arnd Bergmann wrote: > On Wed, Sep 7, 2022, at 3:52 PM, Russell King (Oracle) wrote: >> On Wed, Sep 07, 2022 at 02:36:37PM +0200, Greg Kroah-Hartman wrote: >> >> Of course, it would have been nicer to see the definition of this >> macro, because then we can understand what the "ch" argument is to >> this macro, and how that relates to the macro argument that is >> shown in the example as a writel(). > > I pulled out the 'ch' variable from the macro to avoid having > the macro define local variables that are then passed to the > inner expressions. Note that I had "port" and "ch" as a part of the macro parameters in [v2], but it didn't help the situation much. >> Maybe a more complete example would help clear up the confusion? >> Arnd? > > Here is a patch on top of the series that would implement the > uart_port_tx_helper_limited() and uart_port_tx_helper() > macros that can be used directly from drivers in place of defining > local functions, with the (alphabetically) first two drivers > converted to that. If there are no objections, I will push the patches this directorin. I like this more than [v2] or [v3] (the helper macros). Actually, I mentioned this wait_event() style in [v1], but I perhaps simplified the concept too much to completely eliminate the need of a wrapper function. And that made it too complicated/too hard to understand. Except I'd drop the "_helper" part from the name. Originally (in [v1]), I had uart_port_tx() and uart_port_tx_limited() functions. In [v2+v3], I added _helper to avoid confusion as we were generating a helpers using the macros. Yes, technically, uart_port_tx() is still a helper, but I think it's superfluous to have it in the name now. thanks, -- js suse labs