From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933549Ab1CWU4o (ORCPT ); Wed, 23 Mar 2011 16:56:44 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:40781 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933394Ab1CWU4m (ORCPT ); Wed, 23 Mar 2011 16:56:42 -0400 Date: Wed, 23 Mar 2011 20:56:37 +0000 From: Al Viro To: Geert Uytterhoeven Cc: Andrew Morton , Stuart Swales , Russell King , linux-kernel@vger.kernel.org Subject: Re: [PATCH] adfs: add hexadecimal filetype suffix option Message-ID: <20110323205637.GB22723@ZenIV.linux.org.uk> References: <4D2DEDDB.1070605@gmail.com> <20110119154915.a0bb2878.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 23, 2011 at 09:36:48PM +0100, Geert Uytterhoeven wrote: > On Thu, Jan 20, 2011 at 00:49, Andrew Morton wrote: > > On Wed, 12 Jan 2011 18:07:23 +0000 > > Stuart Swales wrote: > >> From: Stuart Swales > > >> +static inline int append_filetype_suffix(char *buf, __u16 filetype) > >> +{ > >> + ?? ?? if ((__u16) -1 == filetype) > > > > unneeded cast. > > My compiler tends to disagree. On current mainline, it says: > > fs/adfs/adfs.h: In function ???append_filetype_suffix???: > fs/adfs/adfs.h:115: warning: comparison is always false due to limited > range of data type And it's absolutely right - unsigned short it promoted to int as part of usual arithmetic conversions and the value is not changed. And it's *not* going to be equal to -1.