lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 21 Sep 2016 13:38:02 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Peter Ujfalusi <peter.ujfalusi@...com>
Cc:     vinod.koul@...el.com, dan.j.williams@...el.com,
        dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-omap@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        tony@...mide.com
Subject: Re: [PATCH v2 2/9] dmaengine: edma: Use enum for eDMA binding type (legacy vs TPCC)

On Wednesday, September 21, 2016 2:07:22 PM CEST Peter Ujfalusi wrote:
> > 
> > I tend to use 'uintptr_t' for the cast instead.
> 
> What about keeping the defines and:
> 
> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
> index 3e9606b08340..493fdf30e8b8 100644
> --- a/drivers/dma/edma.c
> +++ b/drivers/dma/edma.c
> @@ -263,14 +263,19 @@ static const struct edmacc_param dummy_paramset = {
> 
>  #define EDMA_BINDING_LEGACY    0
>  #define EDMA_BINDING_TPCC      1
> +static const u32 edma_binding_type[] = {
> +       [EDMA_BINDING_LEGACY] = EDMA_BINDING_LEGACY,
> +       [EDMA_BINDING_TPCC] = EDMA_BINDING_TPCC,
> +};
> +
>  static const struct of_device_id edma_of_ids[] = {
>         {
>                 .compatible = "ti,edma3",
> -               .data = (void *)EDMA_BINDING_LEGACY,
> +               .data = (void *)&edma_binding_type[EDMA_BINDING_LEGACY],
>         },
>         {
>                 .compatible = "ti,edma3-tpcc",
> -               .data = (void *)EDMA_BINDING_TPCC,
> +               .data = (void *)&edma_binding_type[EDMA_BINDING_TPCC],
>         },
>         {}

You can drop the cast to (void *) here, otherwise looks good.

	Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ