Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1628974

Re: [PATCH 1/2] dmaengine: s3c24xx: Use devm_kcalloc() in s3c24xx_dma_probe()

From Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] dmaengine: s3c24xx: Use devm_kcalloc() in s3c24xx_dma_probe()
Date 2017-04-23 12:10 +0200
Message-ID <tzmCR-794-9@gated-at.bofh.it> (permalink)
References <tzaLn-81z-1@gated-at.bofh.it> <tzaLn-81z-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hello Markus,


SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 22 Apr 2017 23:00:23 +0200
> 
> * A multiplication for the size determination of a memory allocation
>   indicated that an array data structure should be processed.
>   Thus use the corresponding function "devm_kcalloc".
I have trouble parsing that sentences. This looks like the typical
approach of native german speakers to directly transfer sentence
constructions from German to English. Which, in most cases, doesn't work
or is just plain confusing.

With best wishes,
Tobias


> * Replace the specification of a data structure by a pointer dereference
>   to make the corresponding size determination a bit safer according to
>   the Linux coding style convention.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/dma/s3c24xx-dma.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/s3c24xx-dma.c b/drivers/dma/s3c24xx-dma.c
> index f04c4702d98b..967229829683 100644
> --- a/drivers/dma/s3c24xx-dma.c
> +++ b/drivers/dma/s3c24xx-dma.c
> @@ -1216,10 +1216,10 @@ static int s3c24xx_dma_probe(struct platform_device *pdev)
>  	if (IS_ERR(s3cdma->base))
>  		return PTR_ERR(s3cdma->base);
>  
> -	s3cdma->phy_chans = devm_kzalloc(&pdev->dev,
> -					      sizeof(struct s3c24xx_dma_phy) *
> -							pdata->num_phy_channels,
> -					      GFP_KERNEL);
> +	s3cdma->phy_chans = devm_kcalloc(&pdev->dev,
> +					 pdata->num_phy_channels,
> +					 sizeof(*s3cdma->phy_chans),
> +					 GFP_KERNEL);
>  	if (!s3cdma->phy_chans)
>  		return -ENOMEM;
>  
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] dmaengine: s3c24xx: Fine-tuning for s3c24xx_dma_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-22 23:30 +0200
  [PATCH 1/2] dmaengine: s3c24xx: Use devm_kcalloc() in  s3c24xx_dma_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-22 23:30 +0200
    Re: [PATCH 1/2] dmaengine: s3c24xx: Use devm_kcalloc() in  s3c24xx_dma_probe() Tobias Jakobi <tjakobi@math.uni-bielefeld.de> - 2017-04-23 12:10 +0200
      Re: s3c24xx: Use devm_kcalloc() in s3c24xx_dma_probe() Tobias Jakobi <tjakobi@math.uni-bielefeld.de> - 2017-04-23 12:50 +0200
        Re: s3c24xx: Use devm_kcalloc() in s3c24xx_dma_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-23 13:20 +0200
          Re: s3c24xx: Use devm_kcalloc() in s3c24xx_dma_probe() Tobias Jakobi <tjakobi@math.uni-bielefeld.de> - 2017-04-23 14:20 +0200
            Re: s3c24xx: Use devm_kcalloc() in s3c24xx_dma_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-23 14:40 +0200
      Re: s3c24xx: Use devm_kcalloc() in s3c24xx_dma_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-23 12:50 +0200
  [PATCH 2/2] dmaengine: s3c24xx: Fix a typo in a comment line SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-22 23:30 +0200

csiph-web