public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: "Andi Shyti" <andi.shyti@kernel.org>,
	"Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] i2c: at91: constify at91_twi_pdata
Date: Mon, 3 Jul 2023 20:23:30 +0200	[thread overview]
Message-ID: <19b2d721-06a3-bc17-eb81-18ee2d8856a3@kernel.org> (raw)
In-Reply-To: <20230629223825.27q75s2a3eyiapgy@intel.intel>

On 30/06/2023 00:38, Andi Shyti wrote:
> Hi Michal,
> 
> [...]
> 
>> -static struct at91_twi_pdata *at91_twi_get_driver_data(
>> +static const struct at91_twi_pdata *at91_twi_get_driver_data(
>>  					struct platform_device *pdev)
>>  {
>>  	if (pdev->dev.of_node) {
>> @@ -189,9 +189,9 @@ static struct at91_twi_pdata *at91_twi_get_driver_data(
>>  		match = of_match_node(atmel_twi_dt_ids, pdev->dev.of_node);
>>  		if (!match)
>>  			return NULL;
>> -		return (struct at91_twi_pdata *)match->data;
>> +		return match->data;
>>  	}
>> -	return (struct at91_twi_pdata *) platform_get_device_id(pdev)->driver_data;
>> +	return (const void *) platform_get_device_id(pdev)->driver_data;
> 
> the const's always confuse me... do you get an error here? Is
> this cast really needed?

I think this change is not necessary and actually should not matter. See
for example drivers/tty/serial/samsung_tty.c after my refactorings in
commit 3aec40096550 ("tty: serial: samsung: reduce number of casts").

Best regards,
Krzysztof


  parent reply	other threads:[~2023-07-03 18:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26 21:26 [PATCH 1/1] i2c: at91: constify at91_twi_pdata Michał Mirosław
2023-06-29 22:38 ` Andi Shyti
2023-07-02 10:40   ` Michał Mirosław
2023-07-03 18:23   ` Krzysztof Kozlowski [this message]
2023-07-03 20:46     ` Michał Mirosław

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=19b2d721-06a3-bc17-eb81-18ee2d8856a3@kernel.org \
    --to=krzk@kernel.org \
    --cc=andi.shyti@kernel.org \
    --cc=codrin.ciubotariu@microchip.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mirq-linux@rere.qmqm.pl \
    /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