Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2781196pxv; Sun, 27 Jun 2021 08:37:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLvLdGV5E2IFXQ3L0hR0zvWqVzyTnyynYLbM3C1cU4oFy5zrK8wbuXOy45a/E3S3U4/Npp X-Received: by 2002:a17:906:150c:: with SMTP id b12mr2571808ejd.275.1624808257352; Sun, 27 Jun 2021 08:37:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624808257; cv=none; d=google.com; s=arc-20160816; b=hKC+TnCmGhwbF6RHUp0SvrKVobraGSl/QZyi958FkHSydD5q3gv9BGZAdeM5z9F96A ZzAGi1TcZ5pRFJhvUmQCByrumDx+Cr80s5aDLO4+nHk7MIeBV5hRYNU3iUqyaqLRBzLU Ly4BSFvrbeBHc2tcDGwb/316bg5q+Zp2awa1hJ5eGVnwDehT+4K1lWJ30IFcHdUOdiYB AQf2QWp5ylPv8wvJaM7JkjyUkbvWAMM1ZDXcBnAUHKreFZN5XoBFBf0a4v3ISbiRnyHv MdXbkD9aK2os/+Wf3LcuSX/AU8OrsxB+nEgimvV5VAhe8/StGF6g1dG8DTbrjjblIsQo rfPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Txa0INlL+OSLfHvp3om1Dw++tsAFY/LE77Yq+Esundo=; b=oRdA+coAmABGHmfND5TEfacw7iwBLPaCq1Bn8WB/YKmKcPUGaP3JgF7XJ7PYqFitWy lS7UHxHHDCYv5kgjXt37WqKs0zFJDvV37VPtdv00cdtR2G1B2Y1RSkiHC/xrZ/3mEq+W RLaEPuIxdjI9zjcmpUmaLM6Xh73QTiJRc9CylM+vNUGQj0DKBkV4AAfmjXRP6lDhkl1V uvoYh2Zoi5XvJU0rM0r6HRoq4XMPyES+3WLdtUVieX4pavCOR+woxX28RbS56B2ZwIpE thPQ9BpLi2sx2B1F4cMDy7FVnidzAyylpcTTc38mDvE+U4asJQrtUMr6zxhoVQkCzdQ3 WO2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d9aDm0u1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a19si11695369edr.397.2021.06.27.08.37.14; Sun, 27 Jun 2021 08:37:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d9aDm0u1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231243AbhF0PiY (ORCPT + 99 others); Sun, 27 Jun 2021 11:38:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:45794 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230225AbhF0PiW (ORCPT ); Sun, 27 Jun 2021 11:38:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 99A2761416; Sun, 27 Jun 2021 15:35:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624808158; bh=IIp2MobQeg2HLnqt1w3NF2LefNGWMGP642ajbW5iJsw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d9aDm0u1a6hcYOGA7nqttUUmwaq0nMSviQPJI/KAccL/6m58Inrw71sbcL9GU2Ggc /+QwHFZysKpuw3vh8fS0uPSlsBBPg+3do+YKclveXTf0wfHHMtXigXSJbNOTPfkvpX VLb9GnZtJfGZbarYBHS7CXOkJEC0crOyFUEIZQB8= Date: Sun, 27 Jun 2021 17:35:55 +0200 From: Greg KH To: Matthew Wilcox , Arnd Bergmann Cc: Roberto Sassu , zohar@linux.ibm.com, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH 03/12] digest_lists: Basic definitions Message-ID: References: <20210625165614.2284243-1-roberto.sassu@huawei.com> <20210625165614.2284243-4-roberto.sassu@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 27, 2021 at 04:23:26PM +0100, Matthew Wilcox wrote: > On Sun, Jun 27, 2021 at 12:53:47PM +0200, Greg KH wrote: > > > +enum ops { DIGEST_LIST_ADD, DIGEST_LIST_DEL, DIGEST_LIST_OP__LAST }; > > > + > > > > For enums you export to userspace, you need to specify the values so > > that all compilers get them right. > > I've never heard that rule before. Where does it come from? > https://en.cppreference.com/w/c/language/enum > says: > > If enumeration-constant is not followed by = constant-expression, > its value is the value one greater than the value of the previous > enumerator in the same enumeration. The value of the first enumerator > (if it does not use = constant-expression) is zero. > I thought it was in the Documentation/driver-api/ioctl.rst file, but I can't find it right now. Maybe it was something that Arnd said? Arnd, is this still an issue? For some reason I thought it was always good to have uapi .h enums be explicit as to the value in them, otherwise some C compilers might produce other values if they were not specified? thanks, greg k-h