Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp893500ybk; Wed, 13 May 2020 16:18:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSVa+F9lwF6wyYBQ/X3FWqPXNEcXFPYqv8LNesmloQu09lSNdUUQ47Bf9RTe/m2CIJlof4 X-Received: by 2002:a17:906:6990:: with SMTP id i16mr1291220ejr.175.1589411904776; Wed, 13 May 2020 16:18:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589411904; cv=none; d=google.com; s=arc-20160816; b=Slouc4sE9V2OHJTNarUsK6eDei93BtjrzpbrA5tKfoOWa65b1dapEghRZHpUrF3g4u MSgM7j9SdKc10dPfrezAi7JVFH3IcvLvc2n7nKgEaLbrKq7yoOoph3Exq/pnKiEYfooF FdaSdRoemfX+zQanzuDmtj2I44d65e9SuX8o/8Byz62SgwGxUpYGTbpuWXLPsogz4Nqa 6xak53vH/4xtQYTpMGoVseX8auRnxSdYOjU/cC8ad9OJ3xeLJcNB+0+spq44hMCk4wuA LAYhUFNdzKsQjmbjnPbhch9UK7Xwlcqdvu94GYe0uDJuri66rNaHKUnw4yLkZzNCnk7w tChw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-id:mime-version :subject:cc:to:references:in-reply-to:from:organization :dkim-signature; bh=T5AJR2WaKjGAcCSypFEIypZ7FO4lpByrCMG2GJChQq0=; b=NOOvtN026MOp+hoRSKlY1jd7r2quI48gthlg7JWmfFZjI/KF3gUbsPG5gLsiiKwDWJ 6Rrt6kIHyjGdbr9+Guh3pBF51U8FFiaXLBcRmcfuSQjOdfJsDDKypLJ0Lbh7LHlctAX3 rI+kTfhkUvG1GGoBMa0fqBSv99XkhQNhAfFdyDAcB3Cmp6loRuj2/CKGfEbG3wTXB0m4 v2Xrej4YGIDlHEx//VDZ7dWoX8H0wjU0KxuK4Pxud04A6hpkqs9qLzy91amPHhZ0/Taw G7FGLWF9RH1nRzY+vfL2cWjtuinURbLdpwDyKFg8b6pkgeluc+CWQY0732ybYLPMWyk+ EuJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UQx3BW0o; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c9si589835edt.576.2020.05.13.16.18.00; Wed, 13 May 2020 16:18:24 -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=@redhat.com header.s=mimecast20190719 header.b=UQx3BW0o; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732507AbgEMXQU (ORCPT + 99 others); Wed, 13 May 2020 19:16:20 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:34718 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732408AbgEMXQT (ORCPT ); Wed, 13 May 2020 19:16:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589411778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=T5AJR2WaKjGAcCSypFEIypZ7FO4lpByrCMG2GJChQq0=; b=UQx3BW0oP9w1XKMu9tpT611fvfgXPLVD/8Qd3XbbDoZ2hnqOlvBq1kJbVuiK+Tf/2uWn+d jTzny5dzrA9sPiuLX0Er4BJ/X62a0BnSmIbZ+l93dRw4mdH5bEq+N43h9Pd7RZ1PfsfuCp LXzoRWxdkuQq2DMVDy4JDR+flsRdbu4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-146-E8cGbxnwNDOYTGRpB5xLtA-1; Wed, 13 May 2020 19:16:16 -0400 X-MC-Unique: E8cGbxnwNDOYTGRpB5xLtA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F20E7461; Wed, 13 May 2020 23:16:14 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-112-59.rdu2.redhat.com [10.10.112.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5221F600DB; Wed, 13 May 2020 23:16:13 +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 From: David Howells In-Reply-To: References: <158932282880.2885325.2688622278854566047.stgit@warthog.procyon.org.uk> To: Paul Moore Cc: dhowells@redhat.com, Stephen Smalley , Jarkko Sakkinen , Casey Schaufler , keyrings@vger.kernel.org, selinux@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] keys: Make the KEY_NEED_* perms an enum rather than a mask MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3611714.1589411772.1@warthog.procyon.org.uk> Date: Thu, 14 May 2020 00:16:12 +0100 Message-ID: <3611715.1589411772@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Paul Moore wrote: > > + case KEY_NEED_VIEW: perm = KEY__VIEW; break; > > + case KEY_NEED_READ: perm = KEY__READ; break; > > + case KEY_NEED_WRITE: perm = KEY__WRITE; break; > > + case KEY_NEED_SEARCH: perm = KEY__SEARCH; break; > > + case KEY_NEED_LINK: perm = KEY__LINK; break; > > + case KEY_NEED_SETATTR: perm = KEY__SETATTR; break; > > Please don't put the case statements all on one line, use the more > traditional multi-line format. For example: > > case KEY_NEED_SETATTR: > perm = KEY__SETATTR; > break; Tabulation was invented something like 6000 years ago for just this kind of purpose;-) It's less readable your way, but whatever... David