[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202211050530.DddmJkhO-lkp@intel.com>
Date: Sat, 5 Nov 2022 05:50:51 +0800
From: kernel test robot <lkp@...el.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
linux-kernel@...r.kernel.org, Pavel Machek <pavel@....cz>,
Vincent Knecht <vincent.knecht@...loo.org>
Subject: drivers/leds/leds-is31fl319x.c:514:29: warning: cast from 'void
(*)(struct mutex *)' to 'void (*)(void *)' converts to incompatible function
type
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ee6050c8af96bba2f81e8b0793a1fc2f998fcd20
commit: e1af5c8155867e6773474649c76e5c68940008d5 leds: is31fl319x: Fix devm vs. non-devm ordering
date: 3 months ago
config: hexagon-randconfig-r041-20221104
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 2bbafe04fe785a9469bea5a3737f8d7d3ce4aca2)
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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e1af5c8155867e6773474649c76e5c68940008d5
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout e1af5c8155867e6773474649c76e5c68940008d5
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/leds/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> drivers/leds/leds-is31fl319x.c:514:29: warning: cast from 'void (*)(struct mutex *)' to 'void (*)(void *)' converts to incompatible function type [-Wcast-function-type-strict]
err = devm_add_action(dev, (void (*)(void *))mutex_destroy, &is31->lock);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
vim +514 drivers/leds/leds-is31fl319x.c
496
497 static int is31fl319x_probe(struct i2c_client *client,
498 const struct i2c_device_id *id)
499 {
500 struct is31fl319x_chip *is31;
501 struct device *dev = &client->dev;
502 int err;
503 int i = 0;
504 u32 aggregated_led_microamp;
505
506 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
507 return -EIO;
508
509 is31 = devm_kzalloc(&client->dev, sizeof(*is31), GFP_KERNEL);
510 if (!is31)
511 return -ENOMEM;
512
513 mutex_init(&is31->lock);
> 514 err = devm_add_action(dev, (void (*)(void *))mutex_destroy, &is31->lock);
515 if (err)
516 return err;
517
518 err = is31fl319x_parse_fw(&client->dev, is31);
519 if (err)
520 return err;
521
522 if (is31->shutdown_gpio) {
523 gpiod_direction_output(is31->shutdown_gpio, 0);
524 mdelay(5);
525 gpiod_direction_output(is31->shutdown_gpio, 1);
526 }
527
528 is31->client = client;
529 is31->regmap = devm_regmap_init_i2c(client, is31->cdef->is31fl319x_regmap_config);
530 if (IS_ERR(is31->regmap))
531 return dev_err_probe(dev, PTR_ERR(is31->regmap), "failed to allocate register map\n");
532
533 i2c_set_clientdata(client, is31);
534
535 /* check for write-reply from chip (we can't read any registers) */
536 err = regmap_write(is31->regmap, is31->cdef->reset_reg, 0x00);
537 if (err < 0)
538 return dev_err_probe(dev, err, "no response from chip write\n");
539
540 /*
541 * Kernel conventions require per-LED led-max-microamp property.
542 * But the chip does not allow to limit individual LEDs.
543 * So we take minimum from all subnodes for safety of hardware.
544 */
545 aggregated_led_microamp = is31->cdef->current_max;
546 for (i = 0; i < is31->cdef->num_leds; i++)
547 if (is31->leds[i].configured &&
548 is31->leds[i].max_microamp < aggregated_led_microamp)
549 aggregated_led_microamp = is31->leds[i].max_microamp;
550
551 if (is31->cdef->is_3196or3199)
552 regmap_write(is31->regmap, IS31FL3196_CONFIG2,
553 is31fl3196_microamp_to_cs(dev, aggregated_led_microamp) |
554 is31fl3196_db_to_gain(is31->audio_gain_db));
555 else
556 regmap_update_bits(is31->regmap, IS31FL3190_CURRENT, IS31FL3190_CURRENT_MASK,
557 is31fl3190_microamp_to_cs(dev, aggregated_led_microamp));
558
559 for (i = 0; i < is31->cdef->num_leds; i++) {
560 struct is31fl319x_led *led = &is31->leds[i];
561
562 if (!led->configured)
563 continue;
564
565 led->chip = is31;
566 led->cdev.brightness_set_blocking = is31->cdef->brightness_set;
567
568 err = devm_led_classdev_register(&client->dev, &led->cdev);
569 if (err < 0)
570 return err;
571 }
572
573 return 0;
574 }
575
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (99498 bytes)
Powered by blists - more mailing lists