Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp546680pxm; Wed, 2 Mar 2022 22:43:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHYao0tr5EewzxW9XyiJxOuyBaEc7BZbQqIY1j/SpX+j+5GnyIpsEIQORUitkgDo9nB4/e X-Received: by 2002:a63:5911:0:b0:36c:4394:5bfa with SMTP id n17-20020a635911000000b0036c43945bfamr28704407pgb.519.1646289828165; Wed, 02 Mar 2022 22:43:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646289828; cv=none; d=google.com; s=arc-20160816; b=fDUOyCMQbeRRfnE4qRebkoj9JtGg61U/yzOD/zTMsqUGh2zK9+fv0R4ajiCDcUjlH2 HxLbu8mE1dLSuZnEoM5+XETq4lCY4ToEkmcPg7LQzpyEWw84iNM0HZ+v45Mqg0vCdWpU wwflIUz9EV1Gze8k/0Ql47YaOeskq+9JAjloD5Uo2ClOoU/dmETHWR079Fh5sMOtrB3S R5EJrXxC9nLBp2b/e385J3ZkYZmVwDro4b93xqSR9lm8l0nN12u5VjF9Qaq0KmXha39M XWRFgr0rWo1sv68jHoAdmLygend9xv1rWu9C1tk6WRiDPDrYWGCoWO1c52xYLZ9aIxN6 PlSA== 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:dkim-signature:dkim-signature; bh=7wrM5osNp1XinrH0hvsKMOFQq7yQKcbCY9ws+MpwasA=; b=rrGn3FoDsjrRRrmMwe7fNm+nznN+7I4KdZqRYrn6RoKdEbNjIQ8GQW3wqyoFs8X3CG 34YeFutBj3El9QtVdQx70gtgYBmlwRiW9U/AvQuwV/HQ59/hY+J6tsHNyT5tU5wrABxf r1mlWGlYd/KtenNZVWAZjokZaPvj8hprhzQBP/EsMJdFk8Jo+85/rUOwXIXq8AFwala6 QbOZwHiG3i0NiFSuysMac7PNz7kqGXLl5osxjMfQYe/1uCQm7l+VSiN04lrZCxNpB8+K 5zVv90ZxF8MuUZGTpLNfwOop4BsJArkbNcRLcSMO4dR38+sYDxXxGL1apTQvxZLIvFn6 R3lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=xqBGfyIa; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=XDoC2GwA; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p11-20020a170902e74b00b00151982ca00asi1270522plf.151.2022.03.02.22.43.25; Wed, 02 Mar 2022 22:43:48 -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=@suse.cz header.s=susede2_rsa header.b=xqBGfyIa; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=XDoC2GwA; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229480AbiCCGdt (ORCPT + 99 others); Thu, 3 Mar 2022 01:33:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229715AbiCCGdr (ORCPT ); Thu, 3 Mar 2022 01:33:47 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9425050441; Wed, 2 Mar 2022 22:33:02 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 038891F383; Thu, 3 Mar 2022 06:33:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1646289181; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7wrM5osNp1XinrH0hvsKMOFQq7yQKcbCY9ws+MpwasA=; b=xqBGfyIa/vtyHBAIrMhbI3nqYVibiM5V3Blc0aLWUYWy7o9Nuy2IGyr6OgYhMif05HZP5k RVm5/CjkyGXc3CUduKsK6BMSzi7s6AdHMRUFLlabMCTe+nfKY34bA/FiyhBASvJ86kU6Jg LAeXNDHos2sRuthUTlYKJn292hrRsHk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1646289181; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7wrM5osNp1XinrH0hvsKMOFQq7yQKcbCY9ws+MpwasA=; b=XDoC2GwA3XLI0VgAZwDYUIKoNr0ulhnqvDty+UvHS1wIlshjvES6QaLsE8AH/OCZKRHgAZ mseBngwk3akmmoDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E98B5132C1; Thu, 3 Mar 2022 06:32:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id bKkoNxthIGKRJQAAMHmgww (envelope-from ); Thu, 03 Mar 2022 06:32:59 +0000 Message-ID: <1be133eb-bfe8-b644-6aad-00a0a606aa05@suse.cz> Date: Thu, 3 Mar 2022 07:32:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH v3] serial: make uart_console_write->putchar()'s character an unsigned char Content-Language: en-US To: gregkh@linuxfoundation.org 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 , =?UTF-8?Q?Andreas_F=c3=a4rber?= , 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 References: <20220302072732.1916-1-jslaby@suse.cz> From: Jiri Slaby In-Reply-To: <20220302072732.1916-1-jslaby@suse.cz> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, 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 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)' regards, -- js suse labs