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 BBBDBCD342A for ; Tue, 3 Sep 2024 15:09:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3A1978D018E; Tue, 3 Sep 2024 11:09:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2BF0F8D018A; Tue, 3 Sep 2024 11:09:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1306D8D018E; Tue, 3 Sep 2024 11:09:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 8B9498D018A for ; Tue, 3 Sep 2024 11:09:11 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 4222D120570 for ; Tue, 3 Sep 2024 15:09:11 +0000 (UTC) X-FDA: 82523760102.03.7C65022 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by imf28.hostedemail.com (Postfix) with ESMTP id C1DFBC0023 for ; Tue, 3 Sep 2024 15:09:08 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; spf=softfail (imf28.hostedemail.com: 198.175.65.10 is neither permitted nor denied by domain of andy@kernel.org) smtp.mailfrom=andy@kernel.org; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=kernel.org (policy=quarantine) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725376101; a=rsa-sha256; cv=none; b=VmHAn1IsDLLPbbj3GEG3SJ4yg9SRTFnmEEYqp64gnuuR74SdaKyXWLh3UJB5wpzP5RWIP8 czW1TzB7BiC0hw0nk2sSdoV8l1+Vab7BWVIkUga69aec9gu3YPZMdz17y0O0gWR/EAS9Du /Y90q7OMf9i/oF9AYXaaLBZ3fkapA2c= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; spf=softfail (imf28.hostedemail.com: 198.175.65.10 is neither permitted nor denied by domain of andy@kernel.org) smtp.mailfrom=andy@kernel.org; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=kernel.org (policy=quarantine) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725376101; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8pwjPXSnECKn2ChrVN/AYa1NgO1KSfR8wRpSAKOpt4g=; b=WxjJ5WBI+rH3aO7Bwt+Xtu9tIA2ZtBafOVCqPrO6sC8LoD/z0ZpvEHDmu7ZxGnybdA2F/+ oDb3W0iWoc7PoNJDPZI6DpSCxab5I0ce0cknHjE4OM1Z4dgbKrqGOGXUQA+7f0NyXNbkfq r/ZAoU2Sr5MxhaCAV06UKpwfB5eTsBk= X-CSE-ConnectionGUID: /7k7bN4zSmqNdSF15Bofdg== X-CSE-MsgGUID: QspBCm4cRdeqlEv9vpCURA== X-IronPort-AV: E=McAfee;i="6700,10204,11184"; a="41453767" X-IronPort-AV: E=Sophos;i="6.10,199,1719903600"; d="scan'208";a="41453767" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2024 08:09:07 -0700 X-CSE-ConnectionGUID: iVinaASRSkSiO4U2LiTn/g== X-CSE-MsgGUID: FvYmrQO5SBWgR1VrURNeQg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,199,1719903600"; d="scan'208";a="69799370" Received: from smile.fi.intel.com ([10.237.72.54]) by orviesa004.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2024 08:09:04 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.98) (envelope-from ) id 1slV9R-00000004kPt-0R69; Tue, 03 Sep 2024 18:09:01 +0300 Date: Tue, 3 Sep 2024 18:09:00 +0300 From: Andy Shevchenko To: Hongbo Li Cc: Willem de Bruijn , Jakub Kicinski , kees@kernel.org, jasowang@redhat.com, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, akpm@linux-foundation.org, linux-hardening@vger.kernel.org, netdev@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH -next 2/4] tun: Make use of str_disabled_enabled helper Message-ID: References: <20240831095840.4173362-1-lihongbo22@huawei.com> <20240831095840.4173362-3-lihongbo22@huawei.com> <20240831130741.768da6da@kernel.org> <66d5cc19d34c6_613882942a@willemb.c.googlers.com.notmuch> <9d844c72-bda6-4e28-b48c-63c4f8855ae7@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9d844c72-bda6-4e28-b48c-63c4f8855ae7@huawei.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: C1DFBC0023 X-Stat-Signature: fux58iq7juc7bm5wntom8t4d44cx4ncs X-Rspam-User: X-Rspamd-Pre-Result: action=add header; module=dmarc; Action set by DMARC X-Rspam: Yes X-HE-Tag: 1725376148-84548 X-HE-Meta: U2FsdGVkX1/cnPDaJ/Xq7wtVOf2wIeKmDOoAPpbyQGpVpFx9WUb8UM2a04wgro52KVZlEW58pt4YQjNqO2/UQko1qYYmvYuxoWxnXoX3ULcMWOV7UpJ4i0bEq5oSOkMCL+bd+0yy50Tf5ozg/w71WUATRgiTnzj2BclqKmu9KvpZDBD49tmF78pzzEgXbqZl0y+uSmQhfxVo1z9zcEUPWP3wpqIbC92bsW/6debGtlH4eSB5KMmErVltO8kqaXrszvD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 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Sep 03, 2024 at 02:25:53PM +0800, Hongbo Li wrote: > On 2024/9/2 22:30, Willem de Bruijn wrote: > > Andy Shevchenko wrote: > > > On Sat, Aug 31, 2024 at 01:07:41PM -0700, Jakub Kicinski wrote: > > > > On Sat, 31 Aug 2024 17:58:38 +0800 Hongbo Li wrote: ... > > > > > netif_info(tun, drv, tun->dev, "ignored: set checksum %s\n", > > > > > - arg ? "disabled" : "enabled"); > > > > > + str_disabled_enabled(arg)); > > > > > > > > You don't explain the 'why'. How is this an improvement? > > > > nack on this and 2 similar networking changes you sent > > > > > > Side opinion: This makes the messages more unified and not prone to typos > > > and/or grammatical mistakes. Unification allows to shrink binary due to > > > linker efforts on string literals deduplication. > > > > This adds a layer of indirection. > > > > The original code is immediately obvious. When I see the new code I > > have to take a detour through cscope to figure out what it does. > If they have used it once, there is no need for more jumps, because it's > relatively simple. > > Using a dedicated function seems very elegant and unified, especially for > some string printing situations, such as disable/enable. Even in today's > kernel tree, there are several different formats that appear: > 'enable/disable', 'enabled/disabled', 'en/dis'. Not to mention that the longer word is the more error prone the spelling. > > To me, in this case, the benefit is too marginal to justify that. Hongbo, perhaps you need to add a top comment to the string_choices.h to explain the following: 1) the convention to use is str_$TRUE_$FALSE(), where $TRUE and $FALSE the respective words printed; 2) the pros of having unified output, 3) including but not limited to the linker deduplication facilities, making the binary smaller. With that you may always point people to the ad-hoc documentation. -- With Best Regards, Andy Shevchenko