[hwmon:hwmon-playground 38/44] drivers/hwmon/pmbus/pmbus_core.c:159:2: note: in expansion of macro 'if'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-playground
head:   e8dc30cf9ae936e93319687fa88ed45c55797807
commit: e9036c751c0918fdac1a927e8b52d5fb4e4d926a [38/44] hwmon: (pmbus) Implement multi-phase support
config: arm-randconfig-a001-20200126 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout e9036c751c0918fdac1a927e8b52d5fb4e4d926a
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:11:0,
                    from include/linux/list.h:9,
                    from include/linux/wait.h:7,
                    from include/linux/wait_bit.h:8,
                    from include/linux/fs.h:6,
                    from include/linux/debugfs.h:15,
                    from drivers/hwmon/pmbus/pmbus_core.c:9:
   drivers/hwmon/pmbus/pmbus_core.c: In function 'pmbus_set_page':
   drivers/hwmon/pmbus/pmbus_core.c:160:10: error: 'struct pmbus_data' has no member named 'pages'
         data->pages > 1 & page != data->currpage) {
             ^
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
>> drivers/hwmon/pmbus/pmbus_core.c:159:2: note: in expansion of macro 'if'
     if (!(data->info->func[page] & PMBUS_PAGE_VIRTUAL) &&
     ^~
   drivers/hwmon/pmbus/pmbus_core.c:160:10: error: 'struct pmbus_data' has no member named 'pages'
         data->pages > 1 & page != data->currpage) {
             ^
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                ^~~~
>> drivers/hwmon/pmbus/pmbus_core.c:159:2: note: in expansion of macro 'if'
     if (!(data->info->func[page] & PMBUS_PAGE_VIRTUAL) &&
     ^~
   drivers/hwmon/pmbus/pmbus_core.c:160:10: error: 'struct pmbus_data' has no member named 'pages'
         data->pages > 1 & page != data->currpage) {
             ^
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
     (cond) ?     \
      ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                               ^~~~~~~~~~~~~~
>> drivers/hwmon/pmbus/pmbus_core.c:159:2: note: in expansion of macro 'if'
     if (!(data->info->func[page] & PMBUS_PAGE_VIRTUAL) &&
     ^~
   drivers/hwmon/pmbus/pmbus_core.c:174:10: error: 'struct pmbus_data' has no member named 'phases'
     if (data->phases && data->currphase != phase &&
             ^
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
   drivers/hwmon/pmbus/pmbus_core.c:174:2: note: in expansion of macro 'if'
     if (data->phases && data->currphase != phase &&
     ^~
   drivers/hwmon/pmbus/pmbus_core.c:174:10: error: 'struct pmbus_data' has no member named 'phases'
     if (data->phases && data->currphase != phase &&
             ^
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                ^~~~
   drivers/hwmon/pmbus/pmbus_core.c:174:2: note: in expansion of macro 'if'
     if (data->phases && data->currphase != phase &&
     ^~
   drivers/hwmon/pmbus/pmbus_core.c:174:10: error: 'struct pmbus_data' has no member named 'phases'
     if (data->phases && data->currphase != phase &&
             ^
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
     (cond) ?     \
      ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                               ^~~~~~~~~~~~~~
   drivers/hwmon/pmbus/pmbus_core.c:174:2: note: in expansion of macro 'if'
     if (data->phases && data->currphase != phase &&
     ^~

vim +/if +159 drivers/hwmon/pmbus/pmbus_core.c

   > 9	#include <linux/debugfs.h>
    10	#include <linux/kernel.h>
    11	#include <linux/math64.h>
    12	#include <linux/module.h>
    13	#include <linux/init.h>
    14	#include <linux/err.h>
    15	#include <linux/slab.h>
    16	#include <linux/i2c.h>
    17	#include <linux/hwmon.h>
    18	#include <linux/hwmon-sysfs.h>
    19	#include <linux/jiffies.h>
    20	#include <linux/pmbus.h>
    21	#include <linux/regulator/driver.h>
    22	#include <linux/regulator/machine.h>
    23	#include "pmbus.h"
    24	
    25	/*
    26	 * Number of additional attribute pointers to allocate
    27	 * with each call to krealloc
    28	 */
    29	#define PMBUS_ATTR_ALLOC_SIZE	32
    30	
    31	/*
    32	 * Index into status register array, per status register group
    33	 */
    34	#define PB_STATUS_BASE		0
    35	#define PB_STATUS_VOUT_BASE	(PB_STATUS_BASE + PMBUS_PAGES)
    36	#define PB_STATUS_IOUT_BASE	(PB_STATUS_VOUT_BASE + PMBUS_PAGES)
    37	#define PB_STATUS_FAN_BASE	(PB_STATUS_IOUT_BASE + PMBUS_PAGES)
    38	#define PB_STATUS_FAN34_BASE	(PB_STATUS_FAN_BASE + PMBUS_PAGES)
    39	#define PB_STATUS_TEMP_BASE	(PB_STATUS_FAN34_BASE + PMBUS_PAGES)
    40	#define PB_STATUS_INPUT_BASE	(PB_STATUS_TEMP_BASE + PMBUS_PAGES)
    41	#define PB_STATUS_VMON_BASE	(PB_STATUS_INPUT_BASE + 1)
    42	
    43	#define PB_NUM_STATUS_REG	(PB_STATUS_VMON_BASE + 1)
    44	
    45	#define PMBUS_NAME_SIZE		24
    46	
    47	struct pmbus_sensor {
    48		struct pmbus_sensor *next;
    49		char name[PMBUS_NAME_SIZE];	/* sysfs sensor name */
    50		struct device_attribute attribute;
    51		u8 page;		/* page number */
    52		u8 phase;		/* phase number, 0xff for all phases */
    53		u16 reg;		/* register */
    54		enum pmbus_sensor_classes class;	/* sensor class */
    55		bool update;		/* runtime sensor update needed */
    56		bool convert;		/* Whether or not to apply linear/vid/direct */
    57		int data;		/* Sensor data.
    58					   Negative if there was a read error */
    59	};
    60	#define to_pmbus_sensor(_attr) \
    61		container_of(_attr, struct pmbus_sensor, attribute)
    62	
    63	struct pmbus_boolean {
    64		char name[PMBUS_NAME_SIZE];	/* sysfs boolean name */
    65		struct sensor_device_attribute attribute;
    66		struct pmbus_sensor *s1;
    67		struct pmbus_sensor *s2;
    68	};
    69	#define to_pmbus_boolean(_attr) \
    70		container_of(_attr, struct pmbus_boolean, attribute)
    71	
    72	struct pmbus_label {
    73		char name[PMBUS_NAME_SIZE];	/* sysfs label name */
    74		struct device_attribute attribute;
    75		char label[PMBUS_NAME_SIZE];	/* label */
    76	};
    77	#define to_pmbus_label(_attr) \
    78		container_of(_attr, struct pmbus_label, attribute)
    79	
    80	struct pmbus_data {
    81		struct device *dev;
    82		struct device *hwmon_dev;
    83	
    84		u32 flags;		/* from platform data */
    85	
    86		int exponent[PMBUS_PAGES];
    87					/* linear mode: exponent for output voltages */
    88	
    89		const struct pmbus_driver_info *info;
    90	
    91		int max_attributes;
    92		int num_attributes;
    93		struct attribute_group group;
    94		const struct attribute_group **groups;
    95		struct dentry *debugfs;		/* debugfs device directory */
    96	
    97		struct pmbus_sensor *sensors;
    98	
    99		struct mutex update_lock;
   100		bool valid;
   101		unsigned long last_updated;	/* in jiffies */
   102	
   103		/*
   104		 * A single status register covers multiple attributes,
   105		 * so we keep them all together.
   106		 */
   107		u16 status[PB_NUM_STATUS_REG];
   108	
   109		bool has_status_word;		/* device uses STATUS_WORD register */
   110		int (*read_status)(struct i2c_client *client, int page);
   111	
   112		u8 currpage;
   113		u8 currphase;	/* current phase, 0xff for all */
   114	};
   115	
   116	struct pmbus_debugfs_entry {
   117		struct i2c_client *client;
   118		u8 page;
   119		u8 reg;
   120	};
   121	
   122	static const int pmbus_fan_rpm_mask[] = {
   123		PB_FAN_1_RPM,
   124		PB_FAN_2_RPM,
   125		PB_FAN_1_RPM,
   126		PB_FAN_2_RPM,
   127	};
   128	
   129	static const int pmbus_fan_config_registers[] = {
   130		PMBUS_FAN_CONFIG_12,
   131		PMBUS_FAN_CONFIG_12,
   132		PMBUS_FAN_CONFIG_34,
   133		PMBUS_FAN_CONFIG_34
   134	};
   135	
   136	static const int pmbus_fan_command_registers[] = {
   137		PMBUS_FAN_COMMAND_1,
   138		PMBUS_FAN_COMMAND_2,
   139		PMBUS_FAN_COMMAND_3,
   140		PMBUS_FAN_COMMAND_4,
   141	};
   142	
   143	void pmbus_clear_cache(struct i2c_client *client)
   144	{
   145		struct pmbus_data *data = i2c_get_clientdata(client);
   146	
   147		data->valid = false;
   148	}
   149	EXPORT_SYMBOL_GPL(pmbus_clear_cache);
   150	
   151	int pmbus_set_page(struct i2c_client *client, int page, int phase)
   152	{
   153		struct pmbus_data *data = i2c_get_clientdata(client);
   154		int rv;
   155	
   156		if (page < 0)
   157			return 0;
   158	
 > 159		if (!(data->info->func[page] & PMBUS_PAGE_VIRTUAL) &&
   160		    data->pages > 1 & page != data->currpage) {
   161			rv = i2c_smbus_write_byte_data(client, PMBUS_PAGE, page);
   162			if (rv < 0)
   163				return rv;
   164	
   165			rv = i2c_smbus_read_byte_data(client, PMBUS_PAGE);
   166			if (rv < 0)
   167				return rv;
   168	
   169			if (rv != page)
   170				return -EIO;
   171		}
   172		data->currpage = page;
   173	
   174		if (data->phases && data->currphase != phase &&
   175		    !(data->info->pfunc[phase] & PMBUS_PHASE_VIRTUAL)) {
   176			rv = i2c_smbus_write_byte_data(client, PMBUS_PHASE,
   177						       phase);
   178			if (rv)
   179				return rv;
   180		}
   181		data->currphase = phase;
   182	
   183		return 0;
   184	}
   185	EXPORT_SYMBOL_GPL(pmbus_set_page);
   186	

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux