Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1157876pxb; Fri, 21 Jan 2022 11:04:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqXgN8rhZnsGWYgeBnP+FJXrwHmc97FbLfg6ZB9BU2KLZH5MzvDrcMC2y7XTtr1l4NH95W X-Received: by 2002:a63:c65:: with SMTP id 37mr3890233pgm.608.1642791898806; Fri, 21 Jan 2022 11:04:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642791898; cv=none; d=google.com; s=arc-20160816; b=FgYfrnUzQQdkN4UqKaD9GHbrgn7Cn8GmZvB9FFeunY6jzvMZfClOq9MpL4SeCT5BTg /HiADo4oy+VJeEmvyLdpnpgtS943jf/teLEgTM4R87mAfyuM7jWWQRR+i7dO36I5v+pV Z6u88RKofA7FeRbNqIRqJQL/bT4uiHxztw5Yip4FhowAjePQ0t4VMbjQWYq1nPRMhFzb MIwnuHHBuk3ifF1n6nN8GHbTqXbhHxjBUl6hn/O50u+S0YlTlTbQe8krCDcZQOvgODqm /8f8iUzmfF8uhWsnc2ZxUcRu4feiTTVIdhDk0ovReo/H7BcqCsqgdylIOxjZO2Un2SG4 ukaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=U+y9Pj+7JpWEjA9TEZrq5xQ5uMcLgMEXlJw0P2Ir0f0=; b=fngz7P5GN3XKvojrxazK+gUZjBbYmif6zxZ7wEwAAv2kEG42ZabXgPhRLfFkO+XsAM MFV0IhWW/h8NADGdigG+T71icw3XOoE3+bgy3Jmd+k33vDHLs3TU74puWvVMODOhi1Nx GZ5S4uOlV/KARtpk2vHnak2POQREWLERVXdXReMKG8gDI3eE8q0JXIzbjRZYdI7tTRwY DKRR9bAfQGf5z5Uk9U6S2iwZ0USMJS5RbswGRYd5x1pW659WDVKIxXVeGmxBU5LdnXEj 8u4wvcjTE1vOvCk5mww6P0rVCG3tJ9GuVjoMS7V3u9/tW2Vd7MTuO6SEiimkXKACV1oS +jkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PZlBTFIU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b13si6378237pgk.399.2022.01.21.11.04.46; Fri, 21 Jan 2022 11:04:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PZlBTFIU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352917AbiASJmx (ORCPT + 99 others); Wed, 19 Jan 2022 04:42:53 -0500 Received: from mga01.intel.com ([192.55.52.88]:32092 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235918AbiASJmv (ORCPT ); Wed, 19 Jan 2022 04:42:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642585371; x=1674121371; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=LxWQZjhb/fNbEShE73X5g5DvnhYQLiQO3Stdcf1bZhA=; b=PZlBTFIUoLS1PtpsQP14JHhklMx4Yedi4yLPuigaWjdeYYI7HZ+SBw2I u1TuGl2uW0oYWknBTM3AgwQlVaHhYnJFnzKj4vjzBxLnJFQkaLssOZ2gi cRDQgBA7fANq0KGW2EFVFHhxN4EQ1bucK4DhhAFh51DdAGepl8+c1YUa8 eoTB134DoOAFtd+yPhtejGZr597DosZnJv3qXRpvHsJa9RT0Bknf/xKwF yewkX/4LBf4eTjyvEeEuCn1J0ceRI55UCG47VqTDbc3i7mR9kIJjpAIVG RKS+tteXGKAcpEtm6r6MfXv9HRk3RjkhpsxSXTdbzaUKAotCnf8vxk0C+ g==; X-IronPort-AV: E=McAfee;i="6200,9189,10231"; a="269418425" X-IronPort-AV: E=Sophos;i="5.88,299,1635231600"; d="scan'208";a="269418425" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 01:42:50 -0800 X-IronPort-AV: E=Sophos;i="5.88,299,1635231600"; d="scan'208";a="532207547" Received: from atefehad-mobl1.amr.corp.intel.com (HELO ldmartin-desk2) ([10.212.238.132]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 01:42:49 -0800 Date: Wed, 19 Jan 2022 01:42:49 -0800 From: Lucas De Marchi To: Andy Shevchenko Cc: Emma Anholt , David Airlie , "nouveau@lists.freedesktop.org" , Rasmus Villemoes , "dri-devel@lists.freedesktop.org" , Chris Wilson , Vishal Kulkarni , Francis Laniel , Kentaro Takeda , Mikita Lipski , "amd-gfx@lists.freedesktop.org" , Ben Skeggs , Jakub Kicinski , Petr Mladek , Sakari Ailus , Leo Li , "intel-gfx@lists.freedesktop.org" , Raju Rangoju , Julia Lawall , Rahul Lakkireddy , Steven Rostedt , Rodrigo Vivi , Andy Shevchenko , Eryk Brol , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , Christian =?utf-8?B?S8O2bmln?= , Sergey Senozhatsky , "linux-security-module@vger.kernel.org" , "netdev@vger.kernel.org" , Alex Deucher , Andrew Morton , "David S . Miller" Subject: Re: [PATCH 2/3] lib/string_helpers: Add helpers for enable[d]/disable[d] Message-ID: <20220119094249.6g24562y2b4iwtvk@ldmartin-desk2> References: <20220119072450.2890107-1-lucas.demarchi@intel.com> <20220119072450.2890107-3-lucas.demarchi@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 19, 2022 at 11:20:38AM +0200, Andy Shevchenko wrote: >On Wednesday, January 19, 2022, Lucas De Marchi >wrote: > >> Follow the yes/no logic and add helpers for enabled/disabled and >> enable/disable - those are not so common throughout the kernel, >> but they give a nice way to reuse the strings to log things as >> enabled/disabled or enable/disable. >> >> Signed-off-by: Lucas De Marchi >> --- >> drivers/gpu/drm/i915/i915_utils.h | 10 ---------- >> include/linux/string_helpers.h | 2 ++ >> 2 files changed, 2 insertions(+), 10 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/i915_utils.h >> b/drivers/gpu/drm/i915/i915_utils.h >> index 2a8781cc648b..cbec79bae0d2 100644 >> --- a/drivers/gpu/drm/i915/i915_utils.h >> +++ b/drivers/gpu/drm/i915/i915_utils.h >> @@ -419,16 +419,6 @@ static inline const char *onoff(bool v) >> return v ? "on" : "off"; >> } >> >> -static inline const char *enabledisable(bool v) >> -{ >> - return v ? "enable" : "disable"; >> -} >> - >> -static inline const char *enableddisabled(bool v) >> -{ >> - return v ? "enabled" : "disabled"; >> -} >> - >> void add_taint_for_CI(struct drm_i915_private *i915, unsigned int taint); >> static inline void __add_taint_for_CI(unsigned int taint) >> { >> diff --git a/include/linux/string_helpers.h b/include/linux/string_ >> helpers.h >> index e980dec05d31..e4b82f364ee1 100644 >> --- a/include/linux/string_helpers.h >> +++ b/include/linux/string_helpers.h >> @@ -103,5 +103,7 @@ char *kstrdup_quotable_file(struct file *file, gfp_t >> gfp); >> void kfree_strarray(char **array, size_t n); >> >> static inline const char *yesno(bool v) { return v ? "yes" : "no"; } >> +static inline const char *enabledisable(bool v) { return v ? "enable" : >> "disable"; } >> +static inline const char *enableddisabled(bool v) { return v ? "enabled" >> : "disabled"; } > > >Looks not readable even if takes 80 characters. Please, keep original style. > > >I believe you wanted to have nice negative statistics from day 1, then you >may add more patches in the series to cleanup more users. not really the reason... it was just "this is small enough and checkpatch doesn't complain" (it checks for 100 chars nowadays). But yes, I can keep it in 4 lines. thanks Lucas De Marchi