All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Chris Packham <chris.packham@alliedtelesis.co.nz>,
	jdelvare@suse.com, linux@roeck-us.net, manio@skyboo.net
Cc: oe-kbuild-all@lists.linux.dev, linux-hwmon@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Chris Packham <chris.packham@alliedtelesis.co.nz>
Subject: Re: [PATCH v2 2/2] hwmon: (adt7475) Convert to use device_property APIs
Date: Wed, 19 Apr 2023 20:48:54 +0800	[thread overview]
Message-ID: <202304192005.lJVSjooB-lkp@intel.com> (raw)
In-Reply-To: <20230418233656.869055-3-chris.packham@alliedtelesis.co.nz>

Hi Chris,

kernel test robot noticed the following build warnings:

[auto build test WARNING on groeck-staging/hwmon-next]
[also build test WARNING on linus/master v6.3-rc7 next-20230418]
[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/Chris-Packham/hwmon-adt7475-Use-device_property-APIs-when-configuring-polarity/20230419-074117
base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
patch link:    https://lore.kernel.org/r/20230418233656.869055-3-chris.packham%40alliedtelesis.co.nz
patch subject: [PATCH v2 2/2] hwmon: (adt7475) Convert to use device_property APIs
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20230419/202304192005.lJVSjooB-lkp@intel.com/config)
compiler: m68k-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/59836340c66130951595e2adebf284eca3063ccd
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Chris-Packham/hwmon-adt7475-Use-device_property-APIs-when-configuring-polarity/20230419-074117
        git checkout 59836340c66130951595e2adebf284eca3063ccd
        # 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=m68k olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash drivers/

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/202304192005.lJVSjooB-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/hwmon/adt7475.c: In function 'load_config3':
>> drivers/hwmon/adt7475.c:1471:43: warning: passing argument 1 of 'device_property_read_string' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    1471 |         ret = device_property_read_string(&client->dev, propname, &function);
         |                                           ^~~~~~~~~~~~
   In file included from include/linux/of.h:22,
                    from include/linux/of_device.h:9,
                    from drivers/hwmon/adt7475.c:13:
   include/linux/property.h:54:48: note: expected 'struct device *' but argument is of type 'const struct device *'
      54 | int device_property_read_string(struct device *dev, const char *propname,
         |                                 ~~~~~~~~~~~~~~~^~~
   drivers/hwmon/adt7475.c: In function 'load_config4':
   drivers/hwmon/adt7475.c:1497:43: warning: passing argument 1 of 'device_property_read_string' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    1497 |         ret = device_property_read_string(&client->dev, propname, &function);
         |                                           ^~~~~~~~~~~~
   include/linux/property.h:54:48: note: expected 'struct device *' but argument is of type 'const struct device *'
      54 | int device_property_read_string(struct device *dev, const char *propname,
         |                                 ~~~~~~~~~~~~~~~^~~
   drivers/hwmon/adt7475.c: In function 'set_property_bit':
>> drivers/hwmon/adt7475.c:1559:44: warning: passing argument 1 of 'device_property_read_u32' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    1559 |         int ret = device_property_read_u32(&client->dev, property,
         |                                            ^~~~~~~~~~~~
   include/linux/property.h:164:59: note: expected 'struct device *' but argument is of type 'const struct device *'
     164 | static inline int device_property_read_u32(struct device *dev,
         |                                            ~~~~~~~~~~~~~~~^~~


vim +1471 drivers/hwmon/adt7475.c

  1464	
  1465	static int load_config3(const struct i2c_client *client, const char *propname)
  1466	{
  1467		const char *function;
  1468		u8 config3;
  1469		int ret;
  1470	
> 1471		ret = device_property_read_string(&client->dev, propname, &function);
  1472		if (!ret) {
  1473			ret = adt7475_read(REG_CONFIG3);
  1474			if (ret < 0)
  1475				return ret;
  1476	
  1477			config3 = ret & ~CONFIG3_SMBALERT;
  1478			if (!strcmp("pwm2", function))
  1479				;
  1480			else if (!strcmp("smbalert#", function))
  1481				config3 |= CONFIG3_SMBALERT;
  1482			else
  1483				return -EINVAL;
  1484	
  1485			return i2c_smbus_write_byte_data(client, REG_CONFIG3, config3);
  1486		}
  1487	
  1488		return 0;
  1489	}
  1490	
  1491	static int load_config4(const struct i2c_client *client, const char *propname)
  1492	{
  1493		const char *function;
  1494		u8 config4;
  1495		int ret;
  1496	
  1497		ret = device_property_read_string(&client->dev, propname, &function);
  1498		if (!ret) {
  1499			ret = adt7475_read(REG_CONFIG4);
  1500			if (ret < 0)
  1501				return ret;
  1502	
  1503			config4 = ret & ~CONFIG4_PINFUNC;
  1504	
  1505			if (!strcmp("tach4", function))
  1506				;
  1507			else if (!strcmp("therm#", function))
  1508				config4 |= CONFIG4_THERM;
  1509			else if (!strcmp("smbalert#", function))
  1510				config4 |= CONFIG4_SMBALERT;
  1511			else if (!strcmp("gpio", function))
  1512				config4 |= CONFIG4_PINFUNC;
  1513			else
  1514				return -EINVAL;
  1515	
  1516			return i2c_smbus_write_byte_data(client, REG_CONFIG4, config4);
  1517		}
  1518	
  1519		return 0;
  1520	}
  1521	
  1522	static int load_config(const struct i2c_client *client, enum chips chip)
  1523	{
  1524		int err;
  1525		const char *prop1, *prop2;
  1526	
  1527		switch (chip) {
  1528		case adt7473:
  1529		case adt7475:
  1530			prop1 = "adi,pin5-function";
  1531			prop2 = "adi,pin9-function";
  1532			break;
  1533		case adt7476:
  1534		case adt7490:
  1535			prop1 = "adi,pin10-function";
  1536			prop2 = "adi,pin14-function";
  1537			break;
  1538		}
  1539	
  1540		err = load_config3(client, prop1);
  1541		if (err) {
  1542			dev_err(&client->dev, "failed to configure %s\n", prop1);
  1543			return err;
  1544		}
  1545	
  1546		err = load_config4(client, prop2);
  1547		if (err) {
  1548			dev_err(&client->dev, "failed to configure %s\n", prop2);
  1549			return err;
  1550		}
  1551	
  1552		return 0;
  1553	}
  1554	
  1555	static int set_property_bit(const struct i2c_client *client, char *property,
  1556				    u8 *config, u8 bit_index)
  1557	{
  1558		u32 prop_value = 0;
> 1559		int ret = device_property_read_u32(&client->dev, property,
  1560						   &prop_value);
  1561	
  1562		if (!ret) {
  1563			if (prop_value)
  1564				*config |= (1 << bit_index);
  1565			else
  1566				*config &= ~(1 << bit_index);
  1567		}
  1568	
  1569		return ret;
  1570	}
  1571	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

  reply	other threads:[~2023-04-19 12:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18 23:36 [PATCH v2 0/2] hwmon: (adt7475) Handle DT unaware platforms Chris Packham
2023-04-18 23:36 ` [PATCH v2 1/2] hwmon: (adt7475) Use device_property APIs when configuring polarity Chris Packham
2023-04-19  3:57   ` Guenter Roeck
2023-04-19 15:54   ` Guenter Roeck
2023-04-18 23:36 ` [PATCH v2 2/2] hwmon: (adt7475) Convert to use device_property APIs Chris Packham
2023-04-19 12:48   ` kernel test robot [this message]
2023-04-19 16:06   ` Guenter Roeck
2023-04-19 20:49     ` Chris Packham
2023-04-19 20:59       ` Guenter Roeck
2023-04-21  4:33   ` kernel test robot
2023-04-21  6:15   ` kernel test robot
2023-04-30 12:49   ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202304192005.lJVSjooB-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=manio@skyboo.net \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.