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 97799EDEC49 for ; Wed, 13 Sep 2023 12:15:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234499AbjIMMPi (ORCPT ); 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-serial@vger.kernel.org * 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