Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3435583pxb; Mon, 4 Apr 2022 16:56:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygxMO3mESGCfhlfoPw8GIzaXRgLBc63vMpwXljot0Wz33Cocn0DrwkC1P8zfU+cXZEZxSr X-Received: by 2002:a63:d442:0:b0:382:6f4e:d49f with SMTP id i2-20020a63d442000000b003826f4ed49fmr548793pgj.7.1649116613207; Mon, 04 Apr 2022 16:56:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649116613; cv=none; d=google.com; s=arc-20160816; b=zFlIbbpOjgV9wrv0A6LwxdhX5TkwTIi8813mKAw/HK9rV5RG+yKG8aFv/J1xwO2ZiU GmlPOpm3f0xmVxIWrVwKm2jKtwidEA7OYxPh/Ert4iQUJ7bceSY2bQPJU2EQnx5KYAN/ 78E0DfRVsa1LdKBI3tIFETfue+l1Pb2tkp65PbHAG63rjXSnl9ZTgvobQWQt1g3JggA1 NLslexfu/WTfW52+KWXuzuYDNc2OsX7twTVHvnRLZD1uyZ3M2Urs3wQAZDeVJLg8MQFG pdS5UakCNUaPa6Je7rVqrNGsTqU7yNB9WSqcODLTDnnEjaYB39/bxqCJlTzJWoZ4FNhb z6UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=S9kyq3prUNE5HlsvNUnZDxnM3YNPjxnZKzbpLeHWtg4=; b=wucHFHVOKSEX/oE/uCCggMZBhDnDi91ije7bYRlsYljR2yryxbPMAM4yWTAFgHpu3t 1I6RoD7bNLNvoCs1wdgnaXGuJAXETjAa5gdkQBDQDXsas+yxRORbwHBBH1m/F4iJk0XI X+XUj4UJAVQXaKIeVJtbTy0uuWxrSPlXI4IY9Sarh0QbAx7ZtWiLMebJEt6CjJj1JQX0 0iwJgVxdYaHiQGKKfDcamBnydrDmvG0nbdVXPwR7wdB/sjtFil5LowhxkxwXVZOcfzLQ M84vAW3JtyI7ylzCizJsdRI6obpTVSLDhOd8bjefAn8yNxamo/ypz+r9ahoGC1HMjASd +GiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@roeck-us.net header.s=default header.b=c4M3VL07; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b13-20020a630c0d000000b003820b4f8361si11150546pgl.182.2022.04.04.16.56.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 16:56:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=fail header.i=@roeck-us.net header.s=default header.b=c4M3VL07; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EE43D62A07; Mon, 4 Apr 2022 16:37:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343700AbiDCPiG (ORCPT + 99 others); Sun, 3 Apr 2022 11:38:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232259AbiDCPiE (ORCPT ); Sun, 3 Apr 2022 11:38:04 -0400 Received: from gateway22.websitewelcome.com (gateway22.websitewelcome.com [192.185.46.224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51AB927163 for ; Sun, 3 Apr 2022 08:36:09 -0700 (PDT) Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway22.websitewelcome.com (Postfix) with ESMTP id C94DFCF73 for ; Sun, 3 Apr 2022 10:36:08 -0500 (CDT) Received: from 162-215-252-75.unifiedlayer.com ([208.91.199.152]) by cmsmtp with SMTP id b2Gunbu3j22u3b2GunkLeS; Sun, 03 Apr 2022 10:36:08 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=In-Reply-To:Content-Type:MIME-Version:References :Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding :Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=S9kyq3prUNE5HlsvNUnZDxnM3YNPjxnZKzbpLeHWtg4=; b=c4M3VL07wbRVvrKjSmkp3QOqSm adMlo6Kg9Lb2yNZPZmvLcKrDA80lw6W8IB3lcd3ZKvvVsDULx/j5jplAbY1fGHzIx1mdUt9gDNv/l DkfYW97FxsYWpgOi3BvWbWznBqOd8sZYr92Cnk3E31b7R4mXu9C+P5Ry32/pPRgjndrGoqiVcwNci FWCIlY0obiz+wrK9jriGBEv8KCeeLK1hC5g7RveJhCuwee7vpws0ZbSsepsVBgQEa11dhLKQVOsFa 5b6sqe/WGpbfGac+nFqETCb8y5TPdwIcXM7V6Y1DzbCt0gmprSJ9dkb9H5HwDNmdSJWo/8Una13nj 1L9MH6kQ==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:57822 helo=localhost) by bh-25.webhostbox.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nb2Gu-0041Pb-Cx; Sun, 03 Apr 2022 15:36:08 +0000 Date: Sun, 3 Apr 2022 08:36:07 -0700 From: Guenter Roeck To: Jiri Slaby Cc: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] tty: serial: mpc52xx_uart: make rx/tx hooks return unsigned Message-ID: <20220403153607.GA3644508@roeck-us.net> References: <20220224111028.20917-1-jslaby@suse.cz> <20220224111028.20917-2-jslaby@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220224111028.20917-2-jslaby@suse.cz> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-BWhitelist: no X-Source-IP: 108.223.40.66 X-Source-L: No X-Exim-ID: 1nb2Gu-0041Pb-Cx X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 108-223-40-66.lightspeed.sntcca.sbcglobal.net (localhost) [108.223.40.66]:57822 X-Source-Auth: guenter@roeck-us.net X-Email-Count: 1 X-Source-Cap: cm9lY2s7YWN0aXZzdG07YmgtMjUud2ViaG9zdGJveC5uZXQ= X-Local-Domain: yes X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Thu, Feb 24, 2022 at 12:10:24PM +0100, Jiri Slaby wrote: > All these return bitmasks, so it makes more sense to return unsigned -- > this is what a reader and also all the callers expect. > > Signed-off-by: Jiri Slaby With this patch in place: drivers/tty/serial/mpc52xx_uart.c:static unsigned int mpc52xx_psc_raw_tx_rdy(struct uart_port *port) drivers/tty/serial/mpc52xx_uart.c:static int mpc512x_psc_raw_tx_rdy(struct uart_port *port) ^^^ drivers/tty/serial/mpc52xx_uart.c:static int mpc5125_psc_raw_tx_rdy(struct uart_port *port) ^^^ Same for other functions. This results in lots of compile errors. Guenter > --- > drivers/tty/serial/mpc52xx_uart.c | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) > > diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c > index 2704dc988e4a..8a6958377764 100644 > --- a/drivers/tty/serial/mpc52xx_uart.c > +++ b/drivers/tty/serial/mpc52xx_uart.c > @@ -83,11 +83,11 @@ static irqreturn_t mpc5xxx_uart_process_int(struct uart_port *port); > > struct psc_ops { > void (*fifo_init)(struct uart_port *port); > - int (*raw_rx_rdy)(struct uart_port *port); > - int (*raw_tx_rdy)(struct uart_port *port); > - int (*rx_rdy)(struct uart_port *port); > - int (*tx_rdy)(struct uart_port *port); > - int (*tx_empty)(struct uart_port *port); > + unsigned int (*raw_rx_rdy)(struct uart_port *port); > + unsigned int (*raw_tx_rdy)(struct uart_port *port); > + unsigned int (*rx_rdy)(struct uart_port *port); > + unsigned int (*tx_rdy)(struct uart_port *port); > + unsigned int (*tx_empty)(struct uart_port *port); > void (*stop_rx)(struct uart_port *port); > void (*start_tx)(struct uart_port *port); > void (*stop_tx)(struct uart_port *port); > @@ -203,34 +203,34 @@ static void mpc52xx_psc_fifo_init(struct uart_port *port) > out_be16(&psc->mpc52xx_psc_imr, port->read_status_mask); > } > > -static int mpc52xx_psc_raw_rx_rdy(struct uart_port *port) > +static unsigned int mpc52xx_psc_raw_rx_rdy(struct uart_port *port) > { > return in_be16(&PSC(port)->mpc52xx_psc_status) > & MPC52xx_PSC_SR_RXRDY; > } > > -static int mpc52xx_psc_raw_tx_rdy(struct uart_port *port) > +static unsigned int mpc52xx_psc_raw_tx_rdy(struct uart_port *port) > { > return in_be16(&PSC(port)->mpc52xx_psc_status) > & MPC52xx_PSC_SR_TXRDY; > } > > > -static int mpc52xx_psc_rx_rdy(struct uart_port *port) > +static unsigned int mpc52xx_psc_rx_rdy(struct uart_port *port) > { > return in_be16(&PSC(port)->mpc52xx_psc_isr) > & port->read_status_mask > & MPC52xx_PSC_IMR_RXRDY; > } > > -static int mpc52xx_psc_tx_rdy(struct uart_port *port) > +static unsigned int mpc52xx_psc_tx_rdy(struct uart_port *port) > { > return in_be16(&PSC(port)->mpc52xx_psc_isr) > & port->read_status_mask > & MPC52xx_PSC_IMR_TXRDY; > } > > -static int mpc52xx_psc_tx_empty(struct uart_port *port) > +static unsigned int mpc52xx_psc_tx_empty(struct uart_port *port) > { > u16 sts = in_be16(&PSC(port)->mpc52xx_psc_status); > > @@ -1365,7 +1365,7 @@ static const struct uart_ops mpc52xx_uart_ops = { > /* Interrupt handling */ > /* ======================================================================== */ > > -static inline int > +static inline unsigned int > mpc52xx_uart_int_rx_chars(struct uart_port *port) > { > struct tty_port *tport = &port->state->port; > -- > 2.35.1 >