Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp989519rwo; Wed, 2 Aug 2023 07:13:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlGDQGJLon4FlH1kupurbxgU91cjVv8BHaAWSripnqK7k9Bouvub4N7K9hYjmbP2rKAHhZ2a X-Received: by 2002:a17:902:e744:b0:1b2:5d5b:e871 with SMTP id p4-20020a170902e74400b001b25d5be871mr16588038plf.59.1690985593984; Wed, 02 Aug 2023 07:13:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690985593; cv=none; d=google.com; s=arc-20160816; b=K7zHOhUpXf2eJp10BjMi+wKz9g3eSfh8hfpYOt97oDvwElXShgnghEcdNndhBDFN5q YAOMJQX93u3d9Dm1vbs7KjEFqwXI7nq8tus/bn1ANGsEUqqe2PyZzXxq0h7/oRIMVx3e GDC2QRaZc58rFeaXAUrWBGJC/WP5WR/JNZY4v0ij+jQpv2PGRzi3rNfY4n7YhmtX51A+ bVr8WRm7B8MJ6DLw13xOjho8CDBRKJvsGWfI/4QLlc7p3+zg1SFNMrIhh4IvVeheZ3kX m6H9GXkQ0TvEQL1b34My08ftyl2Bct8Q2wm/zSo4Y/EhW7BLwB2/rpfy5o7HONdWy6pK 1VUw== 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=oAtCV5XCE/clZ+bIYntG7wH+3fgdz+zfHQPF1cvxQsg=; fh=IoZfEkzZyABNTsUD0pSZNofMhfGvgK+rmQCkYX1I2/o=; b=W8fIyHphBHhr2zMVPcanzTNBWBJVPu8NzD4xGxEKE5ScoTRl9RB1xyKjdVnrrUesKG +agHI9GYNIP8B8LMkOSOAJjDSQ03AYfJSSIC+AsSxuSLp7aJ6iStVUesfh9/ViXUXTR4 LevDviOJYscU3j82dEWPFopdyUu4I+7mTz4otFp5C1EC5vqj7xNRIOf5XiW906sC9adk 0IVTSrhIH0Sk0rMgmYvMxGQMq4ZF9W+0aT2GF84j/MaPqzRubsQeDWSFwOgngc6xixJs vyrJuTA9cxrRVsmOFcwuRghm5qH8Jl3MAxHGRqX43R79XgHOIF9u03ZQLvOW/b7z7v5a q7eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=m1UFG7hy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w5-20020a1709029a8500b001b3414a1fa9si10858806plp.175.2023.08.02.07.13.01; Wed, 02 Aug 2023 07:13:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=m1UFG7hy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232871AbjHBNsv (ORCPT + 99 others); Wed, 2 Aug 2023 09:48:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234359AbjHBNsk (ORCPT ); Wed, 2 Aug 2023 09:48:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD914273A; Wed, 2 Aug 2023 06:48:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 52967619A9; Wed, 2 Aug 2023 13:48:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DCC6C433C7; Wed, 2 Aug 2023 13:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1690984108; bh=i9DyNAh7y5hCfZqptvO1Qy2evQkU5TYUhB7k2ccVuvI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=m1UFG7hyap2QR4xlFhlM0wE0AgW7J1gfeazMROK/+2QwzlhBhbG2XYniYY9hIGH5h OM/GLSP64vuDOXGf4HtEOrjRlo26D0ddLIhKSuS1g7MVAzLhgy1As2F9rb5juKG21n u+WYb2XqnN8H9w2KNWyArgLi/RwBcr3RIBEokcFQ= Date: Wed, 2 Aug 2023 15:48:26 +0200 From: Greg Kroah-Hartman To: Tony Lindgren Cc: Jiri Slaby , Andy Shevchenko , Andy Shevchenko , Dhruva Gole , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , John Ogness , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, kernel test robot Subject: Re: [PATCH] serial: core: Fix serial_base_match() after fixing controller port name Message-ID: <2023080224-nutrient-regress-c95e@gregkh> References: <20230802114846.21899-1-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230802114846.21899-1-tony@atomide.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 02, 2023 at 02:48:43PM +0300, Tony Lindgren wrote: > While fixing DEVNAME to be more usable, I broke serial_base_match() as > the ctrl and port prefix for device seemed unnecessary. > > Let's fix the issue by checking against dev->type and drv->name. > > Fixes: 1ef2c2df1199 ("serial: core: Fix serial core controller port name to show controller id") > Reported-by: kernel test robot > Signed-off-by: Tony Lindgren > --- > drivers/tty/serial/serial_base.h | 3 +++ > drivers/tty/serial/serial_base_bus.c | 10 ++++++++-- > drivers/tty/serial/serial_ctrl.c | 2 +- > drivers/tty/serial/serial_port.c | 2 +- > 4 files changed, 13 insertions(+), 4 deletions(-) > > diff --git a/drivers/tty/serial/serial_base.h b/drivers/tty/serial/serial_base.h > --- a/drivers/tty/serial/serial_base.h > +++ b/drivers/tty/serial/serial_base.h > @@ -6,6 +6,9 @@ > * Author: Tony Lindgren > */ > > +#define SERIAL_BASE_CTRL_NAME "ctrl" > +#define SERIAL_BASE_PORT_NAME "port" > + > #define to_serial_base_ctrl_device(d) container_of((d), struct serial_ctrl_device, dev) > #define to_serial_base_port_device(d) container_of((d), struct serial_port_device, dev) > > diff --git a/drivers/tty/serial/serial_base_bus.c b/drivers/tty/serial/serial_base_bus.c > --- a/drivers/tty/serial/serial_base_bus.c > +++ b/drivers/tty/serial/serial_base_bus.c > @@ -29,9 +29,15 @@ static const struct device_type serial_port_type = { > > static int serial_base_match(struct device *dev, struct device_driver *drv) > { > - int len = strlen(drv->name); > + if (dev->type == &serial_ctrl_type && > + !strncmp(SERIAL_BASE_CTRL_NAME, drv->name, 4)) maybe: !strncmp(SERIAL_BASE_CTRL_NAME, drv->name, strlen(SERIAL_BASE_CTRL_NAME)) as "4" is a magic number :) thanks, greg k-h