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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202301041220.pEs3YZw9-lkp@intel.com>
Date:   Wed, 4 Jan 2023 12:37:17 +0800
From:   kernel test robot <lkp@...el.com>
To:     Jiri Valek - 2N <jiriv@...s.com>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Krzysztof Kozlowski <krzk@...nel.org>
Cc:     llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
        Jiri Valek - 2N <jiriv@...s.com>,
        Rob Herring <robh+dt@...nel.org>,
        Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>,
        "open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)..." 
        <linux-input@...r.kernel.org>,
        "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
        <devicetree@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] Input: cap11xx - add support for cap1203, cap1293
 and cap1298

Hi Jiri,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on dtor-input/next]
[also build test WARNING on dtor-input/for-linus krzk-dt/for-next robh/for-next linus/master v6.2-rc2 next-20221226]
[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/Jiri-Valek-2N/dt-bindings-input-microchip-cap11xx-add-cap1203-cap1293-and-cap1298/20230103-214328
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
patch link:    https://lore.kernel.org/r/20230103134105.736346-3-jiriv%40axis.com
patch subject: [PATCH 2/2] Input: cap11xx - add support for cap1203, cap1293 and cap1298
config: x86_64-randconfig-a014-20230102
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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/e3f771deec5bca758424af619e7e322a3c6f3d1e
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Jiri-Valek-2N/dt-bindings-input-microchip-cap11xx-add-cap1203-cap1293-and-cap1298/20230103-214328
        git checkout e3f771deec5bca758424af619e7e322a3c6f3d1e
        # 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=x86_64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/input/keyboard/

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/input/keyboard/cap11xx.c:400:35: warning: overlapping comparisons always evaluate to true [-Wtautological-overlap-compare]
           if ((id->driver_data != CAP1206) ||
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
   1 warning generated.


vim +400 drivers/input/keyboard/cap11xx.c

   329	
   330	static int cap11xx_i2c_probe(struct i2c_client *i2c_client)
   331	{
   332		const struct i2c_device_id *id = i2c_client_get_device_id(i2c_client);
   333		struct device *dev = &i2c_client->dev;
   334		struct cap11xx_priv *priv;
   335		struct device_node *node;
   336		const struct cap11xx_hw_model *cap;
   337		int i, error, irq, gain = 0;
   338		unsigned int val, rev;
   339		u32 gain32;
   340	
   341		if (id->driver_data >= ARRAY_SIZE(cap11xx_devices)) {
   342			dev_err(dev, "Invalid device ID %lu\n", id->driver_data);
   343			return -EINVAL;
   344		}
   345	
   346		cap = &cap11xx_devices[id->driver_data];
   347		if (!cap || !cap->num_channels) {
   348			dev_err(dev, "Invalid device configuration\n");
   349			return -EINVAL;
   350		}
   351	
   352		priv = devm_kzalloc(dev,
   353				    struct_size(priv, keycodes, cap->num_channels),
   354				    GFP_KERNEL);
   355		if (!priv)
   356			return -ENOMEM;
   357	
   358		priv->regmap = devm_regmap_init_i2c(i2c_client, &cap11xx_regmap_config);
   359		if (IS_ERR(priv->regmap))
   360			return PTR_ERR(priv->regmap);
   361	
   362		error = regmap_read(priv->regmap, CAP11XX_REG_PRODUCT_ID, &val);
   363		if (error)
   364			return error;
   365	
   366		if (val != cap->product_id) {
   367			dev_err(dev, "Product ID: Got 0x%02x, expected 0x%02x\n",
   368				val, cap->product_id);
   369			return -ENXIO;
   370		}
   371	
   372		error = regmap_read(priv->regmap, CAP11XX_REG_MANUFACTURER_ID, &val);
   373		if (error)
   374			return error;
   375	
   376		if (val != CAP11XX_MANUFACTURER_ID) {
   377			dev_err(dev, "Manufacturer ID: Got 0x%02x, expected 0x%02x\n",
   378				val, CAP11XX_MANUFACTURER_ID);
   379			return -ENXIO;
   380		}
   381	
   382		error = regmap_read(priv->regmap, CAP11XX_REG_REVISION, &rev);
   383		if (error < 0)
   384			return error;
   385	
   386		dev_info(dev, "CAP11XX detected, model %s, revision 0x%02x\n",
   387				id->name, rev);
   388		node = dev->of_node;
   389	
   390		if (!of_property_read_u32(node, "microchip,sensor-gain", &gain32)) {
   391			if (cap->no_gain)
   392				dev_warn(dev,
   393					 "This version doesn't support sensor gain\n");
   394			else if (is_power_of_2(gain32) && gain32 <= 8)
   395				gain = ilog2(gain32);
   396			else
   397				dev_err(dev, "Invalid sensor-gain value %d\n", gain32);
   398		}
   399	
 > 400		if ((id->driver_data != CAP1206) ||
   401			(id->driver_data != CAP1203) ||
   402			(id->driver_data != CAP1293) ||
   403			(id->driver_data != CAP1298)) {
   404			if (of_property_read_bool(node, "microchip,irq-active-high")) {
   405				error = regmap_update_bits(priv->regmap,
   406							   CAP11XX_REG_CONFIG2,
   407							   CAP11XX_REG_CONFIG2_ALT_POL,
   408							   0);
   409				if (error)
   410					return error;
   411			}
   412		}
   413	
   414		/* Provide some useful defaults */
   415		for (i = 0; i < cap->num_channels; i++)
   416			priv->keycodes[i] = KEY_A + i;
   417	
   418		of_property_read_u32_array(node, "linux,keycodes",
   419					   priv->keycodes, cap->num_channels);
   420	
   421		if (!cap->no_gain) {
   422			error = regmap_update_bits(priv->regmap,
   423					CAP11XX_REG_MAIN_CONTROL,
   424					CAP11XX_REG_MAIN_CONTROL_GAIN_MASK,
   425					gain << CAP11XX_REG_MAIN_CONTROL_GAIN_SHIFT);
   426			if (error)
   427				return error;
   428		}
   429	
   430		/* Disable autorepeat. The Linux input system has its own handling. */
   431		error = regmap_write(priv->regmap, CAP11XX_REG_REPEAT_RATE, 0);
   432		if (error)
   433			return error;
   434	
   435		priv->idev = devm_input_allocate_device(dev);
   436		if (!priv->idev)
   437			return -ENOMEM;
   438	
   439		priv->idev->name = "CAP11XX capacitive touch sensor";
   440		priv->idev->id.bustype = BUS_I2C;
   441		priv->idev->evbit[0] = BIT_MASK(EV_KEY);
   442	
   443		if (of_property_read_bool(node, "autorepeat"))
   444			__set_bit(EV_REP, priv->idev->evbit);
   445	
   446		for (i = 0; i < cap->num_channels; i++)
   447			__set_bit(priv->keycodes[i], priv->idev->keybit);
   448	
   449		__clear_bit(KEY_RESERVED, priv->idev->keybit);
   450	
   451		priv->idev->keycode = priv->keycodes;
   452		priv->idev->keycodesize = sizeof(priv->keycodes[0]);
   453		priv->idev->keycodemax = cap->num_channels;
   454	
   455		priv->idev->id.vendor = CAP11XX_MANUFACTURER_ID;
   456		priv->idev->id.product = cap->product_id;
   457		priv->idev->id.version = rev;
   458	
   459		priv->idev->open = cap11xx_input_open;
   460		priv->idev->close = cap11xx_input_close;
   461	
   462		error = cap11xx_init_leds(dev, priv, cap->num_leds);
   463		if (error)
   464			return error;
   465	
   466		input_set_drvdata(priv->idev, priv);
   467	
   468		/*
   469		 * Put the device in deep sleep mode for now.
   470		 * ->open() will bring it back once the it is actually needed.
   471		 */
   472		cap11xx_set_sleep(priv, true);
   473	
   474		error = input_register_device(priv->idev);
   475		if (error)
   476			return error;
   477	
   478		irq = irq_of_parse_and_map(node, 0);
   479		if (!irq) {
   480			dev_err(dev, "Unable to parse or map IRQ\n");
   481			return -ENXIO;
   482		}
   483	
   484		error = devm_request_threaded_irq(dev, irq, NULL, cap11xx_thread_func,
   485						  IRQF_ONESHOT, dev_name(dev), priv);
   486		if (error)
   487			return error;
   488	
   489		return 0;
   490	}
   491	

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ