Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752082AbbEJXsh (ORCPT ); Sun, 10 May 2015 19:48:37 -0400 Received: from st11p01mm-asmtp002.mac.com ([17.172.204.237]:62960 "EHLO st11p01mm-asmtp002.mac.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751773AbbEJXse convert rfc822-to-8bit (ORCPT ); Sun, 10 May 2015 19:48:34 -0400 X-Greylist: delayed 3621 seconds by postgrey-1.27 at vger.kernel.org; Sun, 10 May 2015 19:48:34 EDT X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151,1.0.33,0.0.0000 definitions=2015-05-10_03:2015-05-09,2015-05-10,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1505100315 From: Louis Langholtz Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 8BIT Subject: [PATCH] x86: eliminate comparison between signed and unsigned integer expressions Date: Sun, 10 May 2015 16:47:55 -0600 Message-id: Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com To: linux-kernel@vger.kernel.org, x86@kernel.org MIME-version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1478 Lines: 37 Eliminates multiple compiler warnings when the -Wno-sign-compare option is removed from the x86 Makefile (an option that is documented as a "Workaround for a gcc prelease that unfortunately was shipped in a suse release"). Signed-off-by: Louis Langholtz --- arch/x86/include/asm/uaccess.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h index ace9dec..3289bd1 100644 --- a/arch/x86/include/asm/uaccess.h +++ b/arch/x86/include/asm/uaccess.h @@ -709,7 +709,7 @@ copy_from_user(void *to, const void __user *from, unsigned long n) * case, and do only runtime checking for non-constant sizes. */ - if (likely(sz < 0 || sz >= n)) + if (likely(sz < 0 || ((unsigned int)sz) >= n)) n = _copy_from_user(to, from, n); else if(__builtin_constant_p(n)) copy_from_user_overflow(); @@ -727,7 +727,7 @@ copy_to_user(void __user *to, const void *from, unsigned long n) might_fault(); /* See the comment in copy_from_user() above. */ - if (likely(sz < 0 || sz >= n)) + if (likely(sz < 0 || ((unsigned int)sz) >= n)) n = _copy_to_user(to, from, n); else if(__builtin_constant_p(n)) copy_to_user_overflow(); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/