Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp328311rda; Sat, 21 Oct 2023 09:16:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGOgl3J+a8NQgdE31xSDqVuDqvBV7mqe5ihiTGq0ENgTSKH5h/BnYMR/ppzc9dMZGO4LaBT X-Received: by 2002:a17:90b:4b8a:b0:27d:4282:e3d2 with SMTP id lr10-20020a17090b4b8a00b0027d4282e3d2mr3798841pjb.30.1697904967797; Sat, 21 Oct 2023 09:16:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697904967; cv=none; d=google.com; s=arc-20160816; b=qs6ep45Dy/HQp93wK6CUUeiRMPlODR7H0hhfOIIRKlyyFdxQ5Q+zbFBPvuNkK8FzO3 4gPJ5iRxvobxZLneem2BpKzIUD4KvoyizcIwVJpqrmmfaQXdQ4AMdnoKRRkfRQPGhWq7 WCdVJy47o62IaOiL3V28V2RuUcdfbWnXXKfgDMLXV9pBewJM4hA+PgKEQN+P13oZyKVH VmQcqCmA/+gq4pUbD748HL54ka59sa84XhI3KjAUeGtF25T3zDrk1sk5uC5g19INV58q Q5EQ8qnpaLfsYHF1l4nha9wl6ZHDEqxQ/qMZbw3tmjaoeho0/p/YwQYWR7JY40/N3o/d 4KrQ== 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=3oYj/4kFW+Xbo4Gy7V73ApzqvOAzcs+j9hQmbvFVA3U=; fh=S+PsTUXQYGUb9tMl8Cvnf0FTXf/ZfzJAh0MRMtojqTU=; b=tGYQ6QmReZS5j9tRd8QpqFOjqyV6DRLzaNS17WqRMoa08COHnVALPNfCOTgAux9tBD XCYD3vMoxMylNFq7ZsK7LoCAdPAY6TWR2XimVdN7TkiDrruXp5rhun/cq3zi45ZJSnQZ fQJ4hWjMkWzZ/sd6CVJMwdlZsLubD7Pz3mSkiEQrJuhmiPqNq+bRfFleVlJFt0lRHYU0 Df7ixhxzqqdfJ+NWmfjAMwF/eRWZrzeA9GNrytLIHK8Ji7wqnOWPsORa+bxVEfWv0rpT NhkFDzjf/kbcseg4epY2iAZr0XkHY4r3UnEFY+KcvcQEPuKkU3Imheb8M8HrkTIaQgX/ 95Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mlg+wTlh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id lw17-20020a17090b181100b0026376acd6fesi3912327pjb.22.2023.10.21.09.16.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 09:16:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mlg+wTlh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id DFB98808EE43; Sat, 21 Oct 2023 09:15:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231783AbjJUQPe (ORCPT + 99 others); Sat, 21 Oct 2023 12:15:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231777AbjJUQPb (ORCPT ); Sat, 21 Oct 2023 12:15:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9FFB1A8; Sat, 21 Oct 2023 09:15:26 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6404C433C8; Sat, 21 Oct 2023 16:15:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1697904926; bh=SHOy2rMtReYiFTxDJT1AME1BMS7WvUye36eUPs7PVdE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mlg+wTlhHgYcLmcjz6kx2/83Mrg84TXk9muSAlCjmS1G6Ip8FPzdTVIRQQB/O9cRI iTDSJ4Ws8RW/Pvx0qzZeHX3BP10NqnPV4KsIYKW0EKK1cQhQOfcym1ZLAKMxseud88 OgcKhARRp6EtWP8Zx0u8BP7rj9IjOqeflF1Pl308= Date: Sat, 21 Oct 2023 18:15:23 +0200 From: Greg KH To: Florian Eckert Cc: Eckert.Florian@googlemail.com, jirislaby@kernel.org, pavel@ucw.cz, lee@kernel.org, kabel@kernel.org, u.kleine-koenig@pengutronix.de, ansuelsmth@gmail.com, m.brock@vanmierlo.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-leds@vger.kernel.org Subject: Re: [PATCH v4 2/3] tty: add new helper function tty_get_tiocm Message-ID: <2023102115-stock-scrambled-f7d5@gregkh> References: <20231019112809.881730-1-fe@dev.tdt.de> <20231019112809.881730-3-fe@dev.tdt.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231019112809.881730-3-fe@dev.tdt.de> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sat, 21 Oct 2023 09:15:46 -0700 (PDT) On Thu, Oct 19, 2023 at 01:28:08PM +0200, Florian Eckert wrote: > The struct 'tty_struct' has a callback to read the status flags of the tty > if the tty driver provides them. So fare, the data is transferred directly > to userspace with the function 'tty_tiocmget'. This function cannot be > used to evaluate the status line of the tty interface in the ledtrig-tty > trigger. To make this possible, a new function must be added that does > not immediately pass the data on to userspace. > > The new function 'tty_get_tiocm' only returns the status register. > This information can then be processed further in the ledtrig-tty > trigger. Writing changelogs are hard. You are including a lot of information in here that really doesn't need to be, as you are focusing on your specific use case, which is fine, but you are creating a generic function. This can be simpler, how about something like this: There is no in-kernel function to get the status register of a tty device like the TIOCMGET ioctl returns to userspace. Create a new function, tty_get_tiocm(), to obtain the status register that other portions of the kernel can call if they need this information, and move the existing internal tty_tiocmget() function to use this interface. Sound good? The code portion looks fine to me, thanks for doing this. greg k-h