From: Andy Shevchenko <andriy.shevchenko@linux•intel.com>
To: Alex Deucher <alexander.deucher@amd•com>,
Mikita Lipski <mikita.lipski@amd•com>,
Eryk Brol <eryk.brol@amd•com>,
Chris Wilson <chris@chris-wilson•co.uk>,
"David S. Miller" <davem@davemloft•net>,
Rahul Lakkireddy <rahul.lakkireddy@chelsio•com>,
Francis Laniel <laniel_francis@privacyrequired•com>,
amd-gfx@lists•freedesktop.org, dri-devel@lists•freedesktop.org,
linux-kernel@vger•kernel.org, intel-gfx@lists•freedesktop.org,
netdev@vger•kernel.org
Cc: "Harry Wentland" <harry.wentland@amd•com>,
"Leo Li" <sunpeng.li@amd•com>,
"Christian König" <christian.koenig@amd•com>,
"David Airlie" <airlied@linux•ie>,
"Daniel Vetter" <daniel@ffwll•ch>,
"Jani Nikula" <jani.nikula@linux•intel.com>,
"Joonas Lahtinen" <joonas.lahtinen@linux•intel.com>,
"Rodrigo Vivi" <rodrigo.vivi@intel•com>,
"Raju Rangoju" <rajur@chelsio•com>,
"Jakub Kicinski" <kuba@kernel•org>,
"Andy Shevchenko" <andriy.shevchenko@linux•intel.com>
Subject: [PATCH v1 2/3] string: Move onoff() helper under string.h hood
Date: Mon, 15 Feb 2021 16:21:36 +0200 [thread overview]
Message-ID: <20210215142137.64476-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20210215142137.64476-1-andriy.shevchenko@linux.intel.com>
We have already an implementation and a lot of code that can benefit
of the onoff() helper. Move it under string.h hood.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux•intel.com>
---
drivers/gpu/drm/i915/i915_utils.h | 5 -----
include/linux/string.h | 5 +++++
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h
index e6da5a951132..d2ac357896d4 100644
--- a/drivers/gpu/drm/i915/i915_utils.h
+++ b/drivers/gpu/drm/i915/i915_utils.h
@@ -409,11 +409,6 @@ wait_remaining_ms_from_jiffies(unsigned long timestamp_jiffies, int to_wait_ms)
#define MBps(x) KBps(1000 * (x))
#define GBps(x) ((u64)1000 * MBps((x)))
-static inline const char *onoff(bool v)
-{
- return v ? "on" : "off";
-}
-
static inline const char *enableddisabled(bool v)
{
return v ? "enabled" : "disabled";
diff --git a/include/linux/string.h b/include/linux/string.h
index fd946a5e18c8..2a0589e945d9 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -313,4 +313,9 @@ static inline const char *yesno(bool yes)
return yes ? "yes" : "no";
}
+static inline const char *onoff(bool on)
+{
+ return on ? "on" : "off";
+}
+
#endif /* _LINUX_STRING_H_ */
--
2.30.0
next prev parent reply other threads:[~2021-02-15 14:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-15 14:21 [PATCH v1 1/3] string: Consolidate yesno() helpers under string.h hood Andy Shevchenko
2021-02-15 14:21 ` Andy Shevchenko [this message]
2021-02-15 14:21 ` [PATCH v1 3/3] string: Move enableddisabled() helper " Andy Shevchenko
2021-02-15 14:26 ` [PATCH v1 1/3] string: Consolidate yesno() helpers " Christian König
2021-02-15 14:39 ` Andy Shevchenko
2021-02-17 12:45 ` Petr Mladek
2021-02-17 17:13 ` Jani Nikula
2021-02-15 14:37 ` Jani Nikula
2021-02-15 15:58 ` Andy Shevchenko
2021-10-05 21:34 ` Lucas De Marchi
2021-11-15 11:07 ` Andy Shevchenko
2021-11-15 11:43 ` Jani Nikula
2021-11-15 14:22 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210215142137.64476-2-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux$(echo .)intel.com \
--cc=airlied@linux$(echo .)ie \
--cc=alexander.deucher@amd$(echo .)com \
--cc=amd-gfx@lists$(echo .)freedesktop.org \
--cc=chris@chris-wilson$(echo .)co.uk \
--cc=christian.koenig@amd$(echo .)com \
--cc=daniel@ffwll$(echo .)ch \
--cc=davem@davemloft$(echo .)net \
--cc=dri-devel@lists$(echo .)freedesktop.org \
--cc=eryk.brol@amd$(echo .)com \
--cc=harry.wentland@amd$(echo .)com \
--cc=intel-gfx@lists$(echo .)freedesktop.org \
--cc=jani.nikula@linux$(echo .)intel.com \
--cc=joonas.lahtinen@linux$(echo .)intel.com \
--cc=kuba@kernel$(echo .)org \
--cc=laniel_francis@privacyrequired$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=mikita.lipski@amd$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=rahul.lakkireddy@chelsio$(echo .)com \
--cc=rajur@chelsio$(echo .)com \
--cc=rodrigo.vivi@intel$(echo .)com \
--cc=sunpeng.li@amd$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox