Re: [PATCH master 1/3] param: drop priv from dev_add_param_string_ro

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

 



On Tue, Aug 22, 2023 at 06:36:07PM +0200, Ahmad Fatoum wrote:
> On 22.08.23 16:28, Sascha Hauer wrote:
> > On Tue, Aug 22, 2023 at 09:47:36AM +0200, Ahmad Fatoum wrote:
> >> dev_add_param_string_ro() is used nowhere, but when we do, having an
> >> unused priv parameter serves no purpose, so drop it.
> >>
> >> Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
> >> ---
> >>  include/param.h | 3 +--
> >>  1 file changed, 1 insertion(+), 2 deletions(-)
> >>
> >> diff --git a/include/param.h b/include/param.h
> >> index 76a077fd758a..5d4f7f3db52f 100644
> >> --- a/include/param.h
> >> +++ b/include/param.h
> >> @@ -334,8 +334,7 @@ static inline struct param_d *dev_add_param_bool_ro(struct device *dev,
> >>  
> >>  static inline struct param_d *dev_add_param_string_ro(struct device *dev,
> >>  						      const char *name,
> >> -						      char **value,
> >> -						      void *priv)
> >> +						      char **value)
> >>  {
> >>  	return dev_add_param_string(dev, name, param_set_readonly, NULL, value, NULL);
> >>  }
> > 
> > Wouldn't it be better to pass *priv on to dev_add_param_string() instead
> > of removing it?
> 
> No, because it would be unused: The non-overridable setters and getters
> won't access it.

Ah, right. Applied then

Thanks
  Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux