[lustre-devel] [PATCH 06/18] lnet: annotate LNET_WIRE_HANDLE_COOKIE_NONE as u64

James Simmons jsimmons at infradead.org
Mon Jul 19 05:32:01 PDT 2021


From: Dominique Martinet <asmadeus at codewreck.org>

Fix the following warning on new gcc with -Wextra when including
lustre_idl.h on external project:

.../include/linux/lnet/lnet-types.h: In function LNetMDHandleIsInvalid:
.../include/linux/lnet/lnet-types.h:355:46:
   error: comparison of integer expressions of different signedness:
   int and __u64 {aka long long unsigned int} [-Werror=sign-compare]
        return (LNET_WIRE_HANDLE_COOKIE_NONE == h.cookie);
                                                 ^~

WC-bug-id: https://jira.whamcloud.com/browse/LU-14093
Lustre-commit: 27214876fcdfbda0 ("LU-14093 lnet: annotate LNET_WIRE_HANDLE_COOKIE_NONE as u64")
Signed-off-by: Dominique Martinet <asmadeus at codewreck.org>
Reviewed-on: https://review.whamcloud.com/43713
Reviewed-by: Neil Brown <neilb at suse.de>
Reviewed-by: James Simmons <jsimmons at infradead.org>
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 include/uapi/linux/lnet/lnet-types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/lnet/lnet-types.h b/include/uapi/linux/lnet/lnet-types.h
index 43800ae..0c426ac 100644
--- a/include/uapi/linux/lnet/lnet-types.h
+++ b/include/uapi/linux/lnet/lnet-types.h
@@ -134,7 +134,7 @@ struct lnet_counters {
  * 'me' for match entry). Each type of object is given a unique handle type
  * to enhance type checking.
  */
-#define LNET_WIRE_HANDLE_COOKIE_NONE   (-1)
+#define LNET_WIRE_HANDLE_COOKIE_NONE   (~0ULL)
 
 struct lnet_handle_md {
 	__u64	cookie;
-- 
1.8.3.1



More information about the lustre-devel mailing list