Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp865175rdb; Sat, 7 Oct 2023 02:17:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IExnwjg4LS6kFRmfwjepeRos2Cr4Xss2REz6BnC0YB3LbXhtokRIAOsXJc1pLnMIOeWG0c4 X-Received: by 2002:a05:6a00:1a94:b0:68a:5e5b:e450 with SMTP id e20-20020a056a001a9400b0068a5e5be450mr11208568pfv.26.1696670277068; Sat, 07 Oct 2023 02:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696670277; cv=none; d=google.com; s=arc-20160816; b=WZxRyEMsf0yxQSAGfkDaNtorEG/SVzcj2hE26T6YPSwwjeQL6GqF16ctzY9izRQRIz gSNWmfahuur+9tBcQZ5DuifRwvP5XeN9Dzp4DyZulDZwEzvrefHUMjr4+26wFtqvU008 JaxtI0/gWDaqX+YAL7k5GrA/POLs7MhGZNMtR6Kav2KQ28JgToqXA3ZtlO7a1kpwNV4w QANIvKm5TgCQcW0cDdLtByNFnGwRaTE9FVsuFeu+GuGWNPXsB1bAjWf0Lfe3cj3aTN8j Wfxz1uCvcPmoGQM7gnRAabaq2GJuvZ6ELV22eoRAbsvxFh1XzzzxdTCVP+HkUnK0UZzc U/gQ== 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=QXJNWyWW8Qhc7LTrW6XETknVpAOuspHnB5tMPBCnSjE=; fh=0NY7h9vN0sHyEXtfCTiOf2VB/Syx6dvOjMr4stMh2J4=; b=sHxFjjL3OvqCphoyeomI9pY6+35bRNNTVPN4Kyxvmtpl7s2vo5OG9alDCa5rywKlas Oc+z/P/DYvYMF6+6W5TCn0sJsn9BwAdxGN5TKRyHgzn8J76S1VxokgnTq2dLr/UbvTE2 8c945UQiPrgzrNZGwkU8ylreVh4ZJE3aaRML8lXT/OiqRt9Ih8f6BHFiPDXRgrT9KCac ZZV4SFB/TU36fbum3oMuLXri7hP9OijsR6y+KSqGW5BKIbvYoNQQSH7TioILiYdBc/k7 4cHhPSw7fzmkLl8QfrsWDNgoQeMMQLtPlAZSau1Yah9V5v03PV1Lp3aIB1mipmibrdZ5 jhFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WGq38i2a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id be3-20020a656e43000000b0056da0ae25a0si5265643pgb.441.2023.10.07.02.17.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 02:17:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WGq38i2a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 47472802D459; Sat, 7 Oct 2023 02:17:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343701AbjJGJRp (ORCPT + 99 others); Sat, 7 Oct 2023 05:17:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229762AbjJGJRo (ORCPT ); Sat, 7 Oct 2023 05:17:44 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDABABD; Sat, 7 Oct 2023 02:17:42 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09543C433C8; Sat, 7 Oct 2023 09:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1696670262; bh=Hj4TwF8++s63MgyWqlgNIz+WcGpWDhaMOi/4xSSl2lM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WGq38i2alQYUR8TQMyKOwcAYiDIXSgOWA8Cm0M0jXFQxYoiq1XwQKiR7+2/ZItcLb RQAF2vVK8dyv5CPikkKN5WQg5eXCFS5fHvcGRv7XCmq4jd85++tp7iSoBFIvc+YTyE Rwtfrr7UM2s0D7/u2Goo9wmV572BUdD51cqkSRBY= Date: Sat, 7 Oct 2023 11:17:39 +0200 From: Greg Kroah-Hartman To: Max Filippov Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Jiri Slaby , Arnd Bergmann Subject: Re: [PATCH] serial: add PORT_ANY definition Message-ID: <2023100706-circle-rework-993e@gregkh> References: <20231006115713.801322-1-jcmvbkbc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231006115713.801322-1-jcmvbkbc@gmail.com> X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Sat, 07 Oct 2023 02:17:54 -0700 (PDT) X-Spam-Level: ** On Fri, Oct 06, 2023 at 04:57:13AM -0700, Max Filippov wrote: > Current pattern in the linux kernel is that every new serial driver adds > one or more new PORT_ definitions because uart_ops::config_port() > callback documentation prescribes setting port->type according to the > type of port found, or to PORT_UNKNOWN if no port was detected. > > When the specific type of the port is not important to the userspace > there's no need for a unique PORT_ value, but so far there's no suitable > identifier for that case. > > Provide generic port type identifier other than PORT_UNKNOWN for ports > which type is not important to userspace. > > Suggested-by: Arnd Bergmann > Suggested-by: Greg Kroah-Hartman > Signed-off-by: Max Filippov > --- > include/uapi/linux/serial.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/uapi/linux/serial.h b/include/uapi/linux/serial.h > index 53bc1af67a41..070e50cf9e1e 100644 > --- a/include/uapi/linux/serial.h > +++ b/include/uapi/linux/serial.h > @@ -47,6 +47,8 @@ struct serial_struct { > /* > * These are the supported serial types. > */ > +/* Generic type identifier for ports which type is not important to userspace. */ > +#define PORT_ANY (-1) This should be at the end of the list. And I think we need a better name, "PORT_GENERIC"? thanks, greg k-h