Return-Path: Received: from merit-proxy02.merit.edu ([207.75.116.194]:52170 "EHLO merit-proxy02.merit.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751253Ab1GCN0O (ORCPT ); Sun, 3 Jul 2011 09:26:14 -0400 Date: Sun, 3 Jul 2011 09:26:05 -0400 From: Jim Rees To: Luk Claes Cc: NeilBrown , Steve Dickson , linux-nfs@vger.kernel.org Subject: Re: [PATCH] Do not segfault because of kernel version Message-ID: <20110703132605.GC9889@merit.edu> References: <1309617149-3993-1-git-send-email-luk@debian.org> <20110703150421.2db09d94@notabene.brown> <4E100E17.5000304@debian.org> <20110703130237.GA9889@merit.edu> <4E106A56.1050802@debian.org> Content-Type: text/plain; charset=us-ascii In-Reply-To: <4E106A56.1050802@debian.org> Sender: linux-nfs-owner@vger.kernel.org List-ID: MIME-Version: 1.0 Luk Claes wrote: > You can't return -1 from a function returning unsigned int. I think you > want to return something like > > MAKE_VERSION(9999, 255, 255) Would it not be better to return UINT_MAX in that case to avoid having to change it when version 10000 would be released and to avoid overflows that could potentially order lower? Maybe. I wanted the second and third numbers to be the max possible (255). But of course they will be anyway if you return UINT_MAX and are running on an architecture that represents ints in two's complement binary. Which is the case today, but wasn't there a port of unix to the System 36 at one time? Ok, that's just silly. Yes, just return UINT_MAX. Fix the other error return too, the one where uname fails. And put in a comment if you can briefly summarize Linus's argument.