Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1132588pxb; Fri, 21 Jan 2022 10:31:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJz4IR6eVOz8Tkngwx3cOu8b6K12dXayLqlzYd2QXOKlq+lKzztMMlbTta9bC0nlnH11eKW6 X-Received: by 2002:a17:90b:1c02:: with SMTP id oc2mr1975236pjb.31.1642789901886; Fri, 21 Jan 2022 10:31:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642789901; cv=none; d=google.com; s=arc-20160816; b=NLj51Zzm4viTtyIg4oYlE8/OKT1yS6EbGVP0ecTaRSGXvJBuhmaAJdLnAanbg//vyP W0lewPo7b4gbFycBMcoeQcPR6Tu/NulwFxXixaw9dOjjQL2vID1Hdi6ZzWNMkpIAmLPq +qfsZI80VXrf3mtqmA3evW3RfB/Eaqsh70tIWy9aIoM93M/8mu69ZN7nYHOr5Jqp32Kh OmnnH6J3BZRM0YYgitCb8y1K5Bvo1Fc1C/JRmLzDEJxloRGXtN4mnbEnZDyQQXNQnRDN mfouoLPhVIE6plso2qysD2TCELpr9sF9PLOX1Jnb3UTGkaUVBYl8GmyxQ7GpjUQlPEyK gr0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=q+yLUE1Hjd6ErAJG6KatXyBuP0+x76d0dKMtsXIWC7U=; b=cL8ukZ7Ay6M6lku11RUQAQVL9qNXV+/6WxFDTPYy862HIErU5mYyw8TiKeube7lcIq AUe5bZHIB/nBqDOgqVvlZlE7rYiKaWUXtz+2E8Nmw5rpPJ63k+2UC/Qgp9jq5wj+jaqu tUt0I6EhXaagCok9hf95AvQtCgz7TDRLYNawSGngS+hlJ716x7nG7NXXb6VryYiFNnKS 7pp4C48skLLYfkwfKeJSANsyp02xjkG3najW49fPONOQe305iC+9xvsepd+hZ24iy+VT 6tjuQANYRb+p/8d0cDveg2Og5NVSQvwjuH4E604hMZWmtayA3gA+MvFmJvA+yXkbjICl 6Waw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VD0HKivQ; 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 l20si8613604pfc.91.2022.01.21.10.31.30; Fri, 21 Jan 2022 10:31:41 -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=VD0HKivQ; 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 S1352018AbiASHYb (ORCPT + 99 others); Wed, 19 Jan 2022 02:24:31 -0500 Received: from mga09.intel.com ([134.134.136.24]:35948 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351985AbiASHY1 (ORCPT ); Wed, 19 Jan 2022 02:24:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642577067; x=1674113067; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=D8Hcj6/0idCaGqbYLAjOwo8mGw2XLo6q3lh1A6mM9gI=; b=VD0HKivQ+g/aP/dYr6XIscnvTqiDjRpua+QDcUwsPnE/8itfG6sCdJGv 61iBIG2A3cbXQnH0gzuydaT2rwmuhzQ7DSmGOVEWpzkX6j6u3WEnAyufQ JG3opJ7UNv0xz5w8sljT+ak6LtUzSDfrftaQ1eTdIG7wxd+pCUqeYr6w8 AVqBi0K2HvJn6R6ExY2q/lowWjHa799NjSk6Sh502nvzIYGCOEJJZwAjZ LiFyPCHOjXo/h9XfUQPsPC5aYMD75q8ozwoY8zl8PZYpycfdDsDbffAlD kYZ/T50jHuAGNFolsX1XrmScpaA0wE7LKKb5mRo5fH6s2ne7lI3dElRAf w==; X-IronPort-AV: E=McAfee;i="6200,9189,10231"; a="244799932" X-IronPort-AV: E=Sophos;i="5.88,299,1635231600"; d="scan'208";a="244799932" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2022 23:24:27 -0800 X-IronPort-AV: E=Sophos;i="5.88,299,1635231600"; d="scan'208";a="530544508" Received: from lucas-s2600cw.jf.intel.com ([10.165.21.202]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2022 23:24:26 -0800 From: Lucas De Marchi To: linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-security-module@vger.kernel.org, nouveau@lists.freedesktop.org, netdev@vger.kernel.org Cc: Alex Deucher , Andrew Morton , Andy Shevchenko , Andy Shevchenko , Ben Skeggs , =?UTF-8?q?Christian=20K=C3=B6nig?= , Chris Wilson , Daniel Vetter , David Airlie , "David S . Miller" , Emma Anholt , Eryk Brol , Francis Laniel , Greg Kroah-Hartman , Harry Wentland , Jakub Kicinski , Jani Nikula , Joonas Lahtinen , Julia Lawall , Kentaro Takeda , Leo Li , Mikita Lipski , Petr Mladek , Rahul Lakkireddy , Raju Rangoju , Rasmus Villemoes , Rodrigo Vivi , Sakari Ailus , Sergey Senozhatsky , Steven Rostedt , Vishal Kulkarni Subject: [PATCH 2/3] lib/string_helpers: Add helpers for enable[d]/disable[d] Date: Tue, 18 Jan 2022 23:24:49 -0800 Message-Id: <20220119072450.2890107-3-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220119072450.2890107-1-lucas.demarchi@intel.com> References: <20220119072450.2890107-1-lucas.demarchi@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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"; } #endif -- 2.34.1