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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 175F1E7718B for ; Mon, 23 Dec 2024 20:23:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:CC:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=joTQVhw7DCCRp8EpMFoM40xxXcRkgfGLbmT/Iwf5V5Y=; b=Kn1u/hrwxs5gxCPAaUrh7kL7YS cWZFXhUDooQG0Rrd9BRRVR+d28X8V8eJpj5Gl1z3VVj3JWwOrK75za64XroGBjGXvC1r4Y5mK4WBT MVfDyMFJu0ZAyLtLJ+Ibbnv+92dwDdQvE5Zhd17kEPESh9kwFf2+SMSYstBftY7zZWLinqaMHtx6t Lh6uBKE2Pgflhjk4HBcWP81dge+dW71bvI0wzfu4kWFbuF8/SyhdtwHsQBBhDVYV4NiMnaF2LsVbe fokqJIR938m9uiL5PiEg+c/fIH9nLFEjmsBKaRAcOyMWlSF6xos0oigF8WeAJq7gXV6qM1a921u03 bsZUP/cg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tPoy3-0000000AgfQ-2ubu; Mon, 23 Dec 2024 20:23:55 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tPoy0-0000000Agel-10wt for linux-mediatek@lists.infradead.org; Mon, 23 Dec 2024 20:23:53 +0000 Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4YH8Wr3bFBz6K5cM; Tue, 24 Dec 2024 04:19:52 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id 6DB69140B3C; Tue, 24 Dec 2024 04:23:43 +0800 (CST) Received: from localhost (10.47.75.118) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 23 Dec 2024 21:23:41 +0100 Date: Mon, 23 Dec 2024 20:23:39 +0000 From: Jonathan Cameron To: Zijun Hu CC: Greg Kroah-Hartman , Linus Walleij , Bartosz Golaszewski , Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= , James Bottomley , Thomas =?ISO-8859-1?Q?Wei=DFschu?= =?ISO-8859-1?Q?h?= , , , , , , , , , , , , , , , , , , , , , Zijun Hu , "Alison Schofield" Subject: Re: [PATCH v4 01/11] libnvdimm: Replace namespace_match() with device_find_child_by_name() Message-ID: <20241223202339.00004dc1@huawei.com> In-Reply-To: <20241211-const_dfc_done-v4-1-583cc60329df@quicinc.com> References: <20241211-const_dfc_done-v4-0-583cc60329df@quicinc.com> <20241211-const_dfc_done-v4-1-583cc60329df@quicinc.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.75.118] X-ClientProxiedBy: lhrpeml100001.china.huawei.com (7.191.160.183) To frapeml500008.china.huawei.com (7.182.85.71) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241223_122352_439290_00AEEA5B X-CRM114-Status: GOOD ( 11.46 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Wed, 11 Dec 2024 08:08:03 +0800 Zijun Hu wrote: > From: Zijun Hu > > Simplify nd_namespace_store() implementation by > using device_find_child_by_name(). > > Reviewed-by: Alison Schofield > Signed-off-by: Zijun Hu LGTM Reviewed-by: Jonathan Cameron > --- > drivers/nvdimm/claim.c | 9 +-------- > 1 file changed, 1 insertion(+), 8 deletions(-) > > diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c > index 030dbde6b0882050c90fb8db106ec15b1baef7ca..9e84ab411564f9d5e7ceb687c6491562564552e3 100644 > --- a/drivers/nvdimm/claim.c > +++ b/drivers/nvdimm/claim.c > @@ -67,13 +67,6 @@ bool nd_attach_ndns(struct device *dev, struct nd_namespace_common *attach, > return claimed; > } > > -static int namespace_match(struct device *dev, void *data) > -{ > - char *name = data; > - > - return strcmp(name, dev_name(dev)) == 0; > -} > - > static bool is_idle(struct device *dev, struct nd_namespace_common *ndns) > { > struct nd_region *nd_region = to_nd_region(dev->parent); > @@ -168,7 +161,7 @@ ssize_t nd_namespace_store(struct device *dev, > goto out; > } > > - found = device_find_child(dev->parent, name, namespace_match); > + found = device_find_child_by_name(dev->parent, name); > if (!found) { > dev_dbg(dev, "'%s' not found under %s\n", name, > dev_name(dev->parent)); >