Re: [PATCH v7 3/4] gpiolib: Pass array info to get/set array functions

From: kbuild test robot
Date: Wed Sep 05 2018 - 03:12:24 EST


Hi Janusz,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on gpio/for-next]
[also build test ERROR on v4.19-rc2 next-20180905]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Janusz-Krzysztofik/gpiolib-Pass-bitmaps-not-integer-arrays-to-get-set-array/20180903-172834
base: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git for-next
config: x86_64-randconfig-f2-201835 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

All errors (new ones prefixed by >>):

drivers/phy/motorola/phy-mapphone-mdm6600.c: In function 'phy_mdm6600_cmd':
drivers/phy/motorola/phy-mapphone-mdm6600.c:166:12: error: passing argument 3 of 'gpiod_set_array_value_cansleep' from incompatible pointer type [-Werror=incompatible-pointer-types]
ddata->cmd_gpios->info, values);
^~~~~
In file included from drivers/phy/motorola/phy-mapphone-mdm6600.c:16:0:
include/linux/gpio/consumer.h:417:20: note: expected 'int *' but argument is of type 'struct gpio_array *'
static inline void gpiod_set_array_value_cansleep(unsigned int array_size,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/phy/motorola/phy-mapphone-mdm6600.c:164:2: error: too many arguments to function 'gpiod_set_array_value_cansleep'
gpiod_set_array_value_cansleep(PHY_MDM6600_NR_CMD_LINES,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/phy/motorola/phy-mapphone-mdm6600.c:16:0:
include/linux/gpio/consumer.h:417:20: note: declared here
static inline void gpiod_set_array_value_cansleep(unsigned int array_size,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/phy/motorola/phy-mapphone-mdm6600.c: In function 'phy_mdm6600_status':
drivers/phy/motorola/phy-mapphone-mdm6600.c:185:13: error: passing argument 3 of 'gpiod_get_array_value_cansleep' from incompatible pointer type [-Werror=incompatible-pointer-types]
ddata->status_gpios->info,
^~~~~
In file included from drivers/phy/motorola/phy-mapphone-mdm6600.c:16:0:
include/linux/gpio/consumer.h:404:19: note: expected 'int *' but argument is of type 'struct gpio_array *'
static inline int gpiod_get_array_value_cansleep(unsigned int array_size,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/phy/motorola/phy-mapphone-mdm6600.c:183:10: error: too many arguments to function 'gpiod_get_array_value_cansleep'
error = gpiod_get_array_value_cansleep(PHY_MDM6600_NR_STATUS_LINES,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/phy/motorola/phy-mapphone-mdm6600.c:16:0:
include/linux/gpio/consumer.h:404:19: note: declared here
static inline int gpiod_get_array_value_cansleep(unsigned int array_size,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

vim +/gpiod_set_array_value_cansleep +164 drivers/phy/motorola/phy-mapphone-mdm6600.c

5d1ebbda0 Tony Lindgren 2018-03-08 151
5d1ebbda0 Tony Lindgren 2018-03-08 152 /**
5d1ebbda0 Tony Lindgren 2018-03-08 153 * phy_mdm6600_cmd() - send a command request to mdm6600
5d1ebbda0 Tony Lindgren 2018-03-08 154 * @ddata: device driver data
5d1ebbda0 Tony Lindgren 2018-03-08 155 *
5d1ebbda0 Tony Lindgren 2018-03-08 156 * Configures the three command request GPIOs to the specified value.
5d1ebbda0 Tony Lindgren 2018-03-08 157 */
5d1ebbda0 Tony Lindgren 2018-03-08 158 static void phy_mdm6600_cmd(struct phy_mdm6600 *ddata, int val)
5d1ebbda0 Tony Lindgren 2018-03-08 159 {
916010a73 Janusz Krzysztofik 2018-09-02 160 DECLARE_BITMAP(values, PHY_MDM6600_NR_CMD_LINES);
5d1ebbda0 Tony Lindgren 2018-03-08 161
916010a73 Janusz Krzysztofik 2018-09-02 162 *values = val;
5d1ebbda0 Tony Lindgren 2018-03-08 163
5d1ebbda0 Tony Lindgren 2018-03-08 @164 gpiod_set_array_value_cansleep(PHY_MDM6600_NR_CMD_LINES,
dea6937cb Janusz Krzysztofik 2018-09-02 165 ddata->cmd_gpios->desc,
dea6937cb Janusz Krzysztofik 2018-09-02 @166 ddata->cmd_gpios->info, values);
5d1ebbda0 Tony Lindgren 2018-03-08 167 }
5d1ebbda0 Tony Lindgren 2018-03-08 168
5d1ebbda0 Tony Lindgren 2018-03-08 169 /**
5d1ebbda0 Tony Lindgren 2018-03-08 170 * phy_mdm6600_status() - read mdm6600 status lines
5d1ebbda0 Tony Lindgren 2018-03-08 171 * @ddata: device driver data
5d1ebbda0 Tony Lindgren 2018-03-08 172 */
5d1ebbda0 Tony Lindgren 2018-03-08 173 static void phy_mdm6600_status(struct work_struct *work)
5d1ebbda0 Tony Lindgren 2018-03-08 174 {
5d1ebbda0 Tony Lindgren 2018-03-08 175 struct phy_mdm6600 *ddata;
5d1ebbda0 Tony Lindgren 2018-03-08 176 struct device *dev;
916010a73 Janusz Krzysztofik 2018-09-02 177 DECLARE_BITMAP(values, PHY_MDM6600_NR_STATUS_LINES);
5d1ebbda0 Tony Lindgren 2018-03-08 178 int error, i, val = 0;
5d1ebbda0 Tony Lindgren 2018-03-08 179
5d1ebbda0 Tony Lindgren 2018-03-08 180 ddata = container_of(work, struct phy_mdm6600, status_work.work);
5d1ebbda0 Tony Lindgren 2018-03-08 181 dev = ddata->dev;
5d1ebbda0 Tony Lindgren 2018-03-08 182
ad5003300 Tony Lindgren 2018-05-31 @183 error = gpiod_get_array_value_cansleep(PHY_MDM6600_NR_STATUS_LINES,
5d1ebbda0 Tony Lindgren 2018-03-08 184 ddata->status_gpios->desc,
dea6937cb Janusz Krzysztofik 2018-09-02 @185 ddata->status_gpios->info,
5d1ebbda0 Tony Lindgren 2018-03-08 186 values);
5d1ebbda0 Tony Lindgren 2018-03-08 187 if (error)
5d1ebbda0 Tony Lindgren 2018-03-08 188 return;
5d1ebbda0 Tony Lindgren 2018-03-08 189
ad5003300 Tony Lindgren 2018-05-31 190 for (i = 0; i < PHY_MDM6600_NR_STATUS_LINES; i++) {
916010a73 Janusz Krzysztofik 2018-09-02 191 val |= test_bit(i, values) << i;
5d1ebbda0 Tony Lindgren 2018-03-08 192 dev_dbg(ddata->dev, "XXX %s: i: %i values[i]: %i val: %i\n",
916010a73 Janusz Krzysztofik 2018-09-02 193 __func__, i, test_bit(i, values), val);
5d1ebbda0 Tony Lindgren 2018-03-08 194 }
5d1ebbda0 Tony Lindgren 2018-03-08 195 ddata->status = val;
5d1ebbda0 Tony Lindgren 2018-03-08 196
5d1ebbda0 Tony Lindgren 2018-03-08 197 dev_info(dev, "modem status: %i %s\n",
5d1ebbda0 Tony Lindgren 2018-03-08 198 ddata->status,
5d1ebbda0 Tony Lindgren 2018-03-08 199 phy_mdm6600_status_name[ddata->status & 7]);
5d1ebbda0 Tony Lindgren 2018-03-08 200 complete(&ddata->ack);
5d1ebbda0 Tony Lindgren 2018-03-08 201 }
5d1ebbda0 Tony Lindgren 2018-03-08 202

:::::: The code at line 164 was first introduced by commit
:::::: 5d1ebbda0318b1ba55eaa1fae3fd867af17b0774 phy: mapphone-mdm6600: Add USB PHY driver for MDM6600 on Droid 4

:::::: TO: Tony Lindgren <tony@xxxxxxxxxxx>
:::::: CC: Kishon Vijay Abraham I <kishon@xxxxxx>

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

Attachment: .config.gz
Description: application/gzip