Re: [PATCH v4 1/2] procfs: use an enum for possible hidepid values

From: Andrew Morton
Date: Tue Feb 14 2017 - 19:34:23 EST


On Mon, 13 Feb 2017 14:16:30 -0800 Kees Cook <keescook@xxxxxxxxxxxx> wrote:

> On Mon, Jan 16, 2017 at 5:23 AM, Djalal Harouni <tixxdz@xxxxxxxxx> wrote:
> > From: Lafcadio Wluiki <wluikil@xxxxxxxxx>
> >
> > Previously, the hidepid parameter was checked by comparing literal
> > integers 0, 1, 2. Let's add a proper enum for this, to make the checking
> > more expressive:
> >
> > 0 ___ HIDEPID_OFF
> > 1 ___ HIDEPID_NO_ACCESS
> > 2 ___ HIDEPID_INVISIBLE
> >
> > This changes the internal labelling only, the userspace-facing interface
> > remains unmodified, and still works with literal integers 0, 1, 2.
> >
> > No functional changes.
> >
> > Acked-by: Kees Cook <keescook@xxxxxxxxxxxx>
> > Acked-by: Djalal Harouni <tixxdz@xxxxxxxxx>
> > Signed-off-by: Lafcadio Wluiki <wluikil@xxxxxxxxx>
>
> Andrew, can you take this? It's a sensible cleanup to drop literals in
> favor of defines.

Sure.

Djalal, I converted your acked-by into a signed-off-by, as described in
Documentation/SubmittingPatches (soon to become
Documentation/process/submitting-patches.rst).