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 11CD8C25B08 for ; Sat, 20 Aug 2022 18:46:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231238AbiHTSqd (ORCPT ); Sat, 20 Aug 2022 14:46:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235737AbiHTSqM (ORCPT ); Sat, 20 Aug 2022 14:46:12 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 517BE2A26E; Sat, 20 Aug 2022 11:44:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VVZP6ZQhgTqqYIs/Rt6urxweEdWNsRk/iiS3JVFv1uQ=; b=CKPQfWBzgswUFZR1fEIKKtGn5M 1UUwUUvCWUFMntsLJAm6GXl1rhDDERlmboW5Gd+ewqaPmhylRM6xfMxdkmRiLoCOAa1sBbamnmQS4 bd7gHsF3uG36ZC/6IVwr/gH6savYK1ZWF2QBc5n7Mr9IMbfZsNNkign6CrQ/6NTBy8fLN0iohja1Z M4PBWL19EpQL844zgyOIRhhRHq9HQisWq5hszcqtbXJOc1PzdsUAEmXQAvo/mwUcZKfZXXRwntEwK KsnDbBzFEuQZZK+7cXl8li3tB5TZtxqp9xDp33mJUTWxfHf04dnnXem83tgm/yrh9ziTvtaBQ53c4 lFdqazGg==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPTRw-006S1Z-0k; Sat, 20 Aug 2022 18:44:00 +0000 Date: Sat, 20 Aug 2022 19:43:59 +0100 From: Al Viro To: Linus Torvalds Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: Re: [RFC][PATCHES] termios.h cleanups Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 20, 2022 at 11:14:19AM -0700, Linus Torvalds wrote: > On Fri, Aug 19, 2022 at 8:34 PM Al Viro wrote: > > > > It takes the helpers and INIT_C_CC into new header (termios-internal.h), > > with defaults being in linux/termios-internal.h, unless an arch-specific > > variant is provided in asm/termios-internal.h (only alpha and sparc end > > up needing that). Files that need that stuff (all 4 of them) include > > linux/termios-internal.h. > > I don't see anything obviously wrong here, and my main reaction is > actually that I wish this went a bit further, and moved the whole > kernel_termios_to_user_termios stuff into C code rather than having > them in headers. > > I don't think it's really worth inlining those things, and I wonder if > we could just have the default "just copy directly to/from user space" > as __weak functions, and then allow sparc and alpha to override them? Umm... Might as well, I guess... Where to put those, though? drivers/tty/tty_ioctl.c is not an option, unfortunately - it'll pick the local definitions, __weak or no __weak. drivers/tty/termios.c just for those? Looks just as convoluted as having those as inlines...