linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] spi: spi-fsl-qspi: Fix return value check in fsl_qspi_probe()
@ 2020-04-21  9:39 Wei Yongjun
  2020-04-21 10:48 ` Ashish Kumar
  2020-04-22  1:45 ` [PATCH -next v2] spi: spi-fsl-qspi: Fix return value check of devm_ioremap() in probe Wei Yongjun
  0 siblings, 2 replies; 5+ messages in thread
From: Wei Yongjun @ 2020-04-21  9:39 UTC (permalink / raw)
  To: Han Xu, Mark Brown, Ashish Kumar; +Cc: Wei Yongjun, linux-spi, kernel-janitors

In case of error, the function devm_ioremap() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Fixes: 858e26a515c2 ("spi: spi-fsl-qspi: Reduce devm_ioremap size to 4 times AHB buffer size")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/spi/spi-fsl-qspi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c
index 83eb8a484faf..6766262d7e75 100644
--- a/drivers/spi/spi-fsl-qspi.c
+++ b/drivers/spi/spi-fsl-qspi.c
@@ -880,8 +880,8 @@ static int fsl_qspi_probe(struct platform_device *pdev)
 	/* Since there are 4 cs, map size required is 4 times ahb_buf_size */
 	q->ahb_addr = devm_ioremap(dev, q->memmap_phy,
 				   (q->devtype_data->ahb_buf_size * 4));
-	if (IS_ERR(q->ahb_addr)) {
-		ret = PTR_ERR(q->ahb_addr);
+	if (!q->ahb_addr) {
+		ret = -ENOMEM;
 		goto err_put_ctrl;
 	}




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH -next] spi: spi-fsl-qspi: Fix return value check in fsl_qspi_probe()
  2020-04-21  9:39 [PATCH -next] spi: spi-fsl-qspi: Fix return value check in fsl_qspi_probe() Wei Yongjun
@ 2020-04-21 10:48 ` Ashish Kumar
  2020-04-22  1:45 ` [PATCH -next v2] spi: spi-fsl-qspi: Fix return value check of devm_ioremap() in probe Wei Yongjun
  1 sibling, 0 replies; 5+ messages in thread
From: Ashish Kumar @ 2020-04-21 10:48 UTC (permalink / raw)
  To: Wei Yongjun, Han Xu, Mark Brown; +Cc: linux-spi, kernel-janitors

Hi Wei Yongjun,

> -----Original Message-----
> From: Wei Yongjun <weiyongjun1@huawei.com>
> Sent: Tuesday, April 21, 2020 3:09 PM
> To: Han Xu <han.xu@nxp.com>; Mark Brown <broonie@kernel.org>; Ashish
> Kumar <ashish.kumar@nxp.com>
> Cc: Wei Yongjun <weiyongjun1@huawei.com>; linux-spi@vger.kernel.org;
> kernel-janitors@vger.kernel.org
> Subject: [PATCH -next] spi: spi-fsl-qspi: Fix return value check in
> fsl_qspi_probe()

It sound like all return value in probe() is fixed.
Please reword this commit message like this:
spi: spi-fsl-qspi: Fix return value check of devm_ioremap() in probe()

> 
> In case of error, the function devm_ioremap() returns NULL pointer not
> ERR_PTR(). The IS_ERR() test in the return value check should be replaced
> with NULL test.
> 
> Fixes: 858e26a515c2 ("spi: spi-fsl-qspi: Reduce devm_ioremap size to 4 times
> AHB buffer size")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/spi/spi-fsl-qspi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c index
> 83eb8a484faf..6766262d7e75 100644
> --- a/drivers/spi/spi-fsl-qspi.c
> +++ b/drivers/spi/spi-fsl-qspi.c
> @@ -880,8 +880,8 @@ static int fsl_qspi_probe(struct platform_device
> *pdev)
>  	/* Since there are 4 cs, map size required is 4 times ahb_buf_size */
>  	q->ahb_addr = devm_ioremap(dev, q->memmap_phy,
>  				   (q->devtype_data->ahb_buf_size * 4));
> -	if (IS_ERR(q->ahb_addr)) {
> -		ret = PTR_ERR(q->ahb_addr);
> +	if (!q->ahb_addr) {
> +		ret = -ENOMEM;
 Reviewed-by: Ashish Kumar <Ashish.Kumar@nxp.com>

Thanks & Regards
Ashish 
>  		goto err_put_ctrl;
>  	}
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH -next v2] spi: spi-fsl-qspi: Fix return value check of devm_ioremap() in probe
  2020-04-21  9:39 [PATCH -next] spi: spi-fsl-qspi: Fix return value check in fsl_qspi_probe() Wei Yongjun
  2020-04-21 10:48 ` Ashish Kumar
@ 2020-04-22  1:45 ` Wei Yongjun
  2020-04-22  5:42   ` Han Xu
  2020-04-22 13:08   ` Mark Brown
  1 sibling, 2 replies; 5+ messages in thread
From: Wei Yongjun @ 2020-04-22  1:45 UTC (permalink / raw)
  To: Han Xu, Mark Brown, Ashish Kumar; +Cc: Wei Yongjun, linux-spi, kernel-janitors

In case of error, the function devm_ioremap() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Fixes: 858e26a515c2 ("spi: spi-fsl-qspi: Reduce devm_ioremap size to 4 times AHB buffer size")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Ashish Kumar <Ashish.Kumar@nxp.com>
---
v1 -> v2: fix the subject as Ashish's suggest
---
 drivers/spi/spi-fsl-qspi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c
index 83eb8a484faf..6766262d7e75 100644
--- a/drivers/spi/spi-fsl-qspi.c
+++ b/drivers/spi/spi-fsl-qspi.c
@@ -880,8 +880,8 @@ static int fsl_qspi_probe(struct platform_device *pdev)
 	/* Since there are 4 cs, map size required is 4 times ahb_buf_size */
 	q->ahb_addr = devm_ioremap(dev, q->memmap_phy,
 				   (q->devtype_data->ahb_buf_size * 4));
-	if (IS_ERR(q->ahb_addr)) {
-		ret = PTR_ERR(q->ahb_addr);
+	if (!q->ahb_addr) {
+		ret = -ENOMEM;
 		goto err_put_ctrl;
 	}




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH -next v2] spi: spi-fsl-qspi: Fix return value check of devm_ioremap() in probe
  2020-04-22  1:45 ` [PATCH -next v2] spi: spi-fsl-qspi: Fix return value check of devm_ioremap() in probe Wei Yongjun
@ 2020-04-22  5:42   ` Han Xu
  2020-04-22 13:08   ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Han Xu @ 2020-04-22  5:42 UTC (permalink / raw)
  To: Wei Yongjun, Mark Brown, Ashish Kumar; +Cc: linux-spi, kernel-janitors



> -----Original Message-----
> From: Wei Yongjun <weiyongjun1@huawei.com>
> Sent: Tuesday, April 21, 2020 8:46 PM
> To: Han Xu <han.xu@nxp.com>; Mark Brown <broonie@kernel.org>; Ashish
> Kumar <ashish.kumar@nxp.com>
> Cc: Wei Yongjun <weiyongjun1@huawei.com>; linux-spi@vger.kernel.org; kernel-
> janitors@vger.kernel.org
> Subject: [PATCH -next v2] spi: spi-fsl-qspi: Fix return value check of
> devm_ioremap() in probe
> 
> In case of error, the function devm_ioremap() returns NULL pointer not
> ERR_PTR(). The IS_ERR() test in the return value check should be replaced with
> NULL test.
> 
> Fixes: 858e26a515c2 ("spi: spi-fsl-qspi: Reduce devm_ioremap size to 4 times AHB
> buffer size")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> Reviewed-by: Ashish Kumar <Ashish.Kumar@nxp.com>

Acked-by: Han Xu <han.xu@nxp.com>

> ---
> v1 -> v2: fix the subject as Ashish's suggest
> ---
>  drivers/spi/spi-fsl-qspi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c index
> 83eb8a484faf..6766262d7e75 100644
> --- a/drivers/spi/spi-fsl-qspi.c
> +++ b/drivers/spi/spi-fsl-qspi.c
> @@ -880,8 +880,8 @@ static int fsl_qspi_probe(struct platform_device *pdev)
>  	/* Since there are 4 cs, map size required is 4 times ahb_buf_size */
>  	q->ahb_addr = devm_ioremap(dev, q->memmap_phy,
>  				   (q->devtype_data->ahb_buf_size * 4));
> -	if (IS_ERR(q->ahb_addr)) {
> -		ret = PTR_ERR(q->ahb_addr);
> +	if (!q->ahb_addr) {
> +		ret = -ENOMEM;
>  		goto err_put_ctrl;
>  	}
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next v2] spi: spi-fsl-qspi: Fix return value check of devm_ioremap() in probe
  2020-04-22  1:45 ` [PATCH -next v2] spi: spi-fsl-qspi: Fix return value check of devm_ioremap() in probe Wei Yongjun
  2020-04-22  5:42   ` Han Xu
@ 2020-04-22 13:08   ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2020-04-22 13:08 UTC (permalink / raw)
  To: Wei Yongjun, Ashish Kumar, Han Xu; +Cc: kernel-janitors, linux-spi

On Wed, 22 Apr 2020 01:45:43 +0000, Wei Yongjun wrote:
> In case of error, the function devm_ioremap() returns NULL pointer not
> ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test.
> 
> Fixes: 858e26a515c2 ("spi: spi-fsl-qspi: Reduce devm_ioremap size to 4 times AHB buffer size")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> Reviewed-by: Ashish Kumar <Ashish.Kumar@nxp.com>
> Acked-by: Han Xu <han.xu@nxp.com>
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-5.8

Thanks!

[1/1] spi: spi-fsl-qspi: Fix return value check of devm_ioremap() in probe
      commit: f58dcab68aa57e74c12c9bec7ff1bb73e0b35143

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-22 13:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21  9:39 [PATCH -next] spi: spi-fsl-qspi: Fix return value check in fsl_qspi_probe() Wei Yongjun
2020-04-21 10:48 ` Ashish Kumar
2020-04-22  1:45 ` [PATCH -next v2] spi: spi-fsl-qspi: Fix return value check of devm_ioremap() in probe Wei Yongjun
2020-04-22  5:42   ` Han Xu
2020-04-22 13:08   ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).