[PATCH] af_key: suppress a warning for 64k pages.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Stephen Rothwell
Date: Tuesday, October 30, 2007 - 8:59 pm

On PowerPC allmodconfig build we get this:

net/key/af_key.c:400: warning: comparison is always false due to limited range of data type

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 net/key/af_key.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/net/key/af_key.c b/net/key/af_key.c
index 7969f8a..7da6c1a 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -397,8 +397,11 @@ static inline int verify_sec_ctx_len(void *p)
 	struct sadb_x_sec_ctx *sec_ctx = (struct sadb_x_sec_ctx *)p;
 	int len;
 
+	/* sadb_x_ctx_len is uint16_t */
+#if PAGE_SIZE < (1 << 16)
 	if (sec_ctx->sadb_x_ctx_len > PAGE_SIZE)
 		return -EINVAL;
+#endif
 
 	len = pfkey_sec_ctx_len(sec_ctx);
 
-- 
1.5.3.4

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] af_key: suppress a warning for 64k pages., Stephen Rothwell, (Tue Oct 30, 8:59 pm)
Re: [PATCH] af_key: suppress a warning for 64k pages., David Miller, (Tue Oct 30, 9:08 pm)
Re: [PATCH] af_key: suppress a warning for 64k pages., Stephen Rothwell, (Tue Oct 30, 9:34 pm)
Re: [PATCH] af_key: suppress a warning for 64k pages., David Miller, (Tue Oct 30, 9:42 pm)
[PATCH] af_key: suppress a warning for 64k pages., Stephen Rothwell, (Tue Oct 30, 10:24 pm)
Re: [PATCH] af_key: suppress a warning for 64k pages., David Miller, (Tue Oct 30, 11:58 pm)