mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <sha@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH master 1/3] param: drop priv from dev_add_param_string_ro
Date: Tue, 22 Aug 2023 18:36:07 +0200	[thread overview]
Message-ID: <b8c922b6-a596-447a-6f2e-b169c4534123@pengutronix.de> (raw)
In-Reply-To: <20230822142807.GA16522@pengutronix.de>

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@pengutronix.de>
>> ---
>>  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.

> 
> 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 |




  reply	other threads:[~2023-08-22 16:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22  7:47 Ahmad Fatoum
2023-08-22  7:47 ` [PATCH master 2/3] restart: fix restart_handler_get_by_name documentation Ahmad Fatoum
2023-08-22  7:47 ` [PATCH master 3/3] boards: qemu-virt: apply state/env overlay only if flash exists Ahmad Fatoum
2023-08-22 14:28 ` [PATCH master 1/3] param: drop priv from dev_add_param_string_ro Sascha Hauer
2023-08-22 16:36   ` Ahmad Fatoum [this message]
2023-08-23  5:50     ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b8c922b6-a596-447a-6f2e-b169c4534123@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=sha@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox