Received: by 10.213.65.68 with SMTP id h4csp1818127imn; Sun, 1 Apr 2018 16:07:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+ZYFpWQKuPS18P3MX9S80Olgq1DVGqdOSGgHs0ZqmnoI44gbtYX5ZUzN2LxFQhJB7i8YdP X-Received: by 2002:a17:902:42a3:: with SMTP id h32-v6mr7439896pld.231.1522624032988; Sun, 01 Apr 2018 16:07:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522624032; cv=none; d=google.com; s=arc-20160816; b=faqhZcrvhIneD2QTkk1a6yiBPGPuN4wyt+PUSdM8Oy4HMZmis3jBIhckZhGfdTKVMz mx/pS06qflsgaFNt889AQQjUBZe7QQsh7/kZsxdCLXPCJAA0mccDCOnwdHgyJwFTFEqg v/lgcPcq6FyCf5QBnkBj4h6yuZOShblS053ojZl0enEzGKLEK49O+2UjTSbH+2XZ8uIM g1OBtrr7bCPu5ZPtaIqYCm75VfOJkvOsNZf9JYJ/GQQyHZH6sEUFfEt5EcgnMUzEJnZu Gv7BCCug+YHkqxI2UKSLkmWY6jp7WF0jlM6pDf+26RJGegzr59N0yXoctbiIJGTmy6bx dylA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature :arc-authentication-results; bh=OIsf6JfagwbJOsHaJzH8bUfSWRDvUopb6AU8mNxvZOI=; b=bw1E1tjRzQyaIzp36mwjRVi6owYeZkcMvAFLGtDe7Y8eDhf1SnTXyNNJN8xp5IWtVk oRu5Q/n6CCmMXVodsj8KCSgTuv/+bgyt44nfy4IbInVAcKEnJdmsiLJxy46AdUnEUbeg 67UPE4sav5nWtuh3YalSgBTD7p9ye8BlUSvuYH2/5ptHwpweXa51HdRClwHNmM536zNR TXL6pItfzxyAq5pCuhCWEfjzP1CB8HvqCmclo02Zb7OdPNkyNIa011kVSB3INBpMlZP+ EG3VoAN1TDx4eprAIv76EaKAusmbOrJp3Rg7Am9mFZe3Ze+uI1AVs/NQ/CtonQ4U7CZ1 fPUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Aa+20Obl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u127si4886922pgb.775.2018.04.01.16.06.45; Sun, 01 Apr 2018 16:07:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Aa+20Obl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753974AbeDAXFA (ORCPT + 99 others); Sun, 1 Apr 2018 19:05:00 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:44946 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752325AbeDAXE7 (ORCPT ); Sun, 1 Apr 2018 19:04:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To: Subject:Sender:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=OIsf6JfagwbJOsHaJzH8bUfSWRDvUopb6AU8mNxvZOI=; b=Aa+20OblK15QgibLrtYJuxf5N fFtkr62e1jf61APz/CuCbNW62MLZ2juGZuKDIX4s7T74lOQHGkMwo7Rh7o12v0ez6sBJGr/50Xzsi X++oDC89h5w/R3qz7lUgcPjaJ+r2g9LuSZslvOS+r2gYYeAIAN1nK9piQWMp9FYML9CXDI3FRO+w5 G9PXj2+alnyl+3bLA0uvn7ewsylWhE4LMR4ZXyVbRt7rCZhi8kkx9LXAnx/3sqX/9/PJoD+IjMXYc vhb6y6v4vmcz/j1VEPz7b1MPYdY/QyYVueSg45ShJac7uXjVYHa956Zhh3HWOEanrUtYOwVT41S39 ZISwO24bA==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1f2m1z-0007dy-DE; Sun, 01 Apr 2018 23:04:59 +0000 Subject: Re: [PATCH 01/45] Use UINT_MAX, not -1, to represent an invalid UID, GID or project ID To: David Howells , linux-kernel@vger.kernel.org References: <152261521484.30503.16131389653845029164.stgit@warthog.procyon.org.uk> <152261522136.30503.14306229915768504613.stgit@warthog.procyon.org.uk> From: Randy Dunlap Message-ID: <84a48fa6-cd05-f666-e64c-5f913f942b0a@infradead.org> Date: Sun, 1 Apr 2018 16:04:58 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <152261522136.30503.14306229915768504613.stgit@warthog.procyon.org.uk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/01/2018 01:40 PM, David Howells wrote: > Use UINT_MAX, not -1, to represent an invalid UID, GID or project ID as the > parameter is an unsigned integer. > > Signed-off-by: David Howells > --- > > include/linux/projid.h | 2 +- > include/linux/uidgid.h | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/include/linux/projid.h b/include/linux/projid.h > index 613730622a1a..7c60a79424c9 100644 > --- a/include/linux/projid.h > +++ b/include/linux/projid.h > @@ -30,7 +30,7 @@ static inline projid_t __kprojid_val(kprojid_t projid) +#include > #define KPROJIDT_INIT(value) (kprojid_t){ value } > > -#define INVALID_PROJID KPROJIDT_INIT(-1) > +#define INVALID_PROJID KPROJIDT_INIT(UINT_MAX) > #define OVERFLOW_PROJID 65534 > > static inline bool projid_eq(kprojid_t left, kprojid_t right) > diff --git a/include/linux/uidgid.h b/include/linux/uidgid.h > index b0542cd11aeb..75f602075b63 100644 > --- a/include/linux/uidgid.h > +++ b/include/linux/uidgid.h > @@ -55,8 +55,8 @@ static inline gid_t __kgid_val(kgid_t gid) +#include > #define GLOBAL_ROOT_UID KUIDT_INIT(0) > #define GLOBAL_ROOT_GID KGIDT_INIT(0) > > -#define INVALID_UID KUIDT_INIT(-1) > -#define INVALID_GID KGIDT_INIT(-1) > +#define INVALID_UID KUIDT_INIT(UINT_MAX) > +#define INVALID_GID KGIDT_INIT(UINT_MAX) > > static inline bool uid_eq(kuid_t left, kuid_t right) > { > -- ~Randy