All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Frank Li <Frank.li@nxp.com>
Cc: Ma Ke <make_ruc2021@163.com>,
	shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com,
	dmaengine@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dmaengine: mxs-dma: Add check for dma_set_max_seg_size()
Date: Thu, 25 Apr 2024 14:34:13 +0530	[thread overview]
Message-ID: <ZiocjS6tbeTt2mPD@matsya> (raw)
In-Reply-To: <ZiiFZZ8kwDeRWhjR@lizhi-Precision-Tower-5810>

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

WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vkoul@kernel.org>
To: Frank Li <Frank.li@nxp.com>
Cc: Ma Ke <make_ruc2021@163.com>,
	shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com,
	dmaengine@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dmaengine: mxs-dma: Add check for dma_set_max_seg_size()
Date: Thu, 25 Apr 2024 14:34:13 +0530	[thread overview]
Message-ID: <ZiocjS6tbeTt2mPD@matsya> (raw)
In-Reply-To: <ZiiFZZ8kwDeRWhjR@lizhi-Precision-Tower-5810>

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-04-25  9:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 14:32 [PATCH] dmaengine: mxs-dma: Add check for dma_set_max_seg_size() Ma Ke
2024-04-23 14:32 ` Ma Ke
2024-04-24  4:07 ` Frank Li
2024-04-24  4:07   ` Frank Li
2024-04-25  9:04   ` Vinod Koul [this message]
2024-04-25  9:04     ` Vinod Koul

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=ZiocjS6tbeTt2mPD@matsya \
    --to=vkoul@kernel.org \
    --cc=Frank.li@nxp.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=make_ruc2021@163.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /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.