Message ID | 202211171548066327249@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 q4csp266900wrr; Wed, 16 Nov 2022 23:53:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf5KtkA4r9Ve8FlVTvNAqkQ1Q+ZyGaHjyjnqTOIF8g4dp4XA5re5v2wnYSJ0LSXhQKoJw+7V X-Received: by 2002:a17:906:a157:b0:7a5:7e25:5b11 with SMTP id bu23-20020a170906a15700b007a57e255b11mr1130106ejb.254.1668671623042; Wed, 16 Nov 2022 23:53:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668671623; cv=none; d=google.com; s=arc-20160816; b=nwmKhouJbBiWAuJe8Zaik8ZRVqjirjvzi4TsUJxNBmFfalsvhsNkCTwndq3yV3NiwC WTb9awVgRboQ7zZ4Ucm9JLTyjwvn91APy1dUQns9ryz/CH8FUjyDDW969Z+o3ymBueOZ W7mA+7rZadccgNLdUbN/cRGbOQKnUjd1KpnZSFmowc2w8i5D0DUhCw2a7pmXBRY1aXZe ohW6eZ4f6G+fImkd/3YWHrJNQQZ76rWMVJft0dwgT8o8XWqIi2Cokai3LFyyB7WlYhne JXZ5RSAlUsHkSNEjRZVn0h+/u2ro4lHe7ihIK8KYqNvEX7rf7HZwRynXMf3pWRLm3/Yx Escw== 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=TZrVaCXMtdyt00kxgbLvhw/WVGnEIYpG0D6aWowNtCo=; b=xJAnh4ctdCQ0qnwvGLa75Elj4SGucrdqlZ5+BNsSlah9rlslNmaprnb5gXwNo/F2Yx 1WJhtyG69gKM3o8H471Dq7FWrn/9tDfMvIDGWuiAdNQ+8N4BNqm3ZQFALk6Uc8dTKWWe 0wUYr2QogY/091TFZejZKGhB9F1G3IPn96uMxysNxrSoXjqKpA55MRR/fy5CoZtNmtqN ORy2ZqNCRD2MEFsmJNoJn/QrRa+/hyviac6WjcMsQ/GQPUhseGtmYU8kcP1Ffd02K3T9 H7xwU/qIq6jlbfoq2rQd3x47hff2uOWQxmJ2UvAegkmjB72sYt2PSJ/t5zkBYL1J1ZqZ 5vBg== 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 y6-20020a056402358600b004642b0f2357si343886edc.589.2022.11.16.23.53.19; Wed, 16 Nov 2022 23:53:43 -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 S239395AbiKQHsP (ORCPT <rfc822;anhang610@gmail.com> + 99 others); Thu, 17 Nov 2022 02:48:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234715AbiKQHsN (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 17 Nov 2022 02:48:13 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6119B4AF3D; Wed, 16 Nov 2022 23:48:12 -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 mxhk.zte.com.cn (FangMail) with ESMTPS id 4NCX8V6xM3z8R03d; Thu, 17 Nov 2022 15:48:10 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl2.zte.com.cn with SMTP id 2AH7m4wx022774; Thu, 17 Nov 2022 15:48:05 +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:48:06 +0800 (CST) Date: Thu, 17 Nov 2022 15:48:06 +0800 (CST) X-Zmail-TransId: 2af96375e73619689491 X-Mailer: Zmail v1.0 Message-ID: <202211171548066327249@zte.com.cn> Mime-Version: 1.0 From: <ye.xingchen@zte.com.cn> To: <agross@kernel.org> Cc: <andersson@kernel.org>, <konrad.dybcio@linaro.org>, <linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: =?utf-8?q?=5BPATCH_linux-next=5D_soc=3A_qcom=3A_smem=5Fstate=3A_Use?= =?utf-8?q?_device=5Fmatch=5Fof=5Fnode=28=29?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl2.zte.com.cn 2AH7m4wx022774 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.137.novalocal with ID 6375E73A.003 by FangMail milter! X-FangMail-Envelope: 1668671290/4NCX8V6xM3z8R03d/6375E73A.003/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: 6375E73A.003/4NCX8V6xM3z8R03d X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, 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?1749729015864202832?= X-GMAIL-MSGID: =?utf-8?q?1749729015864202832?= |
Series |
[linux-next] soc: qcom: smem_state: Use device_match_of_node()
|
|
Commit Message
ye.xingchen@zte.com.cn
Nov. 17, 2022, 7:48 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/soc/qcom/smem_state.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/soc-qcom-smem_state-Use-device_match_of_node/20221117-154927 patch link: https://lore.kernel.org/r/202211171548066327249%40zte.com.cn patch subject: [PATCH linux-next] soc: qcom: smem_state: Use device_match_of_node() config: ia64-randconfig-r001-20221117 compiler: ia64-linux-gcc (GCC) 12.1.0 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/4591339dd50eaf6b514f1994b2cc54d7ac3c5cd2 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review ye-xingchen-zte-com-cn/soc-qcom-smem_state-Use-device_match_of_node/20221117-154927 git checkout 4591339dd50eaf6b514f1994b2cc54d7ac3c5cd2 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/soc/qcom/ 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/soc/qcom/smem_state.c: In function 'of_node_to_state': >> drivers/soc/qcom/smem_state.c:66:42: error: passing argument 1 of 'device_match_of_node' from incompatible pointer type [-Werror=incompatible-pointer-types] 66 | if (device_match_of_node(state, np)) { | ^~~~~ | | | struct qcom_smem_state * In file included from include/linux/device.h:30, from drivers/soc/qcom/smem_state.c:6: include/linux/device/bus.h:145:41: note: expected 'struct device *' but argument is of type 'struct qcom_smem_state *' 145 | int device_match_of_node(struct device *dev, const void *np); | ~~~~~~~~~~~~~~~^~~ cc1: some warnings being treated as errors vim +/device_match_of_node +66 drivers/soc/qcom/smem_state.c 58 59 static struct qcom_smem_state *of_node_to_state(struct device_node *np) 60 { 61 struct qcom_smem_state *state; 62 63 mutex_lock(&list_lock); 64 65 list_for_each_entry(state, &smem_states, list) { > 66 if (device_match_of_node(state, np)) { 67 kref_get(&state->refcount); 68 goto unlock; 69 } 70 } 71 state = ERR_PTR(-EPROBE_DEFER); 72 73 unlock: 74 mutex_unlock(&list_lock); 75 76 return state; 77 } 78
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/soc-qcom-smem_state-Use-device_match_of_node/20221117-154927 patch link: https://lore.kernel.org/r/202211171548066327249%40zte.com.cn patch subject: [PATCH linux-next] soc: qcom: smem_state: Use device_match_of_node() config: arm-defconfig 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 # install arm cross compiling tool for clang build # apt-get install binutils-arm-linux-gnueabi # https://github.com/intel-lab-lkp/linux/commit/4591339dd50eaf6b514f1994b2cc54d7ac3c5cd2 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review ye-xingchen-zte-com-cn/soc-qcom-smem_state-Use-device_match_of_node/20221117-154927 git checkout 4591339dd50eaf6b514f1994b2cc54d7ac3c5cd2 # 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=arm SHELL=/bin/bash drivers/soc/qcom/ 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/soc/qcom/smem_state.c:66:28: error: incompatible pointer types passing 'struct qcom_smem_state *' to parameter of type 'struct device *' [-Werror,-Wincompatible-pointer-types] if (device_match_of_node(state, np)) { ^~~~~ 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); ^ 1 error generated. vim +66 drivers/soc/qcom/smem_state.c 58 59 static struct qcom_smem_state *of_node_to_state(struct device_node *np) 60 { 61 struct qcom_smem_state *state; 62 63 mutex_lock(&list_lock); 64 65 list_for_each_entry(state, &smem_states, list) { > 66 if (device_match_of_node(state, np)) { 67 kref_get(&state->refcount); 68 goto unlock; 69 } 70 } 71 state = ERR_PTR(-EPROBE_DEFER); 72 73 unlock: 74 mutex_unlock(&list_lock); 75 76 return state; 77 } 78
On Thu, Nov 17, 2022 at 03:48:06PM +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> > --- > drivers/soc/qcom/smem_state.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/soc/qcom/smem_state.c b/drivers/soc/qcom/smem_state.c > index e848cc9a3cf8..a7844841a727 100644 > --- a/drivers/soc/qcom/smem_state.c > +++ b/drivers/soc/qcom/smem_state.c > @@ -63,7 +63,7 @@ static struct qcom_smem_state *of_node_to_state(struct device_node *np) > mutex_lock(&list_lock); > > list_for_each_entry(state, &smem_states, list) { > - if (state->of_node == np) { > + if (device_match_of_node(state, np)) { I don't find this form easier to read, nor is state a struct device *... Regards, Bjorn > kref_get(&state->refcount); > goto unlock; > } > -- > 2.25.1
diff --git a/drivers/soc/qcom/smem_state.c b/drivers/soc/qcom/smem_state.c index e848cc9a3cf8..a7844841a727 100644 --- a/drivers/soc/qcom/smem_state.c +++ b/drivers/soc/qcom/smem_state.c @@ -63,7 +63,7 @@ static struct qcom_smem_state *of_node_to_state(struct device_node *np) mutex_lock(&list_lock); list_for_each_entry(state, &smem_states, list) { - if (state->of_node == np) { + if (device_match_of_node(state, np)) { kref_get(&state->refcount); goto unlock; }