From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261764AbVFPUrK (ORCPT ); Thu, 16 Jun 2005 16:47:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261805AbVFPUrK (ORCPT ); Thu, 16 Jun 2005 16:47:10 -0400 Received: from smtp.osdl.org ([65.172.181.4]:44470 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S261764AbVFPUrH (ORCPT ); Thu, 16 Jun 2005 16:47:07 -0400 Date: Thu, 16 Jun 2005 13:41:26 -0700 From: Andrew Morton To: Jesper Juhl Cc: drummond@valinux.com, davidm@hpl.hp.com, eranian@hpl.hp.com, linux-kernel@vger.kernel.org Subject: Re: [resend][PATCH] avoid signed vs unsigned comparison in efi_range_is_wc() Message-Id: <20050616134126.264d6bd5.akpm@osdl.org> In-Reply-To: References: X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; i386-vine-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 Jesper Juhl wrote: > > I send in the patch below a while back but never recieved any response. > Now I'm resending it in the hope that it might be added to -mm. There are surely many warnings in the tree, hence I'm not really interested in patches which only fix `gcc -W' warnings. How many are there? > It looks to me like a significantly large 'len' passed in could cause the > loop to never end. Isn't it safer to make 'i' an unsigned long as well? Nope. All operations which mix signed and unsigned types promote the signed type to unsigned.