From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5013EC433F5 for ; Tue, 30 Nov 2021 14:23:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 797536B0072; Tue, 30 Nov 2021 09:22:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 746E16B0074; Tue, 30 Nov 2021 09:22:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 60D8F6B0075; Tue, 30 Nov 2021 09:22:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0159.hostedemail.com [216.40.44.159]) by kanga.kvack.org (Postfix) with ESMTP id 532E06B0072 for ; Tue, 30 Nov 2021 09:22:57 -0500 (EST) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 178368248076 for ; Tue, 30 Nov 2021 14:22:47 +0000 (UTC) X-FDA: 78865812774.31.C3EF15D Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf21.hostedemail.com (Postfix) with ESMTP id 4A946D036A4C for ; Tue, 30 Nov 2021 14:22:43 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A1903B81A03; Tue, 30 Nov 2021 14:22:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59D55C53FC1; Tue, 30 Nov 2021 14:22:41 +0000 (UTC) Date: Tue, 30 Nov 2021 09:22:40 -0500 From: Steven Rostedt To: Yafang Shao Cc: Andrew Morton , netdev , bpf , "linux-perf-use." , linux-fsdevel@vger.kernel.org, Linux MM , LKML , kernel test robot , kbuild test robot , Kees Cook , David Hildenbrand , Mathieu Desnoyers , Arnaldo Carvalho de Melo , Andrii Nakryiko , Michal Miroslaw , Peter Zijlstra , Matthew Wilcox , Al Viro , Petr Mladek Subject: Re: [PATCH v2 4/7] fs/binfmt_elf: replace open-coded string copy with get_task_comm Message-ID: <20211130092240.312f68a4@gandalf.local.home> In-Reply-To: References: <20211120112738.45980-1-laoar.shao@gmail.com> <20211120112738.45980-5-laoar.shao@gmail.com> <20211129110140.733475f3@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 4A946D036A4C X-Stat-Signature: xd6d17nmiawbitxp34ysw5frkkx59mn1 Authentication-Results: imf21.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf21.hostedemail.com: domain of "SRS0=Fq7e=QR=goodmis.org=rostedt@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=Fq7e=QR=goodmis.org=rostedt@kernel.org" X-HE-Tag: 1638282163-514107 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, 30 Nov 2021 11:01:27 +0800 Yafang Shao 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. -- Steve