[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180108174340.GA7310@avx2>
Date: Mon, 8 Jan 2018 20:43:40 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: tim.c.chen@...ux.intel.com, aarcange@...hat.com
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 4/8] x86/spec_ctrl: Add sysctl knobs to enable/disable
SPEC_CTRL feature
> + len = sprintf(buf, "%d\n", READ_ONCE(*field));
READ_ONCE isn't necessary as there is only one read being made.
> + len = min(count, sizeof(buf) - 1);
> + if (copy_from_user(buf, user_buf, len))
> + return -EFAULT;
> +
> + buf[len] = '\0';
> + if (kstrtouint(buf, 0, &enable))
> + return -EINVAL;
There is kstrto*_from_user().
Powered by blists - more mailing lists