Received: by 10.213.65.68 with SMTP id h4csp1741079imn; Sun, 1 Apr 2018 13:42:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx49jZg62lPCaAjZLs7eudcXVXX9/Y267UG5ecdktC9tzJLZMa8b8YruSBUYklkGB+Q+ovkpi X-Received: by 2002:a17:902:6e01:: with SMTP id u1-v6mr7238541plk.96.1522615361652; Sun, 01 Apr 2018 13:42:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522615361; cv=none; d=google.com; s=arc-20160816; b=BcO7xXMyhZza6UaHysmcJNI9bWbRb4Dgxs7xomE8t21y76FKFe5E9yMzLkAC6ry7OL MRIm/8xGXiC/R8t8tuichpN417wbozZI/DTvX5MKWLPzO5NRbUbsdGbFa+bQ5m5bCoOu tG+WbHd0RPQRcCaVMC/0AK2QXPXvKVu/kLQmXXgi3z9b4+81NSEea1G/k6QSNrUNSmhK sEA17p47V7x4j3Hc61Hy1rBZuvEhJVsaN6eSfhS5zeimo2fDaClYCkFRcU9ZLYWb1nG2 mJFB1nTTW6C1Fz/XVrGKVCfvt9NUeXSeFVZGonvulnL7jEkbv7x2XxGUMys/dSKMP8RE 90ig== 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:mime-version :user-agent:references:in-reply-to:message-id:date:to:from:subject :organization:arc-authentication-results; bh=VuqzWkxtT/l4v2Exmnt6L+Cvkucim1s3kBYB/f3ri38=; b=GNZjL7E35Mpkm7Mnw+Cc1bV6oatksKccaJkNU9o9K3yLnU6FrLC/IhstyM6UL8Z8nV 7t4ofhY3pCA/O+eQE+dM0OnV/MLHJdMRt75hQ2Gc19BIHINPtBRpyfvO1Eksp1wCxFFY YZyLBzEp+bQRb2aZNqFTtti4d70Ymnnu2tmLitQI4/gL98o6N0qmKbro1wDjCSuAFg5Q 2eAtZrwGZulWWP3m1OXr3WWGaYsDSvqgDqZo6XM+nxyfVyOqVHyZ5vcLELKP+q5zuDhT 2ePYkpku1xnm3KOi72dBNM6uoegGTiaodDu0Jjo9t7ShFDWr2Xyis+o30BWFpzVEJKii /QQQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s15-v6si7374812plp.266.2018.04.01.13.41.59; Sun, 01 Apr 2018 13:42:41 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753973AbeDAUk0 (ORCPT + 99 others); Sun, 1 Apr 2018 16:40:26 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:52920 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753901AbeDAUkW (ORCPT ); Sun, 1 Apr 2018 16:40:22 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4E04F722FA for ; Sun, 1 Apr 2018 20:40:22 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-59.rdu2.redhat.com [10.10.120.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id F25EF2166BC7; Sun, 1 Apr 2018 20:40:21 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 01/45] Use UINT_MAX, not -1, to represent an invalid UID, GID or project ID From: David Howells To: linux-kernel@vger.kernel.org Date: Sun, 01 Apr 2018 21:40:21 +0100 Message-ID: <152261522136.30503.14306229915768504613.stgit@warthog.procyon.org.uk> In-Reply-To: <152261521484.30503.16131389653845029164.stgit@warthog.procyon.org.uk> References: <152261521484.30503.16131389653845029164.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Sun, 01 Apr 2018 20:40:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Sun, 01 Apr 2018 20:40:22 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) #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) #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) {