Re: [PATCH v7 1/2] Add an array of const char and enum oom_constraint in memcontrol.h

From: Matthew Wilcox
Date: Sat Jun 02 2018 - 07:20:11 EST


On Sat, Jun 02, 2018 at 07:06:44PM +0800, çèé wrote:
> From: yuzhoujian <yuzhoujian@xxxxxxxxxxxxxxx>
>
> This patch will make some preparation for the follow-up patch: Refactor
> part of the oom report in dump_header. It puts enum oom_constraint in
> memcontrol.h and adds an array of const char for each constraint.

This patch is whitespace damaged. See the instructions for using git
send-email with gmail: https://git-scm.com/docs/git-send-email

> +static const char * const oom_constraint_text[] = {
> + [CONSTRAINT_NONE] = "CONSTRAINT_NONE",
> + [CONSTRAINT_CPUSET] = "CONSTRAINT_CPUSET",
> + [CONSTRAINT_MEMORY_POLICY] = "CONSTRAINT_MEMORY_POLICY",
> + [CONSTRAINT_MEMCG] = "CONSTRAINT_MEMCG",
> +};
> +

Um, isn't this going to put the strings in every file which includes
memcontrol.h?