From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52393C7EE2F for ; Thu, 2 Mar 2023 15:35:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229659AbjCBPfZ (ORCPT ); Thu, 2 Mar 2023 10:35:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbjCBPfY (ORCPT ); Thu, 2 Mar 2023 10:35:24 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C40552ED7B for ; Thu, 2 Mar 2023 07:35:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677771323; x=1709307323; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version:content-id; bh=yUdGTSfZhsfne6GGW1+NA0x7tqzegGifwzGQrd0iHuE=; b=FXdDj1wp8vL5kIYMFSr5SCqVLAMGXtHD1d14+3EFtPF383FGzreAMk8f zWRFS9coxZbBOUpf/0cMwJkR0ChChRRqrBWT7s5+r0jaTO0qx0YU3wLk7 9TIheoc1zByJttVpoxDVKVt3s01pvgKDNHp8+JfArNEeDfZEDfNdQg5/O HwmvFcYs0QHOqCFqDbDdwY3AuVTm6btbwIWWAqzaj6uhOteNTRkmMaSpw XwfFFhFlXUxq4x5yFr9S4F6eAoqW7m2exQA4GzTp/BaJP3+GzRZWI4HyV BPoIoq9Fi5h3yHgA3ONYs3xYuJ9Bn7uDpkr2FJwDYD8XnLVlDcRsOPvQo g==; X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="362345088" X-IronPort-AV: E=Sophos;i="5.98,228,1673942400"; d="scan'208";a="362345088" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2023 07:35:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="624996571" X-IronPort-AV: E=Sophos;i="5.98,228,1673942400"; d="scan'208";a="624996571" Received: from pawellew-mobl1.ger.corp.intel.com ([10.252.46.79]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2023 07:35:20 -0800 Date: Thu, 2 Mar 2023 17:35:17 +0200 (EET) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: =?ISO-8859-15?Q?Uwe_Kleine-K=F6nig?= cc: Greg Kroah-Hartman , Jiri Slaby , Shawn Guo , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-serial , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] serial: imx: Drop a few unneeded casts In-Reply-To: <20230302115417.1860210-1-u.kleine-koenig@pengutronix.de> Message-ID: <6e66bc69-52b7-bea5-1e2c-ad5ed819a6@linux.intel.com> References: <20230302115417.1860210-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-201369551-1677771109=:2066" Content-ID: <53e2651-9dbc-704-78d9-563097fb4ec3@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-201369551-1677771109=:2066 Content-Type: text/plain; CHARSET=ISO-8859-15 Content-Transfer-Encoding: 8BIT Content-ID: On Thu, 2 Mar 2023, Uwe Kleine-König wrote: > There is no point in casting a struct uart_port to a struct imx_port > just to access the first member of the latter (a struct uart_port). > > This introduces code changes. I don't know what this sentence is supposed to mean (did you forgot to add a negation into it)? The code changes :-) are okay though: Reviewed-by: Ilpo Järvinen -- i. > > Signed-off-by: Uwe Kleine-König > --- > drivers/tty/serial/imx.c | 17 ++++++----------- > 1 file changed, 6 insertions(+), 11 deletions(-) > > diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c > index 523f296d5747..84bc0e768726 100644 > --- a/drivers/tty/serial/imx.c > +++ b/drivers/tty/serial/imx.c > @@ -1808,9 +1808,7 @@ imx_uart_set_termios(struct uart_port *port, struct ktermios *termios, > > static const char *imx_uart_type(struct uart_port *port) > { > - struct imx_port *sport = (struct imx_port *)port; > - > - return sport->port.type == PORT_IMX ? "IMX" : NULL; > + return port->type == PORT_IMX ? "IMX" : NULL; > } > > /* > @@ -1818,10 +1816,8 @@ static const char *imx_uart_type(struct uart_port *port) > */ > static void imx_uart_config_port(struct uart_port *port, int flags) > { > - struct imx_port *sport = (struct imx_port *)port; > - > if (flags & UART_CONFIG_TYPE) > - sport->port.type = PORT_IMX; > + port->type = PORT_IMX; > } > > /* > @@ -1832,20 +1828,19 @@ static void imx_uart_config_port(struct uart_port *port, int flags) > static int > imx_uart_verify_port(struct uart_port *port, struct serial_struct *ser) > { > - struct imx_port *sport = (struct imx_port *)port; > int ret = 0; > > if (ser->type != PORT_UNKNOWN && ser->type != PORT_IMX) > ret = -EINVAL; > - if (sport->port.irq != ser->irq) > + if (port->irq != ser->irq) > ret = -EINVAL; > if (ser->io_type != UPIO_MEM) > ret = -EINVAL; > - if (sport->port.uartclk / 16 != ser->baud_base) > + if (port->uartclk / 16 != ser->baud_base) > ret = -EINVAL; > - if (sport->port.mapbase != (unsigned long)ser->iomem_base) > + if (port->mapbase != (unsigned long)ser->iomem_base) > ret = -EINVAL; > - if (sport->port.iobase != ser->port) > + if (port->iobase != ser->port) > ret = -EINVAL; > if (ser->hub6 != 0) > ret = -EINVAL; > --8323329-201369551-1677771109=:2066-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C65A2C678D4 for ; Thu, 2 Mar 2023 16:46:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-ID:Content-Type: MIME-Version:References:Message-ID:In-Reply-To:Subject:cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UqLk19rBFvuIN1Eut5Oa3E0S+dBcJxq2JCVdlA0HHXs=; b=L7OharqiOPrGM/6rR8lZj6VOIx GN2r/HsCQawGCae6OY5ox95wp+tXP9yqVU4+1OsJRGXk/Lr4dQS1ecsFpqNzYDPDuKq4cGgGfKKPV EiSSHP1FLQYlW3zeLiH0tkr5EPxCPXtPCyFBvWrVMKl/kk+sP8EStnKJee7vp4t2l30xsWykAG0mW ndAHeYjmp35SehnNLCOBion0V4vgQdLvfkjYmAvXvJmKaKJqRhIxJTsQhs6Gaq2vvYFPguQsjsGYR Sj4lNMKiVDiKI2JmvpyOwPAh3myIxZYDaAafVPF0EjurdB3LQnpAmX4BnuEZjakKxH8Sv0BYrve6f zD+htmLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pXm3u-002stb-0R; Thu, 02 Mar 2023 16:45:46 +0000 Received: from mga01.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pXkxt-002hU2-FQ for linux-arm-kernel@lists.infradead.org; Thu, 02 Mar 2023 15:35:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677771329; x=1709307329; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version:content-id; bh=yUdGTSfZhsfne6GGW1+NA0x7tqzegGifwzGQrd0iHuE=; b=CynrDAlLe9dn/2jYO6Tk1gjcFuQwdKSHp5SL/Sn8N1vViJ0VwmYVQ3EO kb8pGpo7vgiw7u1yGiDZUzrNIOUU/XFiMYWD3yrAJmQZPyxc1IlEnnMDk APo6xVxzOOzWlWgy/bFw1zevCJehuwmus2JD2w6581KV/ylVdlRkzcQSZ IP33cqdJ6C+oVtwvzCey2fzNSGk6rPj7+8rYB6IgavGuYaNpOUY2YjQMR Jzzz/1DI06v1uZDwVJe6AQXLrA42QQ8lB9YKSlbwqLpmgb9TyHcXHRBRY xC+ocbK87FtOsPMb6vK6qbXGmUkeEenuXmFBVD5CyrBI1dHHNQ1hzuXMp A==; X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="362345090" X-IronPort-AV: E=Sophos;i="5.98,228,1673942400"; d="scan'208";a="362345090" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2023 07:35:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="624996571" X-IronPort-AV: E=Sophos;i="5.98,228,1673942400"; d="scan'208";a="624996571" Received: from pawellew-mobl1.ger.corp.intel.com ([10.252.46.79]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2023 07:35:20 -0800 Date: Thu, 2 Mar 2023 17:35:17 +0200 (EET) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: =?ISO-8859-15?Q?Uwe_Kleine-K=F6nig?= cc: Greg Kroah-Hartman , Jiri Slaby , Shawn Guo , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-serial , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] serial: imx: Drop a few unneeded casts In-Reply-To: <20230302115417.1860210-1-u.kleine-koenig@pengutronix.de> Message-ID: <6e66bc69-52b7-bea5-1e2c-ad5ed819a6@linux.intel.com> References: <20230302115417.1860210-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-201369551-1677771109=:2066" Content-ID: <53e2651-9dbc-704-78d9-563097fb4ec3@linux.intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230302_073529_570194_8FD5206C X-CRM114-Status: GOOD ( 22.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-201369551-1677771109=:2066 Content-Type: text/plain; CHARSET=ISO-8859-15 Content-Transfer-Encoding: 8BIT Content-ID: On Thu, 2 Mar 2023, Uwe Kleine-König wrote: > There is no point in casting a struct uart_port to a struct imx_port > just to access the first member of the latter (a struct uart_port). > > This introduces code changes. I don't know what this sentence is supposed to mean (did you forgot to add a negation into it)? The code changes :-) are okay though: Reviewed-by: Ilpo Järvinen -- i. > > Signed-off-by: Uwe Kleine-König > --- > drivers/tty/serial/imx.c | 17 ++++++----------- > 1 file changed, 6 insertions(+), 11 deletions(-) > > diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c > index 523f296d5747..84bc0e768726 100644 > --- a/drivers/tty/serial/imx.c > +++ b/drivers/tty/serial/imx.c > @@ -1808,9 +1808,7 @@ imx_uart_set_termios(struct uart_port *port, struct ktermios *termios, > > static const char *imx_uart_type(struct uart_port *port) > { > - struct imx_port *sport = (struct imx_port *)port; > - > - return sport->port.type == PORT_IMX ? "IMX" : NULL; > + return port->type == PORT_IMX ? "IMX" : NULL; > } > > /* > @@ -1818,10 +1816,8 @@ static const char *imx_uart_type(struct uart_port *port) > */ > static void imx_uart_config_port(struct uart_port *port, int flags) > { > - struct imx_port *sport = (struct imx_port *)port; > - > if (flags & UART_CONFIG_TYPE) > - sport->port.type = PORT_IMX; > + port->type = PORT_IMX; > } > > /* > @@ -1832,20 +1828,19 @@ static void imx_uart_config_port(struct uart_port *port, int flags) > static int > imx_uart_verify_port(struct uart_port *port, struct serial_struct *ser) > { > - struct imx_port *sport = (struct imx_port *)port; > int ret = 0; > > if (ser->type != PORT_UNKNOWN && ser->type != PORT_IMX) > ret = -EINVAL; > - if (sport->port.irq != ser->irq) > + if (port->irq != ser->irq) > ret = -EINVAL; > if (ser->io_type != UPIO_MEM) > ret = -EINVAL; > - if (sport->port.uartclk / 16 != ser->baud_base) > + if (port->uartclk / 16 != ser->baud_base) > ret = -EINVAL; > - if (sport->port.mapbase != (unsigned long)ser->iomem_base) > + if (port->mapbase != (unsigned long)ser->iomem_base) > ret = -EINVAL; > - if (sport->port.iobase != ser->port) > + if (port->iobase != ser->port) > ret = -EINVAL; > if (ser->hub6 != 0) > ret = -EINVAL; > --8323329-201369551-1677771109=:2066 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --8323329-201369551-1677771109=:2066--