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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.'



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux