Message ID | 20230310144729.1545943-1-robh@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp950531wrd; Fri, 10 Mar 2023 07:58:35 -0800 (PST) X-Google-Smtp-Source: AK7set9n2xFnQ0l9ekPmZGl1Szb0rrfqeV8YpGRi8aKo5bMJ0UGeoZWTYBtJqOslhcU7Ka6z6JZR X-Received: by 2002:a05:6a21:329b:b0:cc:c80f:fa6b with SMTP id yt27-20020a056a21329b00b000ccc80ffa6bmr29791549pzb.27.1678463915539; Fri, 10 Mar 2023 07:58:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678463915; cv=none; d=google.com; s=arc-20160816; b=ZhG/A9yDaacyBIXPkLzYD385FqO3m2+bJsvQdWsJ/kReihQSaTpqB6FdF6fw3GmcNt hDvJCKsO308uChWGO2SoCpMOO1tfvOWF2S9hSBiizmo6dLmCxtoqNuVljIdgUCMaE+IP wQpNv1TpZv6UaHWS6e+nIj91IQ+gxc6TrIWWt0Ty2ZJ7URUTCJBb3hyks5QCnHBlRdYH lQsiDk/otpQvm2BlxUqsaT8tJxqW85UIY4lFFRKvd51VDi1bsjk15oz8YDmZPfMyUBJs a8ouTvZOUMJG58mjco/wBxUZ7z2MinnebZSP5qsRBiDUgmx9ILUY8Z9xjanaMz0cNhku JM9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=5ABh9MagjDNyGivJ3oT/1DUZHeIg4J1qNxCI1uEPy4Q=; b=Uozu7z1fTQeguBBHNxo4KBSP1V9p2wVjgK4MDERL9lQXm15FKRorj3H/xizJSzyp4O odu/C3vdQ5bR1ys8VYQFN25mN7mBKRPGoYfjdo839EXcjbBnC99z3pR+Mgus+d72z8kE 9cFQx8yNDBS2xEMAx8L93ZXQNMzGKtq7UNE7A4nAFNU4v1b1ime1kIz7hu2wjiqY6ABM LA/AFe19ILBsq3hA2woEHY6RWw3x/Ctc31lDOBqnBBsUMiW2G/hrjprgMB538NMsD0k/ Kd5nDhoTRwKstGj5Kk5Y+SsAA8sMb/EbsQpe0Va4lSUHEK4XGbMSb+Eny2igIfbZ2HOo yPDA== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z18-20020a630a52000000b004fb6f75e659si122304pgk.481.2023.03.10.07.58.21; Fri, 10 Mar 2023 07:58:35 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233554AbjCJOxy (ORCPT <rfc822;carlos.wei.hk@gmail.com> + 99 others); Fri, 10 Mar 2023 09:53:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233403AbjCJOx2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 10 Mar 2023 09:53:28 -0500 Received: from mail-oa1-f49.google.com (mail-oa1-f49.google.com [209.85.160.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B67B125AF9; Fri, 10 Mar 2023 06:49:27 -0800 (PST) Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-17671fb717cso6053250fac.8; Fri, 10 Mar 2023 06:49:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678459709; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5ABh9MagjDNyGivJ3oT/1DUZHeIg4J1qNxCI1uEPy4Q=; b=xduS1bTaK+w0+UU0Zy70jd4Utq3VZsmT4t/6+RVgE2t9PaaGgjQAyrCJ1sfaMNbzsN ETnHC6owPUuov1UUWfS30ivGbsOaFWv57M0/CvqxTyIgbQH9cGqdaF88er+Ix5e8g6s4 VNE8Yc8f4xZ6GOJ0uYhdeKHy8045VQtenTbWeGe8Y8bqYdgZuubm1DvWqHlIUJ1jJ/xX 2FnX3Gvaiaxe5hlNuYAH1E/yT4iuJN12H//Iuh0IAMYpg1+rA4R/PxcnWUIKxSxKjSx5 +qF1KVGcHB/wwTtV0QCJ4smmaVhmKMm9o1K+qwggIOI2ljGM9pHSQW747ttMWwLQ/Mb1 1m7Q== X-Gm-Message-State: AO0yUKVNpG0riEZo8LJljPV2I/in+4lScZ/rAT/MKVC6Sa4T6QIrdJpK ydU291gcQeOIebN7cJjhCA== X-Received: by 2002:a05:6870:a68c:b0:16e:8d40:b5ec with SMTP id i12-20020a056870a68c00b0016e8d40b5ecmr16859362oam.50.1678459708772; Fri, 10 Mar 2023 06:48:28 -0800 (PST) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id z21-20020a056870515500b001728d38a41asm71779oak.55.2023.03.10.06.48.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 06:48:28 -0800 (PST) Received: (nullmailer pid 1545988 invoked by uid 1000); Fri, 10 Mar 2023 14:47:29 -0000 From: Rob Herring <robh@kernel.org> To: Russell King <linux@armlinux.org.uk>, Helge Deller <deller@gmx.de> Cc: devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH] fbdev: Use of_property_present() for testing DT property presence Date: Fri, 10 Mar 2023 08:47:29 -0600 Message-Id: <20230310144729.1545943-1-robh@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no 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?1759996978865381044?= X-GMAIL-MSGID: =?utf-8?q?1759996978865381044?= |
Series |
fbdev: Use of_property_present() for testing DT property presence
|
|
Commit Message
Rob Herring
March 10, 2023, 2:47 p.m. UTC
It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties. As
part of this, convert of_get_property/of_find_property calls to the
recently added of_property_present() helper when we just want to test
for presence of a property and nothing more.
Signed-off-by: Rob Herring <robh@kernel.org>
---
drivers/video/fbdev/amba-clcd.c | 2 +-
drivers/video/fbdev/bw2.c | 2 +-
drivers/video/fbdev/cg3.c | 2 +-
drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
Comments
Hi Rob, I love your patch! Yet something to improve: [auto build test ERROR on drm-misc/drm-misc-next] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Rob-Herring/fbdev-Use-of_property_present-for-testing-DT-property-presence/20230310-225754 base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next patch link: https://lore.kernel.org/r/20230310144729.1545943-1-robh%40kernel.org patch subject: [PATCH] fbdev: Use of_property_present() for testing DT property presence config: arm64-randconfig-r032-20230310 (https://download.01.org/0day-ci/archive/20230311/202303111229.3Uuc8JQV-lkp@intel.com/config) compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 67409911353323ca5edf2049ef0df54132fa1ca7) 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 arm64 cross compiling tool for clang build # apt-get install binutils-aarch64-linux-gnu # https://github.com/intel-lab-lkp/linux/commit/c013f4111f36b0b4327e7fbf46c0dd93399e9209 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Rob-Herring/fbdev-Use-of_property_present-for-testing-DT-property-presence/20230310-225754 git checkout c013f4111f36b0b4327e7fbf46c0dd93399e9209 # 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=arm64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/video/fbdev/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> | Link: https://lore.kernel.org/oe-kbuild-all/202303111229.3Uuc8JQV-lkp@intel.com/ All errors (new ones prefixed by >>): >> drivers/video/fbdev/amba-clcd.c:857:6: error: call to undeclared function 'of_property_present'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] if (of_property_present(node, "memory-region")) { ^ drivers/video/fbdev/amba-clcd.c:857:6: note: did you mean 'fwnode_property_present'? include/linux/property.h:59:6: note: 'fwnode_property_present' declared here bool fwnode_property_present(const struct fwnode_handle *fwnode, ^ 1 error generated. vim +/of_property_present +857 drivers/video/fbdev/amba-clcd.c 843 844 static struct clcd_board *clcdfb_of_get_board(struct amba_device *dev) 845 { 846 struct clcd_board *board = devm_kzalloc(&dev->dev, sizeof(*board), 847 GFP_KERNEL); 848 struct device_node *node = dev->dev.of_node; 849 850 if (!board) 851 return NULL; 852 853 board->name = of_node_full_name(node); 854 board->caps = CLCD_CAP_ALL; 855 board->check = clcdfb_check; 856 board->decode = clcdfb_decode; > 857 if (of_property_present(node, "memory-region")) { 858 board->setup = clcdfb_of_vram_setup; 859 board->mmap = clcdfb_of_vram_mmap; 860 board->remove = clcdfb_of_vram_remove; 861 } else { 862 board->setup = clcdfb_of_dma_setup; 863 board->mmap = clcdfb_of_dma_mmap; 864 board->remove = clcdfb_of_dma_remove; 865 } 866 867 return board; 868 } 869 #else 870 static struct clcd_board *clcdfb_of_get_board(struct amba_device *dev) 871 { 872 return NULL; 873 } 874 #endif 875
Hi Rob, I love your patch! Yet something to improve: [auto build test ERROR on drm-misc/drm-misc-next] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Rob-Herring/fbdev-Use-of_property_present-for-testing-DT-property-presence/20230310-225754 base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next patch link: https://lore.kernel.org/r/20230310144729.1545943-1-robh%40kernel.org patch subject: [PATCH] fbdev: Use of_property_present() for testing DT property presence config: arm-allyesconfig (https://download.01.org/0day-ci/archive/20230311/202303112153.uPbFjEUI-lkp@intel.com/config) compiler: arm-linux-gnueabi-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/c013f4111f36b0b4327e7fbf46c0dd93399e9209 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Rob-Herring/fbdev-Use-of_property_present-for-testing-DT-property-presence/20230310-225754 git checkout c013f4111f36b0b4327e7fbf46c0dd93399e9209 # 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=arm olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> | Link: https://lore.kernel.org/oe-kbuild-all/202303112153.uPbFjEUI-lkp@intel.com/ All errors (new ones prefixed by >>): drivers/video/fbdev/amba-clcd.c: In function 'clcdfb_of_get_board': >> drivers/video/fbdev/amba-clcd.c:857:13: error: implicit declaration of function 'of_property_present'; did you mean 'fwnode_property_present'? [-Werror=implicit-function-declaration] 857 | if (of_property_present(node, "memory-region")) { | ^~~~~~~~~~~~~~~~~~~ | fwnode_property_present cc1: some warnings being treated as errors vim +857 drivers/video/fbdev/amba-clcd.c 843 844 static struct clcd_board *clcdfb_of_get_board(struct amba_device *dev) 845 { 846 struct clcd_board *board = devm_kzalloc(&dev->dev, sizeof(*board), 847 GFP_KERNEL); 848 struct device_node *node = dev->dev.of_node; 849 850 if (!board) 851 return NULL; 852 853 board->name = of_node_full_name(node); 854 board->caps = CLCD_CAP_ALL; 855 board->check = clcdfb_check; 856 board->decode = clcdfb_decode; > 857 if (of_property_present(node, "memory-region")) { 858 board->setup = clcdfb_of_vram_setup; 859 board->mmap = clcdfb_of_vram_mmap; 860 board->remove = clcdfb_of_vram_remove; 861 } else { 862 board->setup = clcdfb_of_dma_setup; 863 board->mmap = clcdfb_of_dma_mmap; 864 board->remove = clcdfb_of_dma_remove; 865 } 866 867 return board; 868 } 869 #else 870 static struct clcd_board *clcdfb_of_get_board(struct amba_device *dev) 871 { 872 return NULL; 873 } 874 #endif 875
On Fri, Mar 10, 2023 at 10:41 PM kernel test robot <lkp@intel.com> wrote: > > Hi Rob, > > I love your patch! Yet something to improve: > > [auto build test ERROR on drm-misc/drm-misc-next] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: https://github.com/intel-lab-lkp/linux/commits/Rob-Herring/fbdev-Use-of_property_present-for-testing-DT-property-presence/20230310-225754 > base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next > patch link: https://lore.kernel.org/r/20230310144729.1545943-1-robh%40kernel.org > patch subject: [PATCH] fbdev: Use of_property_present() for testing DT property presence > config: arm64-randconfig-r032-20230310 (https://download.01.org/0day-ci/archive/20230311/202303111229.3Uuc8JQV-lkp@intel.com/config) > compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 67409911353323ca5edf2049ef0df54132fa1ca7) > 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 arm64 cross compiling tool for clang build > # apt-get install binutils-aarch64-linux-gnu > # https://github.com/intel-lab-lkp/linux/commit/c013f4111f36b0b4327e7fbf46c0dd93399e9209 > git remote add linux-review https://github.com/intel-lab-lkp/linux > git fetch --no-tags linux-review Rob-Herring/fbdev-Use-of_property_present-for-testing-DT-property-presence/20230310-225754 > git checkout c013f4111f36b0b4327e7fbf46c0dd93399e9209 Looks like this patch was applied to drm-next which was/is based on v6.2-rc6. This patch is dependent on a change in v6.3-rc1. Rob
diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c index f65c96d1394d..e45338227be6 100644 --- a/drivers/video/fbdev/amba-clcd.c +++ b/drivers/video/fbdev/amba-clcd.c @@ -854,7 +854,7 @@ static struct clcd_board *clcdfb_of_get_board(struct amba_device *dev) board->caps = CLCD_CAP_ALL; board->check = clcdfb_check; board->decode = clcdfb_decode; - if (of_find_property(node, "memory-region", NULL)) { + if (of_property_present(node, "memory-region")) { board->setup = clcdfb_of_vram_setup; board->mmap = clcdfb_of_vram_mmap; board->remove = clcdfb_of_vram_remove; diff --git a/drivers/video/fbdev/bw2.c b/drivers/video/fbdev/bw2.c index 6403ae07970d..9cbadcd18b25 100644 --- a/drivers/video/fbdev/bw2.c +++ b/drivers/video/fbdev/bw2.c @@ -306,7 +306,7 @@ static int bw2_probe(struct platform_device *op) if (!par->regs) goto out_release_fb; - if (!of_find_property(dp, "width", NULL)) { + if (!of_property_present(dp, "width")) { err = bw2_do_default_mode(par, info, &linebytes); if (err) goto out_unmap_regs; diff --git a/drivers/video/fbdev/cg3.c b/drivers/video/fbdev/cg3.c index bdcc3f6ab666..3a37fff4df36 100644 --- a/drivers/video/fbdev/cg3.c +++ b/drivers/video/fbdev/cg3.c @@ -393,7 +393,7 @@ static int cg3_probe(struct platform_device *op) cg3_blank(FB_BLANK_UNBLANK, info); - if (!of_find_property(dp, "width", NULL)) { + if (!of_property_present(dp, "width")) { err = cg3_do_default_mode(par); if (err) goto out_unmap_screen; diff --git a/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c b/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c index 0ae0cab252d3..09f719af0d0c 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c @@ -192,7 +192,7 @@ static int __init omapdss_boot_init(void) omapdss_walk_device(dss, true); for_each_available_child_of_node(dss, child) { - if (!of_find_property(child, "compatible", NULL)) + if (!of_property_present(child, "compatible")) continue; omapdss_walk_device(child, true);