Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754398AbZLBSgt (ORCPT ); Wed, 2 Dec 2009 13:36:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754188AbZLBSgs (ORCPT ); Wed, 2 Dec 2009 13:36:48 -0500 Received: from zcars04e.nortel.com ([47.129.242.56]:38987 "EHLO zcars04e.nortel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752305AbZLBSgr (ORCPT ); Wed, 2 Dec 2009 13:36:47 -0500 Message-ID: <4B16B32D.9030106@nortel.com> Date: Wed, 02 Dec 2009 12:34:21 -0600 From: "Chris Friesen" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-2.7.b4.fc11 Thunderbird/3.0b4 MIME-Version: 1.0 To: LKML Subject: question on type conversions in show_map_vma() Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 02 Dec 2009 18:36:51.0355 (UTC) FILETIME=[69EACEB0:01CA737E] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 810 Lines: 23 Another developer and I were looking at show_map_vma() and started wondering about the "pgoff" value: pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT; Here we take a variable of type "unsigned long", we cast it to "long long", shift it, then assign the result to a variable of type "unsigned long long". I realize that there isn't any danger of invalid sign extension, but it does seem a bit odd to be casting to a signed value when the result is going to be unsigned. Is there a historical reason why pgoff is unsigned rather than just of type "loff_t"? Chris -- 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/