Patch "leds: is31fl319x: Wrap mutex_destroy() for devm_add_action_or_rest()" has been added to the 6.1-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    leds: is31fl319x: Wrap mutex_destroy() for devm_add_action_or_rest()

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     leds-is31fl319x-wrap-mutex_destroy-for-devm_add_acti.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 2fc21d2ad89bfc7f6d0089198e0fc6c744bda80d
Author: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Date:   Wed Dec 28 11:32:38 2022 +0200

    leds: is31fl319x: Wrap mutex_destroy() for devm_add_action_or_rest()
    
    [ Upstream commit a82c7cf803d98751cd3ddb35828faad925d71982 ]
    
    Clang complains that devm_add_action() takes a parameter with a wrong type:
    
    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.
    
    It appears that the commit e1af5c815586 ("leds: is31fl319x: Fix devm vs.
    non-devm ordering") missed two things:
    
    - whilst the commit mentions devm_add_action_or_reset() the actual change
      utilised devm_add_action() call by mistake
    - strictly speaking the parameter is not compatible by type
    
    Fix both issues by switching to devm_add_action_or_reset() and adding a
    wrapper for mutex_destroy() call.
    
    Reported-by: kernel test robot <lkp@xxxxxxxxx>
    Fixes: e1af5c815586 ("leds: is31fl319x: Fix devm vs. non-devm ordering")
    Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
    Tested-by: Vincent Knecht <vincent.knecht@xxxxxxxxxx>
    Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221228093238.82713-1-andriy.shevchenko@xxxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/leds/leds-is31fl319x.c b/drivers/leds/leds-is31fl319x.c
index b2f4c4ec7c567..7c908414ac7e0 100644
--- a/drivers/leds/leds-is31fl319x.c
+++ b/drivers/leds/leds-is31fl319x.c
@@ -495,6 +495,11 @@ static inline int is31fl3196_db_to_gain(u32 dezibel)
 	return dezibel / IS31FL3196_AUDIO_GAIN_DB_STEP;
 }
 
+static void is31f1319x_mutex_destroy(void *lock)
+{
+	mutex_destroy(lock);
+}
+
 static int is31fl319x_probe(struct i2c_client *client)
 {
 	struct is31fl319x_chip *is31;
@@ -511,7 +516,7 @@ static int is31fl319x_probe(struct i2c_client *client)
 		return -ENOMEM;
 
 	mutex_init(&is31->lock);
-	err = devm_add_action(dev, (void (*)(void *))mutex_destroy, &is31->lock);
+	err = devm_add_action_or_reset(dev, is31f1319x_mutex_destroy, &is31->lock);
 	if (err)
 		return err;
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux