From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (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 1028E185935; Mon, 23 Dec 2024 20:23:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734985429; cv=none; b=sYix/QnUH+A46CvoRiuEMhylmiZuqgwPTF+hlQQe5nFqm9i4TXLeRexIBocJWg72+efL9I2f7BCn8D7xeLdldsk9dW33DNNIeYsT18zjzzHe4lIi9GJkOawO/6O0EnWBUKtlT4DfuQibOKKwqKtt6j7Rgq7uHkgHXTu7uWWxRcM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734985429; c=relaxed/simple; bh=EhpspA5sajDc9hrd86Als7SI/ixPtGf9S25wwVgK7Us=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nVqykMc1gJDOxL6lVugBKlRJbtGQTVHNprYA8GCuQTsXSHzoRbjDrRJjATLITFV4oEblTvfOO5jIIx7VgLkrzLh2GurveZovKTdB6Mel7SqXi3gw7GW1Xv9DqCsD/X7RgVFgP/S/I6jTATf/Lpp1ZfFoA2SgYzJZF+QkG0IeXHg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com 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) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml100001.china.huawei.com (7.191.160.183) To frapeml500008.china.huawei.com (7.182.85.71) 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)); >