Thread (9 messages) 9 messages, 4 authors, 2023-06-20

Re: [PATCH] sunrpc: fix clang-17 warning

From: Dan Carpenter <hidden>
Date: 2023-06-01 15:42:54
Subsystem: kernel nfsd, sunrpc, and lockd servers, nfs, sunrpc, and lockd clients, the rest · Maintainers: Chuck Lever, Jeff Layton, Trond Myklebust, Anna Schumaker, Linus Torvalds

I'd kind of like to make some other changes as well like...

I think I looked at this and it wraps to zero which is harmless but I
just hate that it has an integer overflow at all.  Gotta run though.
Will look at this tomorrow.

regards,
dan carpenter
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index f89ec4b5ea16..3550dea95420 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -29,7 +29,7 @@ struct rpc_rqst;
 /*
  * Buffer adjustment
  */
-#define XDR_QUADLEN(l)		(((l) + 3) >> 2)
+#define XDR_QUADLEN(l)		(size_add(l, 3) >> 2)
 
 /*
  * Generic opaque `network object.'
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help