Message ID | 202211171530030836446@zte.com.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp261113wrr; Wed, 16 Nov 2022 23:33:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf5E1CHhGK40z97v4SnYgnj6KyAqfHtvsuJ8cnSEvaEBy4dyT0kKWiNhkdkfkuFMpAcVbxas X-Received: by 2002:a17:907:270e:b0:78d:3c82:a875 with SMTP id w14-20020a170907270e00b0078d3c82a875mr1136723ejk.465.1668670412185; Wed, 16 Nov 2022 23:33:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668670412; cv=none; d=google.com; s=arc-20160816; b=nzARV4Cm+HQMgfirfoDagA5rJ02hMsz65l/rwRxZja5Ootc+qCnDK/gIlJOWcBqWbk SP1aXdHvckqMvdAhl2q7Jw1iVE2i69AKWnOyW3R0Ci+2o0r4prvZJW3sLfcXfYDD7RAy c5QeJCUcE1iM8kxQIrHjJjLEyrIkoopUeL9FW/22EfF8MIAaEMgUxdbD7P446kwDMw8L heobAD/vSVsUfVTQSdkSVM1LrW5iAusiuFNEBB6gBE/b2VUGeACNEEJSPEM99mtoEGaC WoGjyXWJ8Z/Jr8qI6bgRh3jiNs4DWpkhlrYdbFfa4Ja7scEA2BGrFgZCLufRzX2SMBDJ +tog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=c3JbcHSjPV1gltg7eU3qeLsq1mO21jt6gzl20VcYZMw=; b=DibAsMeFkp+yqqKeU3msqLB2YJnEM08mIQbkzMzFDSXUKRMiXTVW+/GEa14b0jROoM 5nahrDLA51XYAtg8Ko17xGqf6wyGd4/h2YA+AyXG7RSsl/CVc7imlnEENLsHdVwy6d7B hrOql2HV0wOU9HhtzGjTnMRqQj82Brrqe74Ql5CICZT2BeNoNaeOuTy174DhegnOzDVb O9dFrLDtW3u8zqa7fObhwdPIF+oi0rsRGpPp0Wb6OQTZDd3QgertqhxxSmhOmPA21v/i /fK6janZWNYIEDHYckSM4uORMSFUoJZaH66EZJDqe9xJNgonivLSIqixP4Rt1Vcpa/AH 28dQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z2-20020a1709063ac200b00787aba35b7asi14053ejd.102.2022.11.16.23.33.09; Wed, 16 Nov 2022 23:33:32 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239337AbiKQHaM (ORCPT <rfc822;just.gull.subs@gmail.com> + 99 others); Thu, 17 Nov 2022 02:30:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239319AbiKQHaL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 17 Nov 2022 02:30:11 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FAC729824 for <linux-kernel@vger.kernel.org>; Wed, 16 Nov 2022 23:30:10 -0800 (PST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4NCWlh5S5Tz4y0vM; Thu, 17 Nov 2022 15:30:08 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl2.zte.com.cn with SMTP id 2AH7U1AM099425; Thu, 17 Nov 2022 15:30:01 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Thu, 17 Nov 2022 15:30:03 +0800 (CST) Date: Thu, 17 Nov 2022 15:30:03 +0800 (CST) X-Zmail-TransId: 2af96375e2fbffffffff94654c76 X-Mailer: Zmail v1.0 Message-ID: <202211171530030836446@zte.com.cn> Mime-Version: 1.0 From: <ye.xingchen@zte.com.cn> To: <sre@kernel.org> Cc: <linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: =?utf-8?q?=5BPATCH_linux-next=5D_power=3A_supply=3A_core=3A_Use_dev?= =?utf-8?q?ice=5Fmatch=5Fof=5Fnode=28=29?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl2.zte.com.cn 2AH7U1AM099425 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.251.13.novalocal with ID 6375E300.001 by FangMail milter! X-FangMail-Envelope: 1668670208/4NCWlh5S5Tz4y0vM/6375E300.001/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/<ye.xingchen@zte.com.cn> X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 6375E300.001/4NCWlh5S5Tz4y0vM X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749727746166627969?= X-GMAIL-MSGID: =?utf-8?q?1749727746166627969?= |
Series |
[linux-next] power: supply: core: Use device_match_of_node()
|
|
Commit Message
ye.xingchen@zte.com.cn
Nov. 17, 2022, 7:30 a.m. UTC
From: ye xingchen <ye.xingchen@zte.com.cn> Replace the open-code with device_match_of_node(). Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> --- drivers/power/supply/power_supply_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi, Thank you for the patch! Yet something to improve: [auto build test ERROR on next-20221116] url: https://github.com/intel-lab-lkp/linux/commits/ye-xingchen-zte-com-cn/power-supply-core-Use-device_match_of_node/20221117-153158 patch link: https://lore.kernel.org/r/202211171530030836446%40zte.com.cn patch subject: [PATCH linux-next] power: supply: core: Use device_match_of_node() config: hexagon-buildonly-randconfig-r003-20221117 compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project bbe6bd724a6335e497c7edaed191d37a828d0390) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/894b25157cccad0781bd21bf3990c9f1b51bb6ac git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review ye-xingchen-zte-com-cn/power-supply-core-Use-device_match_of_node/20221117-153158 git checkout 894b25157cccad0781bd21bf3990c9f1b51bb6ac # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/power/supply/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): >> drivers/power/supply/power_supply_core.c:206:27: error: incompatible pointer types passing 'struct power_supply *' to parameter of type 'struct device *' [-Werror,-Wincompatible-pointer-types] if (device_match_of_node(epsy, np)) ^~~~ include/linux/compiler.h:56:47: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^~~~ include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~ include/linux/device/bus.h:145:41: note: passing argument to parameter 'dev' here int device_match_of_node(struct device *dev, const void *np); ^ >> drivers/power/supply/power_supply_core.c:206:27: error: incompatible pointer types passing 'struct power_supply *' to parameter of type 'struct device *' [-Werror,-Wincompatible-pointer-types] if (device_match_of_node(epsy, np)) ^~~~ include/linux/compiler.h:56:47: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^~~~ include/linux/compiler.h:58:61: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~ include/linux/device/bus.h:145:41: note: passing argument to parameter 'dev' here int device_match_of_node(struct device *dev, const void *np); ^ >> drivers/power/supply/power_supply_core.c:206:27: error: incompatible pointer types passing 'struct power_supply *' to parameter of type 'struct device *' [-Werror,-Wincompatible-pointer-types] if (device_match_of_node(epsy, np)) ^~~~ include/linux/compiler.h:56:47: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^~~~ include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~ include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value' (cond) ? \ ^~~~ include/linux/device/bus.h:145:41: note: passing argument to parameter 'dev' here int device_match_of_node(struct device *dev, const void *np); ^ 3 errors generated. vim +206 drivers/power/supply/power_supply_core.c 198 199 static int __power_supply_find_supply_from_node(struct device *dev, 200 void *data) 201 { 202 struct device_node *np = data; 203 struct power_supply *epsy = dev_get_drvdata(dev); 204 205 /* returning non-zero breaks out of class_for_each_device loop */ > 206 if (device_match_of_node(epsy, np)) 207 return 1; 208 209 return 0; 210 } 211
Hi, On Thu, Nov 17, 2022 at 03:30:03PM +0800, ye.xingchen@zte.com.cn wrote: > From: ye xingchen <ye.xingchen@zte.com.cn> > > Replace the open-code with device_match_of_node(). > > Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> > --- struct power_supply != struct device -- Sebastian > drivers/power/supply/power_supply_core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c > index 9035e349bf53..46d0cb0c5026 100644 > --- a/drivers/power/supply/power_supply_core.c > +++ b/drivers/power/supply/power_supply_core.c > @@ -203,7 +203,7 @@ static int __power_supply_find_supply_from_node(struct device *dev, > struct power_supply *epsy = dev_get_drvdata(dev); > > /* returning non-zero breaks out of class_for_each_device loop */ > - if (epsy->of_node == np) > + if (device_match_of_node(epsy, np)) > return 1; > > return 0; > -- > 2.25.1
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index 9035e349bf53..46d0cb0c5026 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -203,7 +203,7 @@ static int __power_supply_find_supply_from_node(struct device *dev, struct power_supply *epsy = dev_get_drvdata(dev); /* returning non-zero breaks out of class_for_each_device loop */ - if (epsy->of_node == np) + if (device_match_of_node(epsy, np)) return 1; return 0;