Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp668604pxm; Thu, 3 Mar 2022 02:05:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJziqAEQapOfl6GRCJflNf1MfCPHO4UxvBfpvw3II3FmYnr59Nrf4mVeLNK00tXmyQEGcBFa X-Received: by 2002:aa7:de84:0:b0:40f:db98:d0f9 with SMTP id j4-20020aa7de84000000b0040fdb98d0f9mr33188701edv.366.1646301937034; Thu, 03 Mar 2022 02:05:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646301937; cv=none; d=google.com; s=arc-20160816; b=OGJvGyRonr6xUJUNRtYjk5GoBGnh2A4rTOmo/6dIyKNZDaQQF7DcoEnMn/wy3dWoKv hvFRlYiwY3Rxvp3UOz8ccOnpOiLUp9w0gNwXN+fZWdNRoO3s+UlthT7WZXpkSaW7tghz 2BYIAcuL/Y/PoyNckpE01vwWxcQ/E65KXak3+U/k62UtuRFFaylUKJ5PR+56XOSCfsVI OvQWtU7d3AeRirNd0y64Tt6/XVH+2XaP92RO18i07qp15OdUCvgEQrxKMpVqaFTr9yfz kBGnx5+WJKT7H8R1ldbgrEbXaoNw+KJM4RwcEnPs5Wx3aPA7SGcbJlRyH0b7uuDxruyg mzdQ== 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=VDJOI+ODDYssJiAkTABqUvSYJlLjmPpIiJ2X5BgHH0E=; b=m+FyDIiziCWmi2F2fgiillIaKlIlWQ6j1rz7BceLCq9DnNN8d/sl7KR4U1Ef75QbjJ ghzZF8GkPVjS4bsIgw3gAWez6XCEFBmbbTubzWW5w4onMyrVlbhU067yoK2dZi7kGz9P h6EvuMz6+NqP4ApXqSCkpfjeVMVdm7MYbdBN7nSqz2+z/lHZfOIqmJe1M6oRVgP8lWge jBFiundDvzOQrydShPnRbIVVhZl6n1QPf+xTmGKOyd2AwsJSK1MxxlmJ//TSNeqZMSkD luPknYGlJeh8WNgQHcTgYOFFUnmWeHg+QaweiDeBTQvHY8cP7cziIOveBODLjiFLJ1pH rJdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="jk/Oj6Dd"; 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 w9-20020a056402070900b00410d469d75esi1079530edx.619.2022.03.03.02.05.13; Thu, 03 Mar 2022 02:05:36 -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="jk/Oj6Dd"; 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 S230525AbiCCIIV (ORCPT + 99 others); Thu, 3 Mar 2022 03:08:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230520AbiCCIIR (ORCPT ); Thu, 3 Mar 2022 03:08:17 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94C6C2191; Thu, 3 Mar 2022 00:07:30 -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 C48A8B8241C; Thu, 3 Mar 2022 08:07:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48D50C004E1; Thu, 3 Mar 2022 08:07:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646294847; bh=CW4nPiLszX8YLU4FHSsO2BkxTO2NCXCBRwRANNIF8Yc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jk/Oj6Ddvf88y2Tno1YS4kfcXOoq22tsCK7QeVqhqJBaiiMNePBqRxTUuzZKa6Tth fRkabtbutyfzYYc5lzPM1l4JQrG8P5hJWNQPvyP15t9SobJD2tiCNmnKrEy4VSh9c0 ZkkUxj7uhHXHeAToRYt2qDjTqFOgw23Vo0j1JcDY= Date: Thu, 3 Mar 2022 09:07:22 +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> <0ed348d2-a3dd-22a1-0773-83369c35794e@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0ed348d2-a3dd-22a1-0773-83369c35794e@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 08:49:44AM +0100, Jiri Slaby wrote: > On 03. 03. 22, 8:45, Greg KH wrote: > > 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. > > Note this was missed as this driver was added only few days ago, so it was > not covered by kbuild against my tree until then. And to me, it looks like > kbuild is run on my tree only when it has nothing better to do (which is > perfectly fine, as even that catches a lot of things). > > Besides that, there are two places in the driver which need update. > > So should I send a v4 or wait? If you have a v4 now with this fixed, sure, I'll take that and queue that one up. thanks, greg k-h