Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp331137lqh; Thu, 28 Mar 2024 03:34:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW1qtLOuf22qwpqkDbDdsu4FMIGeCh458rT9MIZZtT7Y2/6ohOOVYlaAg4jS6H5NA6daQzHu9EXLufot0rKigMqG8sNMmmVWL+f0X1bHQ== X-Google-Smtp-Source: AGHT+IFgL0YiFYnETbrUiiOP+AVCyu7HI58rYwHsElxO2yP1qiurB1XAjRGowdjpgtY0Le1tSMMz X-Received: by 2002:a17:90b:14a:b0:2a0:7815:dd25 with SMTP id em10-20020a17090b014a00b002a07815dd25mr2429049pjb.20.1711622048179; Thu, 28 Mar 2024 03:34:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711622048; cv=pass; d=google.com; s=arc-20160816; b=piSjiyEs20Uflc37h+u85AOmEMPB1yA1lg4gbDPfQSwlfpVg+Ufn7sQpfO5rTxs47W ms5yp2HK87KMVJMoIP1xmyL78r7hNkLCcPi5pIfsN5CCFBuunoZiKg03Sybi8IdRLz9M f57TTCVPQ/tQpQ6aLWoKB3GQKsKrGeGcfUAQTtp6giNGvAjxm1XH3kM99yEklSR0t4y0 SLgY7Ou8a1gGFo/nm78nCPMnm5YdKvk7HCA2MZCqJyRkiC7nD5xpUKsZgXLQgr4XCcXJ jxbzAiUb9w1zdB33Hg3+a0mlktgO5/wmbEAjRjQ2VHfqpjGetvVAfyybuGjMvY/o9ieF do2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=u481CXysCbg/7oYNWvsfepiT4MxiwQGwVYQbpgRBaNg=; fh=Ct/saqOWYuOYLXKYD0z0ai43IDMmIjpHWUTtYvH5S7Y=; b=Bt+5PfzL/7Na31LdAu0FZ1Fa0q2cJfUgLdvMX/po2i16sI78h5RfjjlJYhTv5j04J8 iZ7/6iAgyxPeSUy2tdHIIx0GEOb57yO12jRFeXWXf25gyEUxY6SoNpnBaT64UK4rPXB1 wtAwGey+ezhGLeO1fBOtsM0rOMp9XbvgCarf1EI2nMSKuPPqzjGcIx1zNhakVIK5e0HC s6rHpNe9gFh3uCeGcgHTivcz2svF6tdm66nOUm1IWu1wDIJvXi7NjT0/TxEMO2ObOfdU mhGSoWXcUUJZ+m+lWzwom/tqP1d3fQ6EZF56fjXDVZ74490ek+WOhwnQ0URRbQIC0QAW eWUA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fZDuX3ZL; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-122780-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122780-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e63-20020a17090a6fc500b0029de65cf372si3324385pjk.66.2024.03.28.03.34.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 03:34:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122780-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fZDuX3ZL; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-122780-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122780-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 519F7296023 for ; Thu, 28 Mar 2024 10:33:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 40E6E374EF; Thu, 28 Mar 2024 10:33:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="fZDuX3ZL" Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACD092561D; Thu, 28 Mar 2024 10:33:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711622028; cv=none; b=UP6g8/KH3sKc3nDlT/5gbgkqp//0dTlo9k/gR6hkXDG/gzLFdVb6VE/4FDqaFTdoW9V3nb36igA8F2dnKJBc46nr7rj51BvyQVOgdBCDVMPd08BIZsufqH0HSAVAzrkQ0uZYteymLzAzkJLl+J5t2DlM2rAwH4obHMDV96W7ptY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711622028; c=relaxed/simple; bh=OVALdI1w8Y5mN9IU9xR+T3K7yhcGZNMc4Vt/TYPpm/8=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HHCzzHx73oEmhOgQJ2hpZ6ma8xhCh/KCDaIwbezbpMkCH3JZSvVWlhKSH1MpN39mUmqpvlyF4fWFTakoPJ4XmVFny+WJgxG4whSG3PYkHEifl3PBUEAyBgzHlgpsJJnFp6nZxvmJ1EIy5jJFPRXB5hpbeojzdktZUu2JtHTfF6s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=fZDuX3ZL; arc=none smtp.client-ip=198.47.19.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 42SAXF9a020364; Thu, 28 Mar 2024 05:33:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1711621995; bh=u481CXysCbg/7oYNWvsfepiT4MxiwQGwVYQbpgRBaNg=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=fZDuX3ZLFC3AztKK12GOETXs8erBT6xhL8TsKlz0bmHhHjM2WDYEiwdnnLG/0aNVx sdZwn8LuToew8OwutwwWAD9cs95fAmwsinj6bgs6PF9ApLnjuZM+UxXuAZPtpQXSLh lBXsyohwB2kGOTNj6Pje0dCYY+La72jk2v1HLA34= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 42SAXF77042178 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 28 Mar 2024 05:33:15 -0500 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 28 Mar 2024 05:33:12 -0500 Received: from fllvsmtp7.itg.ti.com (10.64.40.31) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 28 Mar 2024 05:33:12 -0500 Received: from localhost (dhruva.dhcp.ti.com [172.24.227.68]) by fllvsmtp7.itg.ti.com (8.15.2/8.15.2) with ESMTP id 42SAXBDU057525; Thu, 28 Mar 2024 05:33:11 -0500 Date: Thu, 28 Mar 2024 16:03:10 +0530 From: Dhruva Gole To: Greg Kroah-Hartman CC: Tony Lindgren , Jiri Slaby , Jonathan Corbet , Petr Mladek , Steven Rostedt , John Ogness , Sergey Senozhatsky , "David S . Miller" , Andy Shevchenko , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , , , Sebastian Reichel , Subject: Re: [PATCH v7 4/7] serial: core: Add support for DEVNAME:0.0 style naming for kernel console Message-ID: <20240328103310.hd4z2bt6cvje5hbo@dhruva> References: <20240327110021.59793-1-tony@atomide.com> <20240327110021.59793-5-tony@atomide.com> <20240328063152.bjkdtdsu42cqbgf3@dhruva> <2024032859-subscript-marshy-7508@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <2024032859-subscript-marshy-7508@gregkh> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 On Mar 28, 2024 at 08:22:26 +0100, Greg Kroah-Hartman wrote: > On Thu, Mar 28, 2024 at 12:01:52PM +0530, Dhruva Gole wrote: > > Hi, > > > > On Mar 27, 2024 at 12:59:38 +0200, Tony Lindgren wrote: > > > We can now add hardware based addressing for serial ports. Starting with > > > commit 84a9582fd203 ("serial: core: Start managing serial controllers to > > > enable runtime PM"), and all the related fixes to this commit, the serial > > > core now knows to which serial port controller the ports are connected. [...] > > > > > > +#ifdef CONFIG_SERIAL_CORE_CONSOLE > > > + > > > +static int serial_base_add_one_prefcon(const char *match, const char *dev_name, > > > + int port_id) > > > +{ > > > + int ret; > > > + > > > + ret = add_preferred_console_match(match, dev_name, port_id); > > > + if (ret == -ENOENT) > > > + return 0; > > > + > > > + return ret; > > > > Can we do this instead? > > return (ret == -ENOENT ? 0 : ret); > > No, please no. > > Just spell it out, like was done here, dealing with ? : is a pain to > read and follow and the generated code should be identical. > > Only use ? : in places where it's the only way to do it (i.e. as > function parameters or in printk-like lines.) > > Write for people first, compilers second. Okay understood, I will keep this in mind from now on. Thanks. Tony, Please feel free to take my R-by and ignore this suggestion as per Greg's comments. -- Best regards, Dhruva