Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3201400rdb; Wed, 13 Sep 2023 05:27:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFSkpwYYImf2Y88XXEVyhXibort/2r4TukoAVNsoHPN9ruU+dCh/N+FoRxBRA+dEKPWGIAU X-Received: by 2002:a05:6a00:2e9e:b0:68a:3b39:a486 with SMTP id fd30-20020a056a002e9e00b0068a3b39a486mr2777384pfb.24.1694608074812; Wed, 13 Sep 2023 05:27:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694608074; cv=none; d=google.com; s=arc-20160816; b=hHYHANaflUUJFoF5EmSlST0GZx+IRKzLf9mTjUmqfd4i+suMCerQ8lFYyHny4JEn33 kV0j+ayCahrmUK2QKkrWsu0quiHncvR3utSHMkytkgotZe+QfQsDlsXD6n19AnXWTiU8 PwNmeJIKeyI32DedOVuSinkid5BzEzWqjRrSrayiyN6m9Wn5pX3wF34ceIChYkEdk9Pe TmGX36+7SNb1Llj2iz7nX+itpYJhRiEjsdWnfmbH70oesQmbTDCWt4VM1e0U+Cr8WfCg hjpasHCJyhjBwPdk917AHQMCJG4ZBS7Kh1CvY9NIpu4C9p8xvKwJ/l9reh1E2uhu1Xcs QTnQ== 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; bh=yns9Sbdo+gr8dH+xzBUaRierxGe9yH2Awcp/18IpdXM=; fh=gFh8wzz1EtzIJzWIhmT7Zxq7qH+PPH1MZmIY+vy1JdM=; b=Qq5279PN4OZKDtfE0oHvT5Iqct7X02VNpaTBwsHNyI6fX7AcmtdPVX/G1EcBt3M1sF 8Hp+vfOR9d7At3XNNbd2mK//4cjmyL7k1/u789J3G/AWOqOIz9qvbp8LdSM5XsYztac2 xvH2Wmv+6rmAH7Wj9aoytTvkeQyGRTl4MN4MZoHJQMv/H8/EM2zjEnSjNGiRtc7OOyuP P4djZ5tat5A/qMMjOk5b5/ijFFMFJb68o6UzHZmaCVo60dVYldCA66cqA4a+czn6MCs1 HwfF8B33rVzqFf26BQYeaItrZ0o2Se8vzrS/ST3pWZ4SSe09aQzaasRYP+CwI8wlbJSK g4hg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id ds12-20020a056a004acc00b0068bc0b772d8si9669453pfb.194.2023.09.13.05.27.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 05:27:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 318DF81BEC8E; Wed, 13 Sep 2023 05:15:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240324AbjIMMPi (ORCPT + 99 others); Wed, 13 Sep 2023 08:15:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231615AbjIMMPi (ORCPT ); Wed, 13 Sep 2023 08:15:38 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8DA5719A8; Wed, 13 Sep 2023 05:15:34 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id D44208088; Wed, 13 Sep 2023 12:15:33 +0000 (UTC) Date: Wed, 13 Sep 2023 15:15:32 +0300 From: Tony Lindgren To: Andy Shevchenko Cc: Greg Kroah-Hartman , Jiri Slaby , Dhruva Gole , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , John Ogness , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [PATCH v2 2/3] serial: core: Add support for DEVNAME:0.0 style naming for kernel console Message-ID: <20230913121532.GJ5285@atomide.com> References: <20230912110350.14482-1-tony@atomide.com> <20230912110350.14482-3-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 (morse.vger.email [0.0.0.0]); Wed, 13 Sep 2023 05:15:39 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=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 morse.vger.email * Andy Shevchenko [230912 15:07]: > On Tue, Sep 12, 2023 at 02:03:44PM +0300, Tony Lindgren wrote: > > +static LIST_HEAD(serial_base_consoles); > > Don't you need a locking to access this list? > If not, perhaps a comment why it's okay? It's updated at arch_initcall() time only, I'll add a comment. > > + port_match = kasprintf(GFP_KERNEL, "%s:%i.%i", dev_name(port->dev), > > + port->ctrl_id, port->port_id); > > What about starting using cleanup.h? OK seems to simplify things nicely :) > > +EXPORT_SYMBOL_GPL(serial_base_add_preferred_console); > > Can we use (start using) namespaced exports? Sorry forgot about the namespace stuff already.. > ... > > > +static int __init serial_base_add_con(char *name, char *opt) > > const name > const opt > ? For name yes, opt has issues as noted in the first patch in this series. > > + opt = strchr(val, ','); > > + if (opt) { > > + opt[0] = '\0'; > > + opt++; > > + } > > strsep() ? > > Actually param_array() uses strcspn() in similar situation. OK I'll change to use strcspn(). > > + if (!strlen(val)) > > + return 0; > > Btw, have you seen lib/cmdline.c? Can it be helpful here? I don't think so as at this point we don't have param=value pairs and param is the port name. Will fix up the rest of the stuff you commented too thanks. Regards, Tony