Re: [PATCH] dmaengine: mxs-dma: Add check for dma_set_max_seg_size()

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

 



On 24-04-24, 00:07, Frank Li wrote:
> On Tue, Apr 23, 2024 at 10:32:05PM +0800, Ma Ke wrote:

> > -	dma_set_max_seg_size(mxs_dma->dma_device.dev, MAX_XFER_BYTES);
> > +	ret = dma_set_max_seg_size(mxs_dma->dma_device.dev, MAX_XFER_BYTES);
> > +	if (ret)
> > +		return ret;
> 
> How error happen? 
> 
> static inline int dma_set_max_seg_size(struct device *dev, unsigned int size)
> {
> 	if (dev->dma_parms) {
> 		dev->dma_parms->max_segment_size = size;
> 		return 0;
> 	}
> 	return -EIO;
> }
> 
> Only possible dev->dma_parms is null. but mxs-dma is platform device, it
> point to platform's dma_parms field. Look like impossible it is null.

Yep, checking for the sake of checking is bad. It needs to be logical

-- 
~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