lkml.org 
[lkml]   [2021]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 4/7] fs/binfmt_elf: replace open-coded string copy with get_task_comm
On Tue, Nov 30, 2021 at 10:22 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Tue, 30 Nov 2021 11:01:27 +0800
> Yafang Shao <laoar.shao@gmail.com> wrote:
>
> > There are three options,
> > - option 1
> > comment on all the hard-coded 16 to explain why it is hard-coded
> > - option 2
> > replace the hard-coded 16 that can be replaced and comment on the
> > others which can't be replaced.
> > - option 3
> > replace the hard-coded 16 that can be replaced and specifically
> > define TASK_COMM_LEN_16 in other files which can't include
> > linux/sched.h.
> >
> > Which one do you prefer ?
> >
>
> Option 3. Since TASK_COMM_LEN_16 is, by it's name, already hard coded to
> 16, it doesn't really matter if you define it in more than one location.
>
> Or we could define it in another header that include/sched.h can include.
>
> The idea of having TASK_COMM_LEN_16 is to easily grep for it, and also know
> exactly what it is used for when people see it being used.
>

I will send a separate patch (or patchset) to replace all the old
hard-coded 16 with TASK_COMM_LEN_16 based on the -mm tree.

--
Thanks
Yafang

\
 
 \ /
  Last update: 2021-11-30 16:54    [W:0.133 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site