arch/mips/crypto/crc32-mips.c:40:1: error: expected identifier or '('
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f4bc5bbb5fef3cf421ba3485d6d383c27ec473ed
commit: 67512a8cf5a730938fdb1e48de33edfef6015e03 MIPS: Avoid macro redefinitions
date: 5 months ago
config: mips-randconfig-r014-20220209 (https://download.01.org/0day-ci/archive/20220210/202202101304.wJVi3lit-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project e8bff9ae54a55b4dbfeb6ba55f723abbd81bf494)
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 mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 67512a8cf5a730938fdb1e48de33edfef6015e03
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> arch/mips/crypto/crc32-mips.c:40:1: error: expected identifier or '('
_ASM_MACRO_CRC32(crc32b, 0, 0);
^
arch/mips/crypto/crc32-mips.c:31:46: note: expanded from macro '_ASM_MACRO_CRC32'
#define _ASM_MACRO_CRC32(OP, SZ, TYPE) \
^
arch/mips/include/asm/mipsregs.h:1346:3: note: expanded from macro '\
_ASM_MACRO_3R'
".macro " #OP " " #R1 ", " #R2 ", " #R3 "\n\t" \
^
arch/mips/crypto/crc32-mips.c:41:1: error: expected identifier or '('
_ASM_MACRO_CRC32(crc32h, 1, 0);
^
arch/mips/crypto/crc32-mips.c:31:46: note: expanded from macro '_ASM_MACRO_CRC32'
#define _ASM_MACRO_CRC32(OP, SZ, TYPE) \
^
arch/mips/include/asm/mipsregs.h:1346:3: note: expanded from macro '\
_ASM_MACRO_3R'
".macro " #OP " " #R1 ", " #R2 ", " #R3 "\n\t" \
^
arch/mips/crypto/crc32-mips.c:42:1: error: expected identifier or '('
_ASM_MACRO_CRC32(crc32w, 2, 0);
^
arch/mips/crypto/crc32-mips.c:31:46: note: expanded from macro '_ASM_MACRO_CRC32'
#define _ASM_MACRO_CRC32(OP, SZ, TYPE) \
^
arch/mips/include/asm/mipsregs.h:1346:3: note: expanded from macro '\
_ASM_MACRO_3R'
".macro " #OP " " #R1 ", " #R2 ", " #R3 "\n\t" \
^
arch/mips/crypto/crc32-mips.c:43:1: error: expected identifier or '('
_ASM_MACRO_CRC32(crc32d, 3, 0);
^
arch/mips/crypto/crc32-mips.c:31:46: note: expanded from macro '_ASM_MACRO_CRC32'
#define _ASM_MACRO_CRC32(OP, SZ, TYPE) \
^
arch/mips/include/asm/mipsregs.h:1346:3: note: expanded from macro '\
_ASM_MACRO_3R'
".macro " #OP " " #R1 ", " #R2 ", " #R3 "\n\t" \
^
arch/mips/crypto/crc32-mips.c:44:1: error: expected identifier or '('
_ASM_MACRO_CRC32(crc32cb, 0, 1);
^
arch/mips/crypto/crc32-mips.c:31:46: note: expanded from macro '_ASM_MACRO_CRC32'
#define _ASM_MACRO_CRC32(OP, SZ, TYPE) \
^
arch/mips/include/asm/mipsregs.h:1346:3: note: expanded from macro '\
_ASM_MACRO_3R'
".macro " #OP " " #R1 ", " #R2 ", " #R3 "\n\t" \
^
arch/mips/crypto/crc32-mips.c:45:1: error: expected identifier or '('
_ASM_MACRO_CRC32(crc32ch, 1, 1);
^
arch/mips/crypto/crc32-mips.c:31:46: note: expanded from macro '_ASM_MACRO_CRC32'
#define _ASM_MACRO_CRC32(OP, SZ, TYPE) \
^
arch/mips/include/asm/mipsregs.h:1346:3: note: expanded from macro '\
_ASM_MACRO_3R'
".macro " #OP " " #R1 ", " #R2 ", " #R3 "\n\t" \
^
arch/mips/crypto/crc32-mips.c:46:1: error: expected identifier or '('
_ASM_MACRO_CRC32(crc32cw, 2, 1);
^
arch/mips/crypto/crc32-mips.c:31:46: note: expanded from macro '_ASM_MACRO_CRC32'
#define _ASM_MACRO_CRC32(OP, SZ, TYPE) \
^
arch/mips/include/asm/mipsregs.h:1346:3: note: expanded from macro '\
_ASM_MACRO_3R'
".macro " #OP " " #R1 ", " #R2 ", " #R3 "\n\t" \
^
arch/mips/crypto/crc32-mips.c:47:1: error: expected identifier or '('
_ASM_MACRO_CRC32(crc32cd, 3, 1);
^
arch/mips/crypto/crc32-mips.c:31:46: note: expanded from macro '_ASM_MACRO_CRC32'
#define _ASM_MACRO_CRC32(OP, SZ, TYPE) \
^
arch/mips/include/asm/mipsregs.h:1346:3: note: expanded from macro '\
_ASM_MACRO_3R'
".macro " #OP " " #R1 ", " #R2 ", " #R3 "\n\t" \
^
8 errors generated.
vim +40 arch/mips/crypto/crc32-mips.c
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 29
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 30 #ifndef TOOLCHAIN_SUPPORTS_CRC
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 31 #define _ASM_MACRO_CRC32(OP, SZ, TYPE) \
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 32 _ASM_MACRO_3R(OP, rt, rs, rt2, \
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 33 ".ifnc \\rt, \\rt2\n\t" \
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 34 ".error \"invalid operands \\\"" #OP " \\rt,\\rs,\\rt2\\\"\"\n\t" \
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 35 ".endif\n\t" \
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 36 _ASM_INSN_IF_MIPS(0x7c00000f | (__rt << 16) | (__rs << 21) | \
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 37 ((SZ) << 6) | ((TYPE) << 8)) \
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 38 _ASM_INSN32_IF_MM(0x00000030 | (__rs << 16) | (__rt << 21) | \
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 39 ((SZ) << 14) | ((TYPE) << 3)))
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 @40 _ASM_MACRO_CRC32(crc32b, 0, 0);
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 41 _ASM_MACRO_CRC32(crc32h, 1, 0);
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 42 _ASM_MACRO_CRC32(crc32w, 2, 0);
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 43 _ASM_MACRO_CRC32(crc32d, 3, 0);
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 44 _ASM_MACRO_CRC32(crc32cb, 0, 1);
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 45 _ASM_MACRO_CRC32(crc32ch, 1, 1);
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 46 _ASM_MACRO_CRC32(crc32cw, 2, 1);
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 47 _ASM_MACRO_CRC32(crc32cd, 3, 1);
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 48 #define _ASM_SET_CRC ""
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 49 #else /* !TOOLCHAIN_SUPPORTS_CRC */
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 50 #define _ASM_SET_CRC ".set\tcrc\n\t"
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 51 #endif
4a5dc51e93e8046 Marcin Nowakowski 2018-02-09 52
:::::: The code at line 40 was first introduced by commit
:::::: 4a5dc51e93e80463010ab4d8d00fc9cb6bc936fa MIPS: crypto: Add crc32 and crc32c hw accelerated module
:::::: TO: Marcin Nowakowski <marcin.nowakowski(a)mips.com>
:::::: CC: James Hogan <jhogan(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[ti:ti-rt-linux-5.10.y 8113/9999] carveout-heap.c:undefined reference to `memunmap'
by kernel test robot
Hi Andrew,
FYI, the error/warning still remains.
tree: git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-rt-linux-5.10.y
head: 1f6e95d4b12d73bd1728286f3ccc938df7b77954
commit: db3f0424e62cd12a92e31ea8c8a029ff0ce9b181 [8113/9999] dma-buf: heaps: Add Carveout heap to dmabuf heaps
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20220210/202202101315.aZWctsHc-lk...)
compiler: s390-linux-gcc (GCC) 11.2.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
git remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
git fetch --no-tags ti ti-rt-linux-5.10.y
git checkout db3f0424e62cd12a92e31ea8c8a029ff0ce9b181
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=s390 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
s390-linux-ld: kernel/dma/coherent.o: in function `dma_init_coherent_memory':
coherent.c:(.text+0x3dc): undefined reference to `memremap'
s390-linux-ld: coherent.c:(.text+0x50e): undefined reference to `memunmap'
s390-linux-ld: kernel/dma/coherent.o: in function `dma_declare_coherent_memory':
coherent.c:(.text+0x826): undefined reference to `memunmap'
s390-linux-ld: drivers/irqchip/irq-al-fic.o: in function `al_fic_init_dt':
irq-al-fic.c:(.init.text+0x6c): undefined reference to `of_iomap'
s390-linux-ld: irq-al-fic.c:(.init.text+0x4aa): undefined reference to `iounmap'
s390-linux-ld: drivers/clk/clk-fixed-mmio.o: in function `fixed_mmio_clk_setup':
clk-fixed-mmio.c:(.text+0x9a): undefined reference to `of_iomap'
s390-linux-ld: clk-fixed-mmio.c:(.text+0xe6): undefined reference to `iounmap'
s390-linux-ld: drivers/dma-buf/heaps/carveout-heap.o: in function `dma_heap_vunmap':
>> carveout-heap.c:(.text+0x90): undefined reference to `memunmap'
s390-linux-ld: drivers/dma-buf/heaps/carveout-heap.o: in function `dma_heap_vmap':
>> carveout-heap.c:(.text+0x182): undefined reference to `memremap'
s390-linux-ld: drivers/dma-buf/heaps/carveout-heap.o: in function `dma_heap_dma_buf_release':
carveout-heap.c:(.text+0x386): undefined reference to `memunmap'
s390-linux-ld: drivers/clocksource/timer-of.o: in function `timer_of_init':
timer-of.c:(.init.text+0x106): undefined reference to `of_iomap'
s390-linux-ld: timer-of.c:(.init.text+0x73a): undefined reference to `iounmap'
s390-linux-ld: drivers/clocksource/timer-of.o: in function `timer_of_cleanup':
timer-of.c:(.init.text+0x8fe): undefined reference to `iounmap'
s390-linux-ld: drivers/clocksource/timer-microchip-pit64b.o: in function `mchp_pit64b_dt_init_timer':
timer-microchip-pit64b.c:(.init.text+0x5aa): undefined reference to `of_iomap'
s390-linux-ld: timer-microchip-pit64b.c:(.init.text+0xb12): undefined reference to `iounmap'
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for MFD_CORE
Depends on HAS_IOMEM
Selected by
- MFD_HI6421_SPMI && STAGING && OF && SPMI
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[xilinx-xlnx:xlnx_rebase_v5.15 439/907] drivers/hwmon/pmbus/tps544.c:67:16: error: too few arguments to function 'pmbus_read_word_data'
by kernel test robot
tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15
head: 423a108a01e05e84b59a4c4885c16bf3cd8c90c7
commit: 270d60faa80afd4bdbb1c523372d902eaecd34cf [439/907] pmbus: Add new tps544 power regulator driver
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220210/202202101135.qfEi02y2-lk...)
compiler: arceb-elf-gcc (GCC) 11.2.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/Xilinx/linux-xlnx/commit/270d60faa80afd4bdbb1c523372d9...
git remote add xilinx-xlnx https://github.com/Xilinx/linux-xlnx
git fetch --no-tags xilinx-xlnx xlnx_rebase_v5.15
git checkout 270d60faa80afd4bdbb1c523372d902eaecd34cf
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Note: the xilinx-xlnx/xlnx_rebase_v5.15 HEAD 423a108a01e05e84b59a4c4885c16bf3cd8c90c7 builds fine.
It only hurts bisectability.
All errors (new ones prefixed by >>):
drivers/hwmon/pmbus/tps544.c: In function 'tps544_read_word_data':
>> drivers/hwmon/pmbus/tps544.c:67:16: error: too few arguments to function 'pmbus_read_word_data'
67 | return pmbus_read_word_data(client, page, reg);
| ^~~~~~~~~~~~~~~~~~~~
In file included from drivers/hwmon/pmbus/tps544.c:16:
drivers/hwmon/pmbus/pmbus.h:480:5: note: declared here
480 | int pmbus_read_word_data(struct i2c_client *client, int page, int phase,
| ^~~~~~~~~~~~~~~~~~~~
drivers/hwmon/pmbus/tps544.c: In function 'tps544_regulator_get_voltage':
drivers/hwmon/pmbus/tps544.c:98:16: error: too few arguments to function 'pmbus_read_word_data'
98 | return pmbus_read_word_data(client, page, PMBUS_READ_VOUT);
| ^~~~~~~~~~~~~~~~~~~~
In file included from drivers/hwmon/pmbus/tps544.c:16:
drivers/hwmon/pmbus/pmbus.h:480:5: note: declared here
480 | int pmbus_read_word_data(struct i2c_client *client, int page, int phase,
| ^~~~~~~~~~~~~~~~~~~~
drivers/hwmon/pmbus/tps544.c: In function 'tps544_geti_show':
drivers/hwmon/pmbus/tps544.c:203:20: error: too few arguments to function 'pmbus_read_word_data'
203 | reg_iout = pmbus_read_word_data(client, 0, PMBUS_READ_IOUT) &
| ^~~~~~~~~~~~~~~~~~~~
In file included from drivers/hwmon/pmbus/tps544.c:16:
drivers/hwmon/pmbus/pmbus.h:480:5: note: declared here
480 | int pmbus_read_word_data(struct i2c_client *client, int page, int phase,
| ^~~~~~~~~~~~~~~~~~~~
drivers/hwmon/pmbus/tps544.c: In function 'tps544_setcali_show':
drivers/hwmon/pmbus/tps544.c:217:20: error: too few arguments to function 'pmbus_read_word_data'
217 | reg_cali = pmbus_read_word_data(client, 0, TPS544_MFR_IOUT_CAL_OFFSET);
| ^~~~~~~~~~~~~~~~~~~~
In file included from drivers/hwmon/pmbus/tps544.c:16:
drivers/hwmon/pmbus/pmbus.h:480:5: note: declared here
480 | int pmbus_read_word_data(struct i2c_client *client, int page, int phase,
| ^~~~~~~~~~~~~~~~~~~~
drivers/hwmon/pmbus/tps544.c: In function 'tps544_probe':
>> drivers/hwmon/pmbus/tps544.c:287:30: error: assignment to 'int (*)(struct i2c_client *, int, int, int)' from incompatible pointer type 'int (*)(struct i2c_client *, int, int)' [-Werror=incompatible-pointer-types]
287 | info->read_word_data = tps544_read_word_data;
| ^
>> drivers/hwmon/pmbus/tps544.c:320:39: error: passing argument 2 of 'pmbus_do_probe' from incompatible pointer type [-Werror=incompatible-pointer-types]
320 | return pmbus_do_probe(client, id, info);
| ^~
| |
| const struct i2c_device_id *
In file included from drivers/hwmon/pmbus/tps544.c:16:
drivers/hwmon/pmbus/pmbus.h:493:73: note: expected 'struct pmbus_driver_info *' but argument is of type 'const struct i2c_device_id *'
493 | int pmbus_do_probe(struct i2c_client *client, struct pmbus_driver_info *info);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
>> drivers/hwmon/pmbus/tps544.c:320:16: error: too many arguments to function 'pmbus_do_probe'
320 | return pmbus_do_probe(client, id, info);
| ^~~~~~~~~~~~~~
In file included from drivers/hwmon/pmbus/tps544.c:16:
drivers/hwmon/pmbus/pmbus.h:493:5: note: declared here
493 | int pmbus_do_probe(struct i2c_client *client, struct pmbus_driver_info *info);
| ^~~~~~~~~~~~~~
drivers/hwmon/pmbus/tps544.c: In function 'tps544_remove':
>> drivers/hwmon/pmbus/tps544.c:331:9: error: implicit declaration of function 'pmbus_do_remove'; did you mean 'pmbus_do_probe'? [-Werror=implicit-function-declaration]
331 | pmbus_do_remove(client);
| ^~~~~~~~~~~~~~~
| pmbus_do_probe
drivers/hwmon/pmbus/tps544.c: In function 'tps544_regulator_get_voltage':
drivers/hwmon/pmbus/tps544.c:99:1: error: control reaches end of non-void function [-Werror=return-type]
99 | }
| ^
drivers/hwmon/pmbus/tps544.c: In function 'tps544_read_word_data':
drivers/hwmon/pmbus/tps544.c:68:1: error: control reaches end of non-void function [-Werror=return-type]
68 | }
| ^
cc1: some warnings being treated as errors
vim +/pmbus_read_word_data +67 drivers/hwmon/pmbus/tps544.c
> 16 #include "pmbus.h"
17
18 #define TPS544_NUM_PAGES 1
19
20 struct tps544_data {
21 struct device *dev;
22 u16 vout_min[TPS544_NUM_PAGES], vout_max[TPS544_NUM_PAGES];
23 struct pmbus_driver_info info;
24 };
25
26 struct vlut {
27 int vol;
28 u16 vloop;
29 u16 v_ovfault;
30 u16 v_ovwarn;
31 u16 vmax;
32 u16 mfr_vmin;
33 u16 v_uvwarn;
34 u16 v_uvfault;
35 };
36
37 #if IS_ENABLED(CONFIG_SENSORS_TPS544_REGULATOR)
38 #define TPS544_MFR_VOUT_MIN 0xA4
39 #define TPS544_MFR_RESTORE_DEF_ALL 0x12
40 #define TPS544_MFR_IOUT_CAL_OFFSET 0x39
41
42 #define TPS544_VOUTREAD_MULTIPLIER 1950
43 #define TPS544_IOUTREAD_MULTIPLIER 62500
44 #define TPS544_IOUTREAD_MASK GENMASK(9, 0)
45
46 #define TPS544_VOUT_LIMIT 5300000
47
48 #define to_tps544_data(x) container_of(x, struct tps544_data, info)
49
50 /*
51 * This currently supports 3 voltage out buckets:
52 * 0.5V to 1.3V
53 * 1.3V to 2.6V
54 * 2.6V to 5.3V
55 * Any requested voltage will be mapped to one of these buckets and
56 * VOUT will be programmed with 0.1V granularity.
57 */
58 static const struct vlut tps544_vout[3] = {
59 {500000, 0xF004, 0x0290, 0x0285, 0x0300, 0x0100, 0x00CD, 0x009A},
60 {1300000, 0xF002, 0x059A, 0x0566, 0x0600, 0x0100, 0x0143, 0x0130},
61 {2600000, 0xF001, 0x0B00, 0x0A9A, 0x0A00, 0x0100, 0x0143, 0x0130}
62 };
63 #endif
64
65 static int tps544_read_word_data(struct i2c_client *client, int page, int reg)
66 {
> 67 return pmbus_read_word_data(client, page, reg);
68 }
69
70 static int tps544_read_byte_data(struct i2c_client *client, int page, int reg)
71 {
72 return pmbus_read_byte_data(client, page, reg);
73 }
74
75 static int tps544_write_byte(struct i2c_client *client, int page, u8 byte)
76 {
77 return pmbus_write_byte(client, page, byte);
78 }
79
80 static int tps544_write_word_data(struct i2c_client *client, int page,
81 int reg, u16 word)
82 {
83 int ret;
84
85 ret = pmbus_write_word_data(client, page, reg, word);
86 /* TODO - Define new PMBUS virtual register entries for these */
87
88 return ret;
89 }
90
91 #if IS_ENABLED(CONFIG_SENSORS_TPS544_REGULATOR)
92 static int tps544_regulator_get_voltage(struct regulator_dev *rdev)
93 {
94 struct device *dev = rdev_get_dev(rdev);
95 struct i2c_client *client = to_i2c_client(dev->parent);
96 int page = 0;
97
98 return pmbus_read_word_data(client, page, PMBUS_READ_VOUT);
99 }
100
101 static int tps544_regulator_set_voltage(struct regulator_dev *rdev, int min_uV,
102 int max_uV, unsigned int *selector)
103 {
104 struct device *dev = rdev_get_dev(rdev);
105 struct i2c_client *client = to_i2c_client(dev->parent);
106 const struct pmbus_driver_info *info = pmbus_get_driver_info(client);
107 struct tps544_data *data = to_tps544_data(info);
108 int index, page = 0;
109 u16 vout;
110
111 /* voltage will be set close to min value requested */
112 vout = (u16)((min_uV * 512) / 1000000);
113
114 /* Check voltage bucket */
115 if (min_uV >= tps544_vout[2].vol)
116 index = 2;
117 else if (min_uV >= tps544_vout[1].vol)
118 index = 1;
119 else if (min_uV >= tps544_vout[0].vol)
120 index = 0;
121 else
122 return -EINVAL;
123
124 pmbus_write_word_data(client, page, PMBUS_VOUT_SCALE_LOOP,
125 tps544_vout[index].vloop);
126 /* Use delay after setting scale loop; this is derived from testing */
127 msleep(2000);
128 pmbus_write_word_data(client, page, PMBUS_VOUT_OV_FAULT_LIMIT,
129 tps544_vout[index].v_ovfault);
130 pmbus_write_word_data(client, page, PMBUS_VOUT_OV_WARN_LIMIT,
131 tps544_vout[index].v_ovwarn);
132 pmbus_write_word_data(client, page, PMBUS_VOUT_MAX,
133 tps544_vout[index].vmax);
134 pmbus_write_word_data(client, page, PMBUS_VOUT_COMMAND, vout);
135 tps544_write_word_data(client, page, TPS544_MFR_VOUT_MIN,
136 tps544_vout[index].mfr_vmin);
137 pmbus_write_word_data(client, page, PMBUS_VOUT_UV_WARN_LIMIT,
138 tps544_vout[index].v_uvwarn);
139 pmbus_write_word_data(client, page, PMBUS_VOUT_UV_FAULT_LIMIT,
140 tps544_vout[index].v_uvfault);
141
142 data->vout_min[page] = min_uV;
143 data->vout_max[page] = max_uV;
144
145 return 0;
146 }
147
148 static ssize_t tps544_setv_show(struct device *dev,
149 struct device_attribute *attr, char *buf)
150 {
151 struct regulator_dev *rdev = dev_get_drvdata(dev);
152 int vout;
153
154 vout = tps544_regulator_get_voltage(rdev) * TPS544_VOUTREAD_MULTIPLIER;
155 return sprintf(buf, "%d\n", vout);
156 }
157
158 static ssize_t tps544_setv_store(struct device *dev,
159 struct device_attribute *attr,
160 const char *buf, size_t count)
161 {
162 struct regulator_dev *rdev = dev_get_drvdata(dev);
163 int val;
164 int err;
165
166 err = kstrtoint(buf, 0, &val);
167 if (err)
168 return err;
169 if (val > TPS544_VOUT_LIMIT)
170 return -EINVAL;
171
172 err = tps544_regulator_set_voltage(rdev, val, val, NULL);
173 if (err)
174 return err;
175
176 return count;
177 }
178
179 static DEVICE_ATTR_RW(tps544_setv);
180
181 static ssize_t tps544_restorev_store(struct device *dev,
182 struct device_attribute *attr,
183 const char *buf, size_t count)
184 {
185 struct i2c_client *client = to_i2c_client(dev->parent);
186 int err;
187
188 err = pmbus_write_byte(client, 0, TPS544_MFR_RESTORE_DEF_ALL);
189 if (err)
190 return err;
191
192 return count;
193 }
194
195 static DEVICE_ATTR_WO(tps544_restorev);
196
197 static ssize_t tps544_geti_show(struct device *dev,
198 struct device_attribute *attr, char *buf)
199 {
200 struct i2c_client *client = to_i2c_client(dev->parent);
201 u16 reg_iout;
202
203 reg_iout = pmbus_read_word_data(client, 0, PMBUS_READ_IOUT) &
204 TPS544_IOUTREAD_MASK;
205
206 return sprintf(buf, "%d\n", reg_iout * TPS544_IOUTREAD_MULTIPLIER);
207 }
208
209 static DEVICE_ATTR_RO(tps544_geti);
210
211 static ssize_t tps544_setcali_show(struct device *dev,
212 struct device_attribute *attr, char *buf)
213 {
214 struct i2c_client *client = to_i2c_client(dev->parent);
215 int reg_cali;
216
> 217 reg_cali = pmbus_read_word_data(client, 0, TPS544_MFR_IOUT_CAL_OFFSET);
218
219 return sprintf(buf, "Current: 0x%x; Set value in hex to calibrate\n",
220 reg_cali);
221 }
222
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
Re: [Intel-gfx] [PATCH v5 1/5] drm/i915/gsc: add gsc as a mei auxiliary device
by kernel test robot
Hi Alexander,
Thanks for your patch! Perhaps something to improve:
[auto build test WARNING on drm-tip/drm-tip]
[also build test WARNING on next-20220209]
[cannot apply to drm-intel/for-linux-next char-misc/char-misc-testing linus/master v5.17-rc3]
[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]
url: https://github.com/0day-ci/linux/commits/Alexander-Usyskin/Add-driver-for...
base: git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: i386-randconfig-c001-20220207 (https://download.01.org/0day-ci/archive/20220209/202202092218.JQby54ao-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0d8850ae2cae85d49bea6ae0799fa41c7202c05c)
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/0day-ci/linux/commit/3640b7d101ae88e367a0abc2cda8eb46d...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alexander-Usyskin/Add-driver-for-GSC-controller/20220206-211428
git checkout 3640b7d101ae88e367a0abc2cda8eb46dbab2982
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <yujie.liu(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/i915/gt/intel_gsc.c:109:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
ret = -ENOMEM;
^ ~~~~~~~
>> drivers/gpu/drm/i915/gt/intel_gsc.c:112:2: warning: Value stored to 'aux_dev' is never read [clang-analyzer-deadcode.DeadStores]
aux_dev = &adev->aux_dev;
^ ~~~~~~~~~~~~~~
vim +/ret +109 drivers/gpu/drm/i915/gt/intel_gsc.c
3640b7d101ae88 Tomas Winkler 2022-02-06 75
3640b7d101ae88 Tomas Winkler 2022-02-06 76 static void intel_gsc_init_one(struct drm_i915_private *dev_priv,
3640b7d101ae88 Tomas Winkler 2022-02-06 77 struct intel_gsc_intf *intf,
3640b7d101ae88 Tomas Winkler 2022-02-06 78 unsigned int intf_id)
3640b7d101ae88 Tomas Winkler 2022-02-06 79 {
3640b7d101ae88 Tomas Winkler 2022-02-06 80 struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
3640b7d101ae88 Tomas Winkler 2022-02-06 81 struct mei_aux_device *adev;
3640b7d101ae88 Tomas Winkler 2022-02-06 82 struct auxiliary_device *aux_dev;
3640b7d101ae88 Tomas Winkler 2022-02-06 83 const struct intel_gsc_def *def;
3640b7d101ae88 Tomas Winkler 2022-02-06 84 int ret;
3640b7d101ae88 Tomas Winkler 2022-02-06 85
3640b7d101ae88 Tomas Winkler 2022-02-06 86 intf->irq = -1;
3640b7d101ae88 Tomas Winkler 2022-02-06 87 intf->id = intf_id;
3640b7d101ae88 Tomas Winkler 2022-02-06 88
3640b7d101ae88 Tomas Winkler 2022-02-06 89 if (intf_id == 0 && !HAS_HECI_PXP(dev_priv))
3640b7d101ae88 Tomas Winkler 2022-02-06 90 return;
3640b7d101ae88 Tomas Winkler 2022-02-06 91
3640b7d101ae88 Tomas Winkler 2022-02-06 92 def = &intel_gsc_def_dg1[intf_id];
3640b7d101ae88 Tomas Winkler 2022-02-06 93
3640b7d101ae88 Tomas Winkler 2022-02-06 94 dev_dbg(&pdev->dev, "init gsc one with id %d\n", intf_id);
3640b7d101ae88 Tomas Winkler 2022-02-06 95 intf->irq = irq_alloc_desc(0);
3640b7d101ae88 Tomas Winkler 2022-02-06 96 if (intf->irq < 0) {
3640b7d101ae88 Tomas Winkler 2022-02-06 97 dev_err(&pdev->dev, "gsc irq error %d\n", intf->irq);
3640b7d101ae88 Tomas Winkler 2022-02-06 98 return;
3640b7d101ae88 Tomas Winkler 2022-02-06 99 }
3640b7d101ae88 Tomas Winkler 2022-02-06 100
3640b7d101ae88 Tomas Winkler 2022-02-06 101 ret = gsc_irq_init(dev_priv, intf->irq);
3640b7d101ae88 Tomas Winkler 2022-02-06 102 if (ret < 0) {
3640b7d101ae88 Tomas Winkler 2022-02-06 103 dev_err(&pdev->dev, "gsc irq init failed %d\n", ret);
3640b7d101ae88 Tomas Winkler 2022-02-06 104 goto fail;
3640b7d101ae88 Tomas Winkler 2022-02-06 105 }
3640b7d101ae88 Tomas Winkler 2022-02-06 106
3640b7d101ae88 Tomas Winkler 2022-02-06 107 adev = kzalloc(sizeof(*adev), GFP_KERNEL);
3640b7d101ae88 Tomas Winkler 2022-02-06 108 if (!adev) {
3640b7d101ae88 Tomas Winkler 2022-02-06 @109 ret = -ENOMEM;
3640b7d101ae88 Tomas Winkler 2022-02-06 110 goto fail;
3640b7d101ae88 Tomas Winkler 2022-02-06 111 }
3640b7d101ae88 Tomas Winkler 2022-02-06 @112 aux_dev = &adev->aux_dev;
3640b7d101ae88 Tomas Winkler 2022-02-06 113
3640b7d101ae88 Tomas Winkler 2022-02-06 114 adev->irq = intf->irq;
3640b7d101ae88 Tomas Winkler 2022-02-06 115 adev->bar.parent = &pdev->resource[0];
3640b7d101ae88 Tomas Winkler 2022-02-06 116 adev->bar.start = def->bar + pdev->resource[0].start;
3640b7d101ae88 Tomas Winkler 2022-02-06 117 adev->bar.end = adev->bar.start + def->bar_size - 1;
3640b7d101ae88 Tomas Winkler 2022-02-06 118 adev->bar.flags = IORESOURCE_MEM;
3640b7d101ae88 Tomas Winkler 2022-02-06 119 adev->bar.desc = IORES_DESC_NONE;
3640b7d101ae88 Tomas Winkler 2022-02-06 120
3640b7d101ae88 Tomas Winkler 2022-02-06 121 aux_dev = &adev->aux_dev;
3640b7d101ae88 Tomas Winkler 2022-02-06 122 aux_dev->name = def->name;
3640b7d101ae88 Tomas Winkler 2022-02-06 123 aux_dev->id = (pci_domain_nr(pdev->bus) << 16) |
3640b7d101ae88 Tomas Winkler 2022-02-06 124 PCI_DEVID(pdev->bus->number, pdev->devfn);
3640b7d101ae88 Tomas Winkler 2022-02-06 125 aux_dev->dev.parent = &pdev->dev;
3640b7d101ae88 Tomas Winkler 2022-02-06 126 aux_dev->dev.release = intel_gsc_release_dev;
3640b7d101ae88 Tomas Winkler 2022-02-06 127
3640b7d101ae88 Tomas Winkler 2022-02-06 128 ret = auxiliary_device_init(aux_dev);
3640b7d101ae88 Tomas Winkler 2022-02-06 129 if (ret < 0) {
3640b7d101ae88 Tomas Winkler 2022-02-06 130 dev_err(&pdev->dev, "gsc aux init failed %d\n", ret);
3640b7d101ae88 Tomas Winkler 2022-02-06 131 kfree(adev);
3640b7d101ae88 Tomas Winkler 2022-02-06 132 goto fail;
3640b7d101ae88 Tomas Winkler 2022-02-06 133 }
3640b7d101ae88 Tomas Winkler 2022-02-06 134
3640b7d101ae88 Tomas Winkler 2022-02-06 135 ret = auxiliary_device_add(aux_dev);
3640b7d101ae88 Tomas Winkler 2022-02-06 136 if (ret < 0) {
3640b7d101ae88 Tomas Winkler 2022-02-06 137 dev_err(&pdev->dev, "gsc aux add failed %d\n", ret);
3640b7d101ae88 Tomas Winkler 2022-02-06 138 /* adev will be freed with the put_device() and .release sequence */
3640b7d101ae88 Tomas Winkler 2022-02-06 139 auxiliary_device_uninit(aux_dev);
3640b7d101ae88 Tomas Winkler 2022-02-06 140 goto fail;
3640b7d101ae88 Tomas Winkler 2022-02-06 141 }
3640b7d101ae88 Tomas Winkler 2022-02-06 142 intf->adev = adev;
3640b7d101ae88 Tomas Winkler 2022-02-06 143
3640b7d101ae88 Tomas Winkler 2022-02-06 144 dev_dbg(&pdev->dev, "gsc init one done\n");
3640b7d101ae88 Tomas Winkler 2022-02-06 145 return;
3640b7d101ae88 Tomas Winkler 2022-02-06 146 fail:
3640b7d101ae88 Tomas Winkler 2022-02-06 147 intel_gsc_destroy_one(intf);
3640b7d101ae88 Tomas Winkler 2022-02-06 148 }
3640b7d101ae88 Tomas Winkler 2022-02-06 149
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week