lkml.org 
[lkml]   [2022]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 1/1] leds: is31fl319x: Wrap mutex_destroy() for devm_add_action_or_rest()
On Wed, Dec 28, 2022 at 11:32:38AM +0200, Andy Shevchenko wrote:
> 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:
> - while mention devm_add_action_or_reset() the actual change got
> devm_add_action() call by unknown reason
> - 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.

This should be read as v2 actually (but code wise the v1 and v2 has no difference).

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2023-03-26 23:22    [W:0.054 / U:0.912 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site