PL08x further cleanups
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest0 of 9 patches 0 repliesNew
Patches in v1 No applies recorded yet
None of the 9 patches the cover letter announces are in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/9] PL08x further cleanups
Quoted 13 lines · Vinod Koul
Quoted 12 lines · Russell King - ARM Linux
No. This function is used as:
(quoted diff) +2
-0+ width = pl08x_width(addr_width); + if (width == ~0) { dev_err(&pl08x->adev->dev, "bad runtime_config: alien address width\n"); return -EINVAL; }Notice that it returns a u32 so negative errnos don't make sense. It returns ~0 to indicate error.
Quoted 6 lines
Quoted 4 lines
The code is actually correct as it stands, it's just gcc deciding to emit a warning for an unhandled enum value which isn't really unhandled. Just move the 'return ~0;' at the end of the function inside the switch as a default case to shut it up.
Okay but shouldn't this ideally check for width < 0, that way we can return proper errors?
No. Two reasons:
1. u32 < 0 does not exist.
2. It's returning a sub bitmask value for the register, so signed numbers conceptually don't make sense.