All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thor Thayer <tthayer@opensource.altera.com>
To: Arnd Bergmann <arnd@arndb.de>,
	Doug Thompson <dougthompson@xmission.com>,
	Borislav Petkov <bp@alien8.de>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Alan Tull <atull@opensource.altera.com>,
	Dinh Nguyen <dinguyen@opensource.altera.com>,
	<linux-edac@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] EDAC, altera: remove useless casts
Date: Mon, 18 Apr 2016 09:19:39 -0500	[thread overview]
Message-ID: <5714ECFB.7090806@opensource.altera.com> (raw)
In-Reply-To: <1460837650-1237650-1-git-send-email-arnd@arndb.de>



On 04/16/2016 03:13 PM, Arnd Bergmann wrote:
> The altera EDAC driver refers to its per-device data
> using a cast to '(void *)', which makes the pointer
> non-const, though both the source and destination are
> actually const.
>
> Removing the annotation makes the reference (almost)
> fit into a single line for improved readability, and
> ensures that it is actually defined as const.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>   drivers/edac/altera_edac.c | 15 ++++++---------
>   1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
> index 11775dc0b139..cc987b4ce908 100644
> --- a/drivers/edac/altera_edac.c
> +++ b/drivers/edac/altera_edac.c
> @@ -232,8 +232,8 @@ static unsigned long get_total_mem(void)
>   }
>
>   static const struct of_device_id altr_sdram_ctrl_of_match[] = {
> -	{ .compatible = "altr,sdram-edac", .data = (void *)&c5_data},
> -	{ .compatible = "altr,sdram-edac-a10", .data = (void *)&a10_data},
> +	{ .compatible = "altr,sdram-edac", .data = &c5_data},
> +	{ .compatible = "altr,sdram-edac-a10", .data = &a10_data},
>   	{},
>   };
>   MODULE_DEVICE_TABLE(of, altr_sdram_ctrl_of_match);
> @@ -705,15 +705,12 @@ static void altr_create_edacdev_dbgfs(struct edac_device_ctl_info *edac_dci,
>
>   static const struct of_device_id altr_edac_device_of_match[] = {
>   #ifdef CONFIG_EDAC_ALTERA_L2C
> -	{ .compatible = "altr,socfpga-l2-ecc", .data = (void *)&l2ecc_data },
> -	{ .compatible = "altr,socfpga-a10-l2-ecc",
> -	  .data = (void *)&a10_l2ecc_data },
> +	{ .compatible = "altr,socfpga-l2-ecc", .data = &l2ecc_data },
> +	{ .compatible = "altr,socfpga-a10-l2-ecc", .data = &a10_l2ecc_data },
>   #endif
>   #ifdef CONFIG_EDAC_ALTERA_OCRAM
> -	{ .compatible = "altr,socfpga-ocram-ecc",
> -	  .data = (void *)&ocramecc_data },
> -	{ .compatible = "altr,socfpga-a10-ocram-ecc",
> -	  .data = (void *)&a10_ocramecc_data },
> +	{ .compatible = "altr,socfpga-ocram-ecc", .data = &ocramecc_data },
> +	{ .compatible = "altr,socfpga-a10-ocram-ecc", .data = &a10_ocramecc_data },
>   #endif
>   	{},
>   };
>

Acked-by: Thor Thayer <tthayer@opensource.altera.com>

  parent reply	other threads:[~2016-04-18 14:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-16 20:13 [PATCH 1/2] EDAC, altera: remove useless casts Arnd Bergmann
2016-04-16 20:13 ` [PATCH 2/2] EDAC, altera: avoid unused function warnings Arnd Bergmann
2016-04-18 14:23   ` Thor Thayer
2016-04-18 14:19 ` Thor Thayer [this message]
2016-04-23 10:01 ` [PATCH 1/2] EDAC, altera: remove useless casts Borislav Petkov

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=5714ECFB.7090806@opensource.altera.com \
    --to=tthayer@opensource.altera.com \
    --cc=arnd@arndb.de \
    --cc=atull@opensource.altera.com \
    --cc=bp@alien8.de \
    --cc=dinguyen@opensource.altera.com \
    --cc=dougthompson@xmission.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.