From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751165AbXJaEAG (ORCPT ); Wed, 31 Oct 2007 00:00:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752961AbXJaD7x (ORCPT ); Tue, 30 Oct 2007 23:59:53 -0400 Received: from chilli.pcug.org.au ([203.10.76.44]:57621 "EHLO smtps.tip.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752960AbXJaD7x (ORCPT ); Tue, 30 Oct 2007 23:59:53 -0400 Date: Wed, 31 Oct 2007 14:59:54 +1100 From: Stephen Rothwell To: netdev@vger.kernel.org Cc: LKML Subject: [PATCH] af_key: suppress a warning for 64k pages. Message-Id: <20071031145954.fe106f73.sfr@canb.auug.org.au> X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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