lkml.org 
[lkml]   [2023]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: AW: [PATCH] amd64: Fix csum_partial_copy_generic()
Date
From: Al Viro
> Sent: 22 October 2023 12:12
>
> On Sun, Oct 22, 2023 at 11:03:39AM +0000, David Laight wrote:
>
> > > + return -1;
> >
> > If you are going to return -1 the return type should be signed.
>
> It's a perfectly valid C to have return -1 in a function that
> returns unsigned long long (or any other unsigned type, really)...

It is also valid C to return a pointer :-)

I also suspect that sparse will complain massively and
require a lot of the horrid (__force) casts.
(They should really be a function so that they are completely
ignored by the compiler - unless the compiler needs a cast as well.)

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

\
 
 \ /
  Last update: 2023-10-23 10:18    [W:0.163 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site