lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202207081328.eh70MnAX-lkp@intel.com>
Date:   Fri, 8 Jul 2022 13:39:32 +0800
From:   kernel test robot <lkp@...el.com>
To:     Hector Martin <marcan@...can.st>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org
Subject: [asahilinux:t8112/bringup 16/19]
 drivers/hid/dockchannel-hid/dockchannel-hid.c:962:7: warning: variable
 'defer' set but not used

tree:   https://github.com/AsahiLinux/linux t8112/bringup
head:   0e7640fed025ba0ce4b845a0bbf2a5fdceab631d
commit: f40be88d7f037e2b682492c4abf36b136d136d22 [16/19] hid: Add Apple DockChannel HID transport driver
config: arm64-buildonly-randconfig-r006-20220707
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 562c3467a6738aa89203f72fc1d1343e5baadf3c)
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/AsahiLinux/linux/commit/f40be88d7f037e2b682492c4abf36b136d136d22
        git remote add asahilinux https://github.com/AsahiLinux/linux
        git fetch --no-tags asahilinux t8112/bringup
        git checkout f40be88d7f037e2b682492c4abf36b136d136d22
        # 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 SHELL=/bin/bash drivers/hid/dockchannel-hid/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

>> drivers/hid/dockchannel-hid/dockchannel-hid.c:962:7: warning: variable 'defer' set but not used [-Wunused-but-set-variable]
           bool defer = false;
                ^
   1 warning generated.

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for APPLE_ADMAC
   Depends on DMADEVICES && (ARCH_APPLE || COMPILE_TEST
   Selected by
   - SND_SOC_APPLE_MCA && SOUND && !UML && SND && SND_SOC && (ARCH_APPLE || COMPILE_TEST


vim +/defer +962 drivers/hid/dockchannel-hid/dockchannel-hid.c

   955	
   956	static int dockchannel_hid_probe(struct platform_device *pdev)
   957	{
   958		struct device *dev = &pdev->dev;
   959		struct dockchannel_hid *dchid;
   960		struct device_node *child;
   961		struct property *prop;
 > 962		bool defer = false;
   963	
   964		/*
   965		 * First make sure all the GPIOs are available, in cased we need to defer.
   966		 * This is necessary because MTP will request them by name later, and by then
   967		 * it's too late to defer the probe.
   968		 */
   969	
   970		for_each_child_of_node(dev->of_node, child) {
   971			for_each_property_of_node(child, prop) {
   972				size_t len = strlen(prop->name);
   973				struct gpio_desc *gpio;
   974	
   975				if (len < 12 || strncmp("apple,", prop->name, 6) ||
   976				    strcmp("-gpios", prop->name + len - 6))
   977					continue;
   978	
   979				gpio = gpiod_get_from_of_node(child, prop->name, 0, GPIOD_ASIS,
   980							      prop->name);
   981				if (IS_ERR_OR_NULL(gpio)) {
   982					if (PTR_ERR(gpio) == EPROBE_DEFER) {
   983						defer = true;
   984						of_node_put(child);
   985						return -EPROBE_DEFER;
   986					}
   987				} else {
   988					gpiod_put(gpio);
   989				}
   990			}
   991		}
   992	
   993		dchid = devm_kzalloc(dev, sizeof(*dchid), GFP_KERNEL);
   994		if (!dchid)
   995			return -ENOMEM;
   996	
   997	
   998		dchid->dev = &pdev->dev;
   999		dchid->dc = dockchannel_init(pdev);
  1000		if (IS_ERR_OR_NULL(dchid->dc)) {
  1001			return -PTR_ERR(dchid->dc);
  1002		}
  1003	
  1004		dchid->comm = dchid_get_interface(dchid, IFACE_COMM, "comm");
  1005		if (!dchid->comm) {
  1006			dev_err(dchid->dev, "Failed to initialize comm interface");
  1007			return -EIO;
  1008		}
  1009	
  1010		dchid->wq = alloc_ordered_workqueue("dockchannel-hid-report", WQ_MEM_RECLAIM);
  1011		if (!dchid->wq)
  1012			return -ENOMEM;
  1013	
  1014		dev_info(dchid->dev, "initialized, awaiting packets\n");
  1015		dockchannel_await(dchid->dc, dchid_handle_packet, dchid, sizeof(struct dchid_hdr));
  1016	
  1017		return 0;
  1018	}
  1019	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (176453 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ