iio:imu:inv_mpu6050: Suppress clang W=1 warning about pointer to enum conversion.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 28 Nov 2021 17:24:41 +0000 (17:24 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 21 Dec 2021 15:10:09 +0000 (15:10 +0000)
Cast to a uintptr_t rather than directly to the enum.

As per the discussion in below linked media patch.

Link: https://lore.kernel.org/linux-media/CAK8P3a2ez6nEw4d+Mqa3XXAz0RFTZHunqqRj6sCt7Y_Eqqs0rw@mail.gmail.com/
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: Baptiste Mansuy <bmansuy@invensense.com>
Cc: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20211128172445.2616166-9-jic23@kernel.org
drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c

index 3ef17e3..fe03707 100644 (file)
@@ -110,7 +110,7 @@ static int inv_mpu_probe(struct i2c_client *client,
 
        match = device_get_match_data(&client->dev);
        if (match) {
-               chip_type = (enum inv_devices)match;
+               chip_type = (uintptr_t)match;
                name = client->name;
        } else if (id) {
                chip_type = (enum inv_devices)
index b056f3f..6800356 100644 (file)
@@ -45,7 +45,7 @@ static int inv_mpu_probe(struct spi_device *spi)
                chip_type = (enum inv_devices)spi_id->driver_data;
                name = spi_id->name;
        } else if ((match = device_get_match_data(&spi->dev))) {
-               chip_type = (enum inv_devices)match;
+               chip_type = (uintptr_t)match;
                name = dev_name(&spi->dev);
        } else {
                return -ENODEV;