lkml.org 
[lkml]   [2023]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] fixes warning
On Fri, Aug 04, 2023 at 05:21:20PM +0530, coolrrsh@gmail.com wrote:
> From: Rajeshwar R Shinde <coolrrsh@gmail.com>
>
> drivers/spi/spi-mpc512x-psc.c:493:5-13:
> WARNING: Unsigned expression compared with zero: mps -> irq < 0

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.

> mps->irq = platform_get_irq(pdev, 0);
> - if (mps->irq < 0)
> + if ((int)mps->irq < 0)
> return mps->irq;

Casts are almost always the wrong choice. If the issue is that the
value is unsigned and can't be negative casting it to signed isn't going
to help, though here possibly the type of the variable is wrong.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2023-08-04 13:57    [W:0.056 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site