public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] fixes warning
@ 2023-08-04 20:07 coolrrsh
  2023-08-04 20:07 ` coolrrsh
  2023-08-05 15:01 ` Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: coolrrsh @ 2023-08-04 20:07 UTC (permalink / raw)
  To: broonie, linux-spi, linux-kernel; +Cc: linux-kernel-mentees, Rajeshwar R Shinde

From: Rajeshwar R Shinde <coolrrsh@gmail.com>

Typecasting the interrupt number from "unsigned int" to "signed int" to compare with 0(signed int by default).
Declaring interrupt number as "signed int" would violate kernel standards. So typecasting is the possible approach.
The fix is for spi-mpc512x. 

This fixes warning such as:
drivers/spi/spi-mpc512x-psc.c:493:5-13: WARNING: Unsigned expression compared with zero: mps -> irq < 0

Signed-off-by: Rajeshwar R Shinde <coolrrsh@gmail.com>
---
 drivers/spi/spi-mpc512x-psc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c
index 99aeef2..50a4f31 100644
--- a/drivers/spi/spi-mpc512x-psc.c
+++ b/drivers/spi/spi-mpc512x-psc.c
@@ -490,7 +490,7 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *pdev)
 		(struct mpc512x_psc_fifo *)(tempp + sizeof(struct mpc52xx_psc));
 
 	mps->irq = platform_get_irq(pdev, 0);
-	if (mps->irq < 0)
+	if ((int)mps->irq < 0)
 		return mps->irq;
 
 	ret = devm_request_irq(dev, mps->irq, mpc512x_psc_spi_isr, IRQF_SHARED,
-- 
2.25.1


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

* [PATCH v2] fixes warning
  2023-08-04 20:07 [PATCH v2] fixes warning coolrrsh
@ 2023-08-04 20:07 ` coolrrsh
  2023-08-05  6:22   ` Greg KH
  2023-08-05 15:01 ` Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: coolrrsh @ 2023-08-04 20:07 UTC (permalink / raw)
  To: broonie, linux-spi, linux-kernel; +Cc: linux-kernel-mentees, Rajeshwar R Shinde

From: Rajeshwar R Shinde <coolrrsh@gmail.com>

Typecasting the interrupt number from "unsigned int" to "signed int" to compare with 0(signed int by default).
Declaring interrupt number as "signed int" would violate kernel standards. So typecasting is the possible approach.
The fix is for spi-mpc52xx.

This fixes warning such as:
drivers/spi/spi-mpc52xx-psc.c:332:5-13: WARNING: Unsigned expression compared with zero: mps -> irq < 0

Signed-off-by: Rajeshwar R Shinde <coolrrsh@gmail.com>
---
 drivers/spi/spi-mpc52xx-psc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-mpc52xx-psc.c b/drivers/spi/spi-mpc52xx-psc.c
index 9a1a080..7452bc9 100644
--- a/drivers/spi/spi-mpc52xx-psc.c
+++ b/drivers/spi/spi-mpc52xx-psc.c
@@ -329,7 +329,7 @@ static int mpc52xx_psc_spi_of_probe(struct platform_device *pdev)
 	mps->fifo = ((void __iomem *)mps->psc) + sizeof(struct mpc52xx_psc);
 
 	mps->irq = platform_get_irq(pdev, 0);
-	if (mps->irq < 0)
+	if ((int)mps->irq < 0)
 		return mps->irq;
 
 	ret = devm_request_irq(dev, mps->irq, mpc52xx_psc_spi_isr, 0,
-- 
2.25.1


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

* Re: [PATCH v2] fixes warning
  2023-08-04 20:07 ` coolrrsh
@ 2023-08-05  6:22   ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2023-08-05  6:22 UTC (permalink / raw)
  To: coolrrsh; +Cc: broonie, linux-spi, linux-kernel, linux-kernel-mentees

On Sat, Aug 05, 2023 at 01:37:11AM +0530, coolrrsh@gmail.com wrote:
> From: Rajeshwar R Shinde <coolrrsh@gmail.com>
> 
> Typecasting the interrupt number from "unsigned int" to "signed int" to compare with 0(signed int by default).
> Declaring interrupt number as "signed int" would violate kernel standards. So typecasting is the possible approach.
> The fix is for spi-mpc52xx.
> 
> This fixes warning such as:
> drivers/spi/spi-mpc52xx-psc.c:332:5-13: WARNING: Unsigned expression compared with zero: mps -> irq < 0
> 
> Signed-off-by: Rajeshwar R Shinde <coolrrsh@gmail.com>
> ---
>  drivers/spi/spi-mpc52xx-psc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Your subject lines are still incorrect :(

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

* Re: [PATCH v2] fixes warning
  2023-08-04 20:07 [PATCH v2] fixes warning coolrrsh
  2023-08-04 20:07 ` coolrrsh
@ 2023-08-05 15:01 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2023-08-05 15:01 UTC (permalink / raw)
  To: coolrrsh; +Cc: linux-spi, linux-kernel, linux-kernel-mentees

[-- Attachment #1: Type: text/plain, Size: 846 bytes --]

On Sat, Aug 05, 2023 at 01:37:10AM +0530, coolrrsh@gmail.com wrote:

> Typecasting the interrupt number from "unsigned int" to "signed int" to compare with 0(signed int by default).
> Declaring interrupt number as "signed int" would violate kernel standards. So typecasting is the possible approach.

Why would it violate kernel standards?

Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.

Please fix your mail client to word wrap within paragraphs at something
substantially less than 80 columns.  Doing this makes your messages much
easier to read and reply to.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2023-08-05 15:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-04 20:07 [PATCH v2] fixes warning coolrrsh
2023-08-04 20:07 ` coolrrsh
2023-08-05  6:22   ` Greg KH
2023-08-05 15:01 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox