Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp595677pxm; Thu, 3 Mar 2022 00:09:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyGfkYxZLYmJaX1w4l5yBWwhdht8EMyZOhAWzvqBxpc/ERaQ0tQTjRSpW7U/pS4bqwBsx4L X-Received: by 2002:a17:902:9046:b0:14d:5c9d:e7df with SMTP id w6-20020a170902904600b0014d5c9de7dfmr35230775plz.65.1646294961922; Thu, 03 Mar 2022 00:09:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646294961; cv=none; d=google.com; s=arc-20160816; b=DTz60GiUtAdfvsAU2BF875wTszRJp0XOnU77xzcAFUMgNMIMT+FFCV7VL3Jv72iZom E9RKrzXAsKh+psXxPdArbpxl9C7KquicHTo2UQxDA2x2nQMIZpf7ePC+wSiWsewW5O+M EB1sths4lgSXf6MbSev1Ms/a0Mp+uvG96xs3msniYgOFSEs+39Wws0/ORM7+7NrE4irT z2VIQHFg5Colxid3QRh3M6qzMHLOqcOEZtovA4k55RgpIk7JpKJY/kUwzyoNaQTVeEnh O/TQpIJNNEgAdG0TvxIVZe1grURXtEBtnM4ToC0zz8hinRoEaj/iV4mRlk6njs4peJC2 esnw== 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=OZGjoK7oacFa6wCWAKtKYa6KHNtcbZAHXr+vY1x36mw=; b=OWpb2EF7AcLBF5eau3wM1NK0VNE+cEqNKa/f3TjqVdx8Wmt88HSCWj5509I66laywz cG+D5FTyVA1gb2EgBmOcmKzZ8WF+JBcMFbuST4oidV2bJivXixwLRVgCiegZHM18EDTa AqzcNlk0g4U0Uoh5EvQ4+i93Gvhdwa7loWcLn9Uc6jqLu9DXu/AlutRqn1SYTZ8QuKjw Gnd3JA4nRYHje+wMY9+mR5YwtpnP5nFwygf/A5YeE0n8Rh3FGzyIQhYMxOJRBlN4RUyP Fhq4riXqxCH0ZVZvPJuRz01oEbQBAe/KmAFOJtH+zwf8zpdkF2VmQajdFPRT4J3FbDoM M3Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zkwMolgG; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u7-20020a63f647000000b0037866cad2d6si1370560pgj.24.2022.03.03.00.09.07; Thu, 03 Mar 2022 00:09:21 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=zkwMolgG; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230230AbiCCHqK (ORCPT + 99 others); Thu, 3 Mar 2022 02:46:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbiCCHqJ (ORCPT ); Thu, 3 Mar 2022 02:46:09 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D33A515D3AD; Wed, 2 Mar 2022 23:45:24 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 87F94B81FEA; Thu, 3 Mar 2022 07:45:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E574C004E1; Thu, 3 Mar 2022 07:45:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646293522; bh=M05nIcnpUn4WzPPLRyplVvMJBTOh9YoN2+KnItwoIfg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=zkwMolgG3+0fqKz+ZDMIOvb0TyBNK1wsJWJT/qrCP5PhefcN/zNiZHEqxKis5G1K5 VGQ77zV4WCONgV3h4JRtLxuu1X13vtDg5lCQjMr7w0XrMFwk+JhYm0VzGkCJDvjn6T hJ8H7qorBPup/D8Os51jNWDfnd1wozqWZfUKPE/E= Date: Thu, 3 Mar 2022 08:45:18 +0100 From: Greg KH To: Jiri Slaby Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Genoud , Florian Fainelli , Tobias Klauser , Paul Cercueil , Russell King , Vineet Gupta , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , bcm-kernel-feedback-list@broadcom.com, Alexander Shiyan , Baruch Siach , "Maciej W. Rozycki" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Karol Gugala , Mateusz Holenko , Vladimir Zapolskiy , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Taichi Sugaya , Takao Orito , Liviu Dudau , Sudeep Holla , Lorenzo Pieralisi , Andreas =?iso-8859-1?Q?F=E4rber?= , Manivannan Sadhasivam , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Andy Gross , Bjorn Andersson , Krzysztof Kozlowski , Orson Zhai , Baolin Wang , Chunyan Zhang , Patrice Chotard , Maxime Coquelin , Alexandre Torgue , "David S. Miller" , Peter Korsgaard , Michal Simek Subject: Re: [PATCH v3] serial: make uart_console_write->putchar()'s character an unsigned char Message-ID: References: <20220302072732.1916-1-jslaby@suse.cz> <1be133eb-bfe8-b644-6aad-00a0a606aa05@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1be133eb-bfe8-b644-6aad-00a0a606aa05@suse.cz> X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Thu, Mar 03, 2022 at 07:32:59AM +0100, Jiri Slaby wrote: > On 02. 03. 22, 8:27, Jiri Slaby wrote: > > Currently, uart_console_write->putchar's second parameter (the > > character) is of type int. It makes little sense, provided uart_console_write() > > accepts the input string as "const char *s" and passes its content -- the > > characters -- to putchar(). So switch the character's type to unsigned > > char. > > > > We don't use char as that is signed on some platforms. That would cause > > troubles for drivers which (implicitly) cast the char to u16 when > > writing to the device. Sign extension would happen in that case and the > > value written would be completely different to the provided char. DZ is > > an example of such a driver -- on MIPS, it uses u16 for dz_out in > > dz_console_putchar(). > > > > Note we do the char -> uchar conversion implicitly in > > uart_console_write(). Provided we do not change size of the data type, > > sign extension does not happen there, so the problem is void. > > > > This makes the types consistent and unified with the rest of the uart > > layer, which uses unsigned char in most places already. One exception is > > xmit_buf, but that is going to be converted later. > > Kbuild seems to serve me this one by one. So this patch is still incomplete: > > drivers/tty/serial/sunplus-uart.c:526:7: error: incompatible function > pointer types passing 'void (struct uart_port *, int)' to parameter of type > 'void (*)(struct uart_port *, unsigned char)' Let me just add this to my -testing branch, that will give us much quicker kbuild responses and handle stuff like this easier and I can fix the errors up when they are reported. thanks, greg k-h