Re: [PATCH] txx9dmac_probe: Remove redundant null check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06-06-20, 10:34, gaurav singh wrote:
> The check : if (pdata) is redundant since its already being dereferenced
> above :
> ddev->have_64bit_regs = pdata->have_64bit_regs;
> 
> pdata is not initialized after that hence no need for null check.
> 
> Please find the patch below. Let me know if there is any issue.

Please send the patch using git send-email..
> 
> Thanks and regards,
> Gaurav.
> 
> >From 757eafa0f5195f7dd4c06205e6fa78ff6a282919 Mon Sep 17 00:00:00 2001
> From: Gaurav Singh <gaurav1086@xxxxxxxxx>
> Date: Sat, 6 Jun 2020 10:30:56 -0400
> Subject: [PATCH] txx9dmac_probe: Remove redundant null check
> 
> Signed-off-by: Gaurav Singh <gaurav1086@xxxxxxxxx>
> ---
>  drivers/dma/txx9dmac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/txx9dmac.c b/drivers/dma/txx9dmac.c
> index 628bdf4430c7..4c71eba06a69 100644
> --- a/drivers/dma/txx9dmac.c
> +++ b/drivers/dma/txx9dmac.c
> @@ -1209,7 +1209,7 @@ static int __init txx9dmac_probe(struct
> platform_device *pdev)
>   }
> 
>   mcr = TXX9_DMA_MCR_MSTEN | MCR_LE;
> - if (pdata && pdata->memcpy_chan >= 0)
> + if (pdata->memcpy_chan >= 0)

what happened to formatting here, please run ./scripts/checkpatch.pl to check for style issues

>   mcr |= TXX9_DMA_MCR_FIFUM(pdata->memcpy_chan);
>   dma_writel(ddev, MCR, mcr);
> 
> -- 
> 2.17.1

-- 
~Vinod



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux