All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	amd-gfx@lists.freedesktop.org,
	linux-security-module <linux-security-module@vger.kernel.org>,
	nouveau@lists.freedesktop.org, netdev <netdev@vger.kernel.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Ben Skeggs" <bskeggs@redhat.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Chris Wilson" <chris@chris-wilson.co.uk>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"David Airlie" <airlied@linux.ie>,
	"David S. Miller" <davem@davemloft.net>,
	"Emma Anholt" <emma@anholt.net>,
	"Francis Laniel" <laniel_francis@privacyrequired.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Harry Wentland" <harry.wentland@amd.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Jani Nikula" <jani.nikula@linux.intel.com>,
	"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
	"Julia Lawall" <julia.lawall@lip6.fr>,
	"Kentaro Takeda" <takedakn@nttdata.co.jp>,
	"Leo Li" <sunpeng.li@amd.com>, "Petr Mladek" <pmladek@suse.com>,
	"Rahul Lakkireddy" <rahul.lakkireddy@chelsio.com>,
	"Raju Rangoju" <rajur@chelsio.com>,
	"Rasmus Villemoes" <linux@rasmusvillemoes.dk>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Sergey Senozhatsky" <sergey.senozhatsky@gmail.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Vishal Kulkarni" <vishal@chelsio.com>
Subject: Re: [PATCH v2 00/11] lib/string_helpers: Add a few string helpers
Date: Wed, 26 Jan 2022 12:22:46 +0200	[thread overview]
Message-ID: <CAHp75VcheiM7gNW+zP2Ve8qOj40158aOM0OkhUjyODd+V3sYjQ@mail.gmail.com> (raw)
In-Reply-To: <20220126093951.1470898-1-lucas.demarchi@intel.com>

On Wed, Jan 26, 2022 at 11:39 AM Lucas De Marchi
<lucas.demarchi@intel.com> wrote:
>
> Add some helpers under lib/string_helpers.h so they can be used
> throughout the kernel. When I started doing this there were 2 other
> previous attempts I know of, not counting the iterations each of them
> had:
>
> 1) https://lore.kernel.org/all/20191023131308.9420-1-jani.nikula@intel.com/
> 2) https://lore.kernel.org/all/20210215142137.64476-1-andriy.shevchenko@linux.intel.com/#t
>
> Now there is also the v1 of this same patch series:
> https://lore.kernel.org/all/20220119072450.2890107-1-lucas.demarchi@intel.com/
>
> Going through the comments I tried to find some common ground and
> justification for what is in here, addressing some of the concerns
> raised.
>
> a. This version should be a drop-in replacement for what is currently in
>    the tree, with no change in behavior or binary size. For binary
>    size what I checked was that the linked objects in the end have the
>    same size (gcc 11). From comments in the previous attempts this seems
>    also the case for earlier compiler versions
>
> b. I didn't change the function name to choice_* as suggested by Andrew
>    Morton in 20191023155619.43e0013f0c8c673a5c508c1e@linux-foundation.org
>    because other people argumented in favor of shorter names for these
>    simple helpers - if they are long and people simply not use due to
>    that, we failed. However as pointed out in v1 of this patchseries,
>    onoff(), yesno(), enabledisable(), enableddisabled() have some
>    issues: the last 2 are hard to read and for the first 2 it would not
>    be hard to have the symbol to clash with variable names.
>    From comments in v1, most people were in favor (or at least not
>    opposed) to using str_on_off(), str_yes_no(), str_enable_disable()
>    and str_enabled_disabled().
>
> c. Use string_helper.h for these helpers - pulling string.h in the
>    compilations units was one of the concerns and I think re-using this
>    already existing header is better than creating a new string-choice.h
>
> d. One alternative to all of this suggested by Christian König
>    (43456ba7-c372-84cc-4949-dcb817188e21@amd.com) would be to add a
>    printk format. But besides the comment, he also seemed to like
>    the common function. This brought the argument from others that the
>    simple yesno()/enabledisable() already used in the code (or new
>    renamed version) is easier to remember and use than e.g. %py[DOY]

I do not see any impediments to this series to be pulled.
Thanks for the work you've done!

> Changes in v2:
>
>   - Use str_ prefix and separate other words with underscore: it's a
>     little bit longer, but should improve readability
>
>   - Patches we re-split due to the rename: first patch adds all the new
>     functions, then additional patches try to do one conversion at a
>     time. While doing so, there were some fixes for issues already
>     present along the way
>
>   - Style suggestions from v1 were adopted
>
> In v1 it was suggested to apply this in drm-misc. I will leave this to
> maintainers to decide: maybe it would be simpler to merge the first
> patches on drm-intel-next, wait for the back merge and merge the rest
> through drm-misc - my fear is a big conflict with other work going in
> drm-intel-next since the bulk of the rename is there.
>
> I tried to figure out acks and reviews from v1 and apply them to how the
> patches are now split.
>
> thanks
> Lucas De Marchi
>
> Lucas De Marchi (11):
>   lib/string_helpers: Consolidate string helpers implementation
>   drm/i915: Fix trailing semicolon
>   drm/i915: Use str_yes_no()
>   drm/i915: Use str_enable_disable()
>   drm/i915: Use str_enabled_disabled()
>   drm/i915: Use str_on_off()
>   drm/amd/display: Use str_yes_no()
>   drm/gem: Sort includes alphabetically
>   drm: Convert open-coded yes/no strings to yesno()
>   tomoyo: Use str_yes_no()
>   cxgb4: Use str_yes_no()
>
>  drivers/gpu/drm/amd/amdgpu/atom.c             |   4 +-
>  .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c |  14 +-
>  drivers/gpu/drm/dp/drm_dp.c                   |   3 +-
>  drivers/gpu/drm/drm_client_modeset.c          |   3 +-
>  drivers/gpu/drm/drm_gem.c                     |  23 +-
>  drivers/gpu/drm/i915/display/g4x_dp.c         |   6 +-
>  .../gpu/drm/i915/display/intel_backlight.c    |   3 +-
>  drivers/gpu/drm/i915/display/intel_ddi.c      |   4 +-
>  drivers/gpu/drm/i915/display/intel_display.c  |  46 ++--
>  .../drm/i915/display/intel_display_debugfs.c  |  74 +++---
>  .../drm/i915/display/intel_display_power.c    |   4 +-
>  .../drm/i915/display/intel_display_trace.h    |   9 +-
>  drivers/gpu/drm/i915/display/intel_dp.c       |  20 +-
>  drivers/gpu/drm/i915/display/intel_dpll.c     |   3 +-
>  drivers/gpu/drm/i915/display/intel_dpll_mgr.c |   7 +-
>  drivers/gpu/drm/i915/display/intel_dsi_vbt.c  |   7 +-
>  drivers/gpu/drm/i915/display/intel_fbc.c      |   4 +-
>  drivers/gpu/drm/i915/display/intel_fdi.c      |   8 +-
>  drivers/gpu/drm/i915/display/intel_hdmi.c     |   3 +-
>  drivers/gpu/drm/i915/display/intel_sprite.c   |   6 +-
>  drivers/gpu/drm/i915/display/vlv_dsi_pll.c    |   3 +-
>  .../gpu/drm/i915/gem/selftests/huge_pages.c   |   9 +-
>  .../drm/i915/gem/selftests/i915_gem_context.c |   7 +-
>  drivers/gpu/drm/i915/gt/intel_breadcrumbs.c   |   3 +-
>  drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  11 +-
>  .../drm/i915/gt/intel_execlists_submission.c  |   7 +-
>  drivers/gpu/drm/i915/gt/intel_gt_pm.c         |   3 +-
>  drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c |  52 ++--
>  drivers/gpu/drm/i915/gt/intel_rc6.c           |   5 +-
>  drivers/gpu/drm/i915/gt/intel_reset.c         |   3 +-
>  drivers/gpu/drm/i915/gt/intel_rps.c           |  13 +-
>  drivers/gpu/drm/i915/gt/intel_sseu.c          |   9 +-
>  drivers/gpu/drm/i915/gt/intel_sseu_debugfs.c  |  10 +-
>  drivers/gpu/drm/i915/gt/selftest_timeline.c   |   3 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |   5 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_log.c    |   5 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_rc.c     |   6 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c   |   4 +-
>  drivers/gpu/drm/i915/gt/uc/intel_uc.c         |  14 +-
>  drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c |  20 +-
>  drivers/gpu/drm/i915/i915_debugfs.c           |  17 +-
>  drivers/gpu/drm/i915/i915_driver.c            |   4 +-
>  drivers/gpu/drm/i915/i915_gpu_error.c         |   9 +-
>  drivers/gpu/drm/i915/i915_params.c            |   5 +-
>  drivers/gpu/drm/i915/i915_utils.h             |  21 +-
>  drivers/gpu/drm/i915/intel_device_info.c      |   8 +-
>  drivers/gpu/drm/i915/intel_dram.c             |  10 +-
>  drivers/gpu/drm/i915/intel_pm.c               |  14 +-
>  drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c  |   4 +-
>  drivers/gpu/drm/i915/selftests/i915_active.c  |   3 +-
>  drivers/gpu/drm/i915/vlv_suspend.c            |   3 +-
>  drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c |   5 +-
>  drivers/gpu/drm/radeon/atom.c                 |   3 +-
>  drivers/gpu/drm/v3d/v3d_debugfs.c             |  11 +-
>  drivers/gpu/drm/virtio/virtgpu_debugfs.c      |   4 +-
>  .../ethernet/chelsio/cxgb4/cxgb4_debugfs.c    | 249 ++++++++++--------
>  include/linux/string_helpers.h                |  20 ++
>  security/tomoyo/audit.c                       |   2 +-
>  security/tomoyo/common.c                      |  19 +-
>  security/tomoyo/common.h                      |   1 -
>  60 files changed, 482 insertions(+), 373 deletions(-)
>
> --
> 2.34.1
>


-- 
With Best Regards,
Andy Shevchenko

WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: "Emma Anholt" <emma@anholt.net>,
	"David Airlie" <airlied@linux.ie>,
	nouveau@lists.freedesktop.org,
	"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
	"Rasmus Villemoes" <linux@rasmusvillemoes.dk>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"Chris Wilson" <chris@chris-wilson.co.uk>,
	"Vishal Kulkarni" <vishal@chelsio.com>,
	"Francis Laniel" <laniel_francis@privacyrequired.com>,
	"Kentaro Takeda" <takedakn@nttdata.co.jp>,
	amd-gfx@lists.freedesktop.org, "Ben Skeggs" <bskeggs@redhat.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Harry Wentland" <harry.wentland@amd.com>,
	"Petr Mladek" <pmladek@suse.com>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Leo Li" <sunpeng.li@amd.com>,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	"Raju Rangoju" <rajur@chelsio.com>,
	"Jani Nikula" <jani.nikula@linux.intel.com>,
	"Julia Lawall" <julia.lawall@lip6.fr>,
	"Rahul Lakkireddy" <rahul.lakkireddy@chelsio.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Christian König" <christian.koenig@amd.com>,
	"Sergey Senozhatsky" <sergey.senozhatsky@gmail.com>,
	linux-security-module <linux-security-module@vger.kernel.org>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	netdev <netdev@vger.kernel.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [Nouveau] [PATCH v2 00/11] lib/string_helpers: Add a few string helpers
Date: Wed, 26 Jan 2022 12:22:46 +0200	[thread overview]
Message-ID: <CAHp75VcheiM7gNW+zP2Ve8qOj40158aOM0OkhUjyODd+V3sYjQ@mail.gmail.com> (raw)
In-Reply-To: <20220126093951.1470898-1-lucas.demarchi@intel.com>

On Wed, Jan 26, 2022 at 11:39 AM Lucas De Marchi
<lucas.demarchi@intel.com> wrote:
>
> Add some helpers under lib/string_helpers.h so they can be used
> throughout the kernel. When I started doing this there were 2 other
> previous attempts I know of, not counting the iterations each of them
> had:
>
> 1) https://lore.kernel.org/all/20191023131308.9420-1-jani.nikula@intel.com/
> 2) https://lore.kernel.org/all/20210215142137.64476-1-andriy.shevchenko@linux.intel.com/#t
>
> Now there is also the v1 of this same patch series:
> https://lore.kernel.org/all/20220119072450.2890107-1-lucas.demarchi@intel.com/
>
> Going through the comments I tried to find some common ground and
> justification for what is in here, addressing some of the concerns
> raised.
>
> a. This version should be a drop-in replacement for what is currently in
>    the tree, with no change in behavior or binary size. For binary
>    size what I checked was that the linked objects in the end have the
>    same size (gcc 11). From comments in the previous attempts this seems
>    also the case for earlier compiler versions
>
> b. I didn't change the function name to choice_* as suggested by Andrew
>    Morton in 20191023155619.43e0013f0c8c673a5c508c1e@linux-foundation.org
>    because other people argumented in favor of shorter names for these
>    simple helpers - if they are long and people simply not use due to
>    that, we failed. However as pointed out in v1 of this patchseries,
>    onoff(), yesno(), enabledisable(), enableddisabled() have some
>    issues: the last 2 are hard to read and for the first 2 it would not
>    be hard to have the symbol to clash with variable names.
>    From comments in v1, most people were in favor (or at least not
>    opposed) to using str_on_off(), str_yes_no(), str_enable_disable()
>    and str_enabled_disabled().
>
> c. Use string_helper.h for these helpers - pulling string.h in the
>    compilations units was one of the concerns and I think re-using this
>    already existing header is better than creating a new string-choice.h
>
> d. One alternative to all of this suggested by Christian König
>    (43456ba7-c372-84cc-4949-dcb817188e21@amd.com) would be to add a
>    printk format. But besides the comment, he also seemed to like
>    the common function. This brought the argument from others that the
>    simple yesno()/enabledisable() already used in the code (or new
>    renamed version) is easier to remember and use than e.g. %py[DOY]

I do not see any impediments to this series to be pulled.
Thanks for the work you've done!

> Changes in v2:
>
>   - Use str_ prefix and separate other words with underscore: it's a
>     little bit longer, but should improve readability
>
>   - Patches we re-split due to the rename: first patch adds all the new
>     functions, then additional patches try to do one conversion at a
>     time. While doing so, there were some fixes for issues already
>     present along the way
>
>   - Style suggestions from v1 were adopted
>
> In v1 it was suggested to apply this in drm-misc. I will leave this to
> maintainers to decide: maybe it would be simpler to merge the first
> patches on drm-intel-next, wait for the back merge and merge the rest
> through drm-misc - my fear is a big conflict with other work going in
> drm-intel-next since the bulk of the rename is there.
>
> I tried to figure out acks and reviews from v1 and apply them to how the
> patches are now split.
>
> thanks
> Lucas De Marchi
>
> Lucas De Marchi (11):
>   lib/string_helpers: Consolidate string helpers implementation
>   drm/i915: Fix trailing semicolon
>   drm/i915: Use str_yes_no()
>   drm/i915: Use str_enable_disable()
>   drm/i915: Use str_enabled_disabled()
>   drm/i915: Use str_on_off()
>   drm/amd/display: Use str_yes_no()
>   drm/gem: Sort includes alphabetically
>   drm: Convert open-coded yes/no strings to yesno()
>   tomoyo: Use str_yes_no()
>   cxgb4: Use str_yes_no()
>
>  drivers/gpu/drm/amd/amdgpu/atom.c             |   4 +-
>  .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c |  14 +-
>  drivers/gpu/drm/dp/drm_dp.c                   |   3 +-
>  drivers/gpu/drm/drm_client_modeset.c          |   3 +-
>  drivers/gpu/drm/drm_gem.c                     |  23 +-
>  drivers/gpu/drm/i915/display/g4x_dp.c         |   6 +-
>  .../gpu/drm/i915/display/intel_backlight.c    |   3 +-
>  drivers/gpu/drm/i915/display/intel_ddi.c      |   4 +-
>  drivers/gpu/drm/i915/display/intel_display.c  |  46 ++--
>  .../drm/i915/display/intel_display_debugfs.c  |  74 +++---
>  .../drm/i915/display/intel_display_power.c    |   4 +-
>  .../drm/i915/display/intel_display_trace.h    |   9 +-
>  drivers/gpu/drm/i915/display/intel_dp.c       |  20 +-
>  drivers/gpu/drm/i915/display/intel_dpll.c     |   3 +-
>  drivers/gpu/drm/i915/display/intel_dpll_mgr.c |   7 +-
>  drivers/gpu/drm/i915/display/intel_dsi_vbt.c  |   7 +-
>  drivers/gpu/drm/i915/display/intel_fbc.c      |   4 +-
>  drivers/gpu/drm/i915/display/intel_fdi.c      |   8 +-
>  drivers/gpu/drm/i915/display/intel_hdmi.c     |   3 +-
>  drivers/gpu/drm/i915/display/intel_sprite.c   |   6 +-
>  drivers/gpu/drm/i915/display/vlv_dsi_pll.c    |   3 +-
>  .../gpu/drm/i915/gem/selftests/huge_pages.c   |   9 +-
>  .../drm/i915/gem/selftests/i915_gem_context.c |   7 +-
>  drivers/gpu/drm/i915/gt/intel_breadcrumbs.c   |   3 +-
>  drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  11 +-
>  .../drm/i915/gt/intel_execlists_submission.c  |   7 +-
>  drivers/gpu/drm/i915/gt/intel_gt_pm.c         |   3 +-
>  drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c |  52 ++--
>  drivers/gpu/drm/i915/gt/intel_rc6.c           |   5 +-
>  drivers/gpu/drm/i915/gt/intel_reset.c         |   3 +-
>  drivers/gpu/drm/i915/gt/intel_rps.c           |  13 +-
>  drivers/gpu/drm/i915/gt/intel_sseu.c          |   9 +-
>  drivers/gpu/drm/i915/gt/intel_sseu_debugfs.c  |  10 +-
>  drivers/gpu/drm/i915/gt/selftest_timeline.c   |   3 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |   5 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_log.c    |   5 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_rc.c     |   6 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c   |   4 +-
>  drivers/gpu/drm/i915/gt/uc/intel_uc.c         |  14 +-
>  drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c |  20 +-
>  drivers/gpu/drm/i915/i915_debugfs.c           |  17 +-
>  drivers/gpu/drm/i915/i915_driver.c            |   4 +-
>  drivers/gpu/drm/i915/i915_gpu_error.c         |   9 +-
>  drivers/gpu/drm/i915/i915_params.c            |   5 +-
>  drivers/gpu/drm/i915/i915_utils.h             |  21 +-
>  drivers/gpu/drm/i915/intel_device_info.c      |   8 +-
>  drivers/gpu/drm/i915/intel_dram.c             |  10 +-
>  drivers/gpu/drm/i915/intel_pm.c               |  14 +-
>  drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c  |   4 +-
>  drivers/gpu/drm/i915/selftests/i915_active.c  |   3 +-
>  drivers/gpu/drm/i915/vlv_suspend.c            |   3 +-
>  drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c |   5 +-
>  drivers/gpu/drm/radeon/atom.c                 |   3 +-
>  drivers/gpu/drm/v3d/v3d_debugfs.c             |  11 +-
>  drivers/gpu/drm/virtio/virtgpu_debugfs.c      |   4 +-
>  .../ethernet/chelsio/cxgb4/cxgb4_debugfs.c    | 249 ++++++++++--------
>  include/linux/string_helpers.h                |  20 ++
>  security/tomoyo/audit.c                       |   2 +-
>  security/tomoyo/common.c                      |  19 +-
>  security/tomoyo/common.h                      |   1 -
>  60 files changed, 482 insertions(+), 373 deletions(-)
>
> --
> 2.34.1
>


-- 
With Best Regards,
Andy Shevchenko

WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: "Emma Anholt" <emma@anholt.net>,
	"David Airlie" <airlied@linux.ie>,
	nouveau@lists.freedesktop.org,
	"Rasmus Villemoes" <linux@rasmusvillemoes.dk>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"Chris Wilson" <chris@chris-wilson.co.uk>,
	"Vishal Kulkarni" <vishal@chelsio.com>,
	"Francis Laniel" <laniel_francis@privacyrequired.com>,
	"Kentaro Takeda" <takedakn@nttdata.co.jp>,
	amd-gfx@lists.freedesktop.org, "Ben Skeggs" <bskeggs@redhat.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Petr Mladek" <pmladek@suse.com>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Leo Li" <sunpeng.li@amd.com>,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	"Raju Rangoju" <rajur@chelsio.com>,
	"Julia Lawall" <julia.lawall@lip6.fr>,
	"Rahul Lakkireddy" <rahul.lakkireddy@chelsio.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Christian König" <christian.koenig@amd.com>,
	"Sergey Senozhatsky" <sergey.senozhatsky@gmail.com>,
	linux-security-module <linux-security-module@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH v2 00/11] lib/string_helpers: Add a few string helpers
Date: Wed, 26 Jan 2022 12:22:46 +0200	[thread overview]
Message-ID: <CAHp75VcheiM7gNW+zP2Ve8qOj40158aOM0OkhUjyODd+V3sYjQ@mail.gmail.com> (raw)
In-Reply-To: <20220126093951.1470898-1-lucas.demarchi@intel.com>

On Wed, Jan 26, 2022 at 11:39 AM Lucas De Marchi
<lucas.demarchi@intel.com> wrote:
>
> Add some helpers under lib/string_helpers.h so they can be used
> throughout the kernel. When I started doing this there were 2 other
> previous attempts I know of, not counting the iterations each of them
> had:
>
> 1) https://lore.kernel.org/all/20191023131308.9420-1-jani.nikula@intel.com/
> 2) https://lore.kernel.org/all/20210215142137.64476-1-andriy.shevchenko@linux.intel.com/#t
>
> Now there is also the v1 of this same patch series:
> https://lore.kernel.org/all/20220119072450.2890107-1-lucas.demarchi@intel.com/
>
> Going through the comments I tried to find some common ground and
> justification for what is in here, addressing some of the concerns
> raised.
>
> a. This version should be a drop-in replacement for what is currently in
>    the tree, with no change in behavior or binary size. For binary
>    size what I checked was that the linked objects in the end have the
>    same size (gcc 11). From comments in the previous attempts this seems
>    also the case for earlier compiler versions
>
> b. I didn't change the function name to choice_* as suggested by Andrew
>    Morton in 20191023155619.43e0013f0c8c673a5c508c1e@linux-foundation.org
>    because other people argumented in favor of shorter names for these
>    simple helpers - if they are long and people simply not use due to
>    that, we failed. However as pointed out in v1 of this patchseries,
>    onoff(), yesno(), enabledisable(), enableddisabled() have some
>    issues: the last 2 are hard to read and for the first 2 it would not
>    be hard to have the symbol to clash with variable names.
>    From comments in v1, most people were in favor (or at least not
>    opposed) to using str_on_off(), str_yes_no(), str_enable_disable()
>    and str_enabled_disabled().
>
> c. Use string_helper.h for these helpers - pulling string.h in the
>    compilations units was one of the concerns and I think re-using this
>    already existing header is better than creating a new string-choice.h
>
> d. One alternative to all of this suggested by Christian König
>    (43456ba7-c372-84cc-4949-dcb817188e21@amd.com) would be to add a
>    printk format. But besides the comment, he also seemed to like
>    the common function. This brought the argument from others that the
>    simple yesno()/enabledisable() already used in the code (or new
>    renamed version) is easier to remember and use than e.g. %py[DOY]

I do not see any impediments to this series to be pulled.
Thanks for the work you've done!

> Changes in v2:
>
>   - Use str_ prefix and separate other words with underscore: it's a
>     little bit longer, but should improve readability
>
>   - Patches we re-split due to the rename: first patch adds all the new
>     functions, then additional patches try to do one conversion at a
>     time. While doing so, there were some fixes for issues already
>     present along the way
>
>   - Style suggestions from v1 were adopted
>
> In v1 it was suggested to apply this in drm-misc. I will leave this to
> maintainers to decide: maybe it would be simpler to merge the first
> patches on drm-intel-next, wait for the back merge and merge the rest
> through drm-misc - my fear is a big conflict with other work going in
> drm-intel-next since the bulk of the rename is there.
>
> I tried to figure out acks and reviews from v1 and apply them to how the
> patches are now split.
>
> thanks
> Lucas De Marchi
>
> Lucas De Marchi (11):
>   lib/string_helpers: Consolidate string helpers implementation
>   drm/i915: Fix trailing semicolon
>   drm/i915: Use str_yes_no()
>   drm/i915: Use str_enable_disable()
>   drm/i915: Use str_enabled_disabled()
>   drm/i915: Use str_on_off()
>   drm/amd/display: Use str_yes_no()
>   drm/gem: Sort includes alphabetically
>   drm: Convert open-coded yes/no strings to yesno()
>   tomoyo: Use str_yes_no()
>   cxgb4: Use str_yes_no()
>
>  drivers/gpu/drm/amd/amdgpu/atom.c             |   4 +-
>  .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c |  14 +-
>  drivers/gpu/drm/dp/drm_dp.c                   |   3 +-
>  drivers/gpu/drm/drm_client_modeset.c          |   3 +-
>  drivers/gpu/drm/drm_gem.c                     |  23 +-
>  drivers/gpu/drm/i915/display/g4x_dp.c         |   6 +-
>  .../gpu/drm/i915/display/intel_backlight.c    |   3 +-
>  drivers/gpu/drm/i915/display/intel_ddi.c      |   4 +-
>  drivers/gpu/drm/i915/display/intel_display.c  |  46 ++--
>  .../drm/i915/display/intel_display_debugfs.c  |  74 +++---
>  .../drm/i915/display/intel_display_power.c    |   4 +-
>  .../drm/i915/display/intel_display_trace.h    |   9 +-
>  drivers/gpu/drm/i915/display/intel_dp.c       |  20 +-
>  drivers/gpu/drm/i915/display/intel_dpll.c     |   3 +-
>  drivers/gpu/drm/i915/display/intel_dpll_mgr.c |   7 +-
>  drivers/gpu/drm/i915/display/intel_dsi_vbt.c  |   7 +-
>  drivers/gpu/drm/i915/display/intel_fbc.c      |   4 +-
>  drivers/gpu/drm/i915/display/intel_fdi.c      |   8 +-
>  drivers/gpu/drm/i915/display/intel_hdmi.c     |   3 +-
>  drivers/gpu/drm/i915/display/intel_sprite.c   |   6 +-
>  drivers/gpu/drm/i915/display/vlv_dsi_pll.c    |   3 +-
>  .../gpu/drm/i915/gem/selftests/huge_pages.c   |   9 +-
>  .../drm/i915/gem/selftests/i915_gem_context.c |   7 +-
>  drivers/gpu/drm/i915/gt/intel_breadcrumbs.c   |   3 +-
>  drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  11 +-
>  .../drm/i915/gt/intel_execlists_submission.c  |   7 +-
>  drivers/gpu/drm/i915/gt/intel_gt_pm.c         |   3 +-
>  drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c |  52 ++--
>  drivers/gpu/drm/i915/gt/intel_rc6.c           |   5 +-
>  drivers/gpu/drm/i915/gt/intel_reset.c         |   3 +-
>  drivers/gpu/drm/i915/gt/intel_rps.c           |  13 +-
>  drivers/gpu/drm/i915/gt/intel_sseu.c          |   9 +-
>  drivers/gpu/drm/i915/gt/intel_sseu_debugfs.c  |  10 +-
>  drivers/gpu/drm/i915/gt/selftest_timeline.c   |   3 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |   5 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_log.c    |   5 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_rc.c     |   6 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c   |   4 +-
>  drivers/gpu/drm/i915/gt/uc/intel_uc.c         |  14 +-
>  drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c |  20 +-
>  drivers/gpu/drm/i915/i915_debugfs.c           |  17 +-
>  drivers/gpu/drm/i915/i915_driver.c            |   4 +-
>  drivers/gpu/drm/i915/i915_gpu_error.c         |   9 +-
>  drivers/gpu/drm/i915/i915_params.c            |   5 +-
>  drivers/gpu/drm/i915/i915_utils.h             |  21 +-
>  drivers/gpu/drm/i915/intel_device_info.c      |   8 +-
>  drivers/gpu/drm/i915/intel_dram.c             |  10 +-
>  drivers/gpu/drm/i915/intel_pm.c               |  14 +-
>  drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c  |   4 +-
>  drivers/gpu/drm/i915/selftests/i915_active.c  |   3 +-
>  drivers/gpu/drm/i915/vlv_suspend.c            |   3 +-
>  drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c |   5 +-
>  drivers/gpu/drm/radeon/atom.c                 |   3 +-
>  drivers/gpu/drm/v3d/v3d_debugfs.c             |  11 +-
>  drivers/gpu/drm/virtio/virtgpu_debugfs.c      |   4 +-
>  .../ethernet/chelsio/cxgb4/cxgb4_debugfs.c    | 249 ++++++++++--------
>  include/linux/string_helpers.h                |  20 ++
>  security/tomoyo/audit.c                       |   2 +-
>  security/tomoyo/common.c                      |  19 +-
>  security/tomoyo/common.h                      |   1 -
>  60 files changed, 482 insertions(+), 373 deletions(-)
>
> --
> 2.34.1
>


-- 
With Best Regards,
Andy Shevchenko

WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: "Emma Anholt" <emma@anholt.net>,
	"David Airlie" <airlied@linux.ie>,
	nouveau@lists.freedesktop.org,
	"Rasmus Villemoes" <linux@rasmusvillemoes.dk>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"Chris Wilson" <chris@chris-wilson.co.uk>,
	"Vishal Kulkarni" <vishal@chelsio.com>,
	"Francis Laniel" <laniel_francis@privacyrequired.com>,
	"Kentaro Takeda" <takedakn@nttdata.co.jp>,
	amd-gfx@lists.freedesktop.org, "Ben Skeggs" <bskeggs@redhat.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Harry Wentland" <harry.wentland@amd.com>,
	"Petr Mladek" <pmladek@suse.com>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Leo Li" <sunpeng.li@amd.com>,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	"Raju Rangoju" <rajur@chelsio.com>,
	"Julia Lawall" <julia.lawall@lip6.fr>,
	"Rahul Lakkireddy" <rahul.lakkireddy@chelsio.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Christian König" <christian.koenig@amd.com>,
	"Sergey Senozhatsky" <sergey.senozhatsky@gmail.com>,
	linux-security-module <linux-security-module@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [Intel-gfx] [PATCH v2 00/11] lib/string_helpers: Add a few string helpers
Date: Wed, 26 Jan 2022 12:22:46 +0200	[thread overview]
Message-ID: <CAHp75VcheiM7gNW+zP2Ve8qOj40158aOM0OkhUjyODd+V3sYjQ@mail.gmail.com> (raw)
In-Reply-To: <20220126093951.1470898-1-lucas.demarchi@intel.com>

On Wed, Jan 26, 2022 at 11:39 AM Lucas De Marchi
<lucas.demarchi@intel.com> wrote:
>
> Add some helpers under lib/string_helpers.h so they can be used
> throughout the kernel. When I started doing this there were 2 other
> previous attempts I know of, not counting the iterations each of them
> had:
>
> 1) https://lore.kernel.org/all/20191023131308.9420-1-jani.nikula@intel.com/
> 2) https://lore.kernel.org/all/20210215142137.64476-1-andriy.shevchenko@linux.intel.com/#t
>
> Now there is also the v1 of this same patch series:
> https://lore.kernel.org/all/20220119072450.2890107-1-lucas.demarchi@intel.com/
>
> Going through the comments I tried to find some common ground and
> justification for what is in here, addressing some of the concerns
> raised.
>
> a. This version should be a drop-in replacement for what is currently in
>    the tree, with no change in behavior or binary size. For binary
>    size what I checked was that the linked objects in the end have the
>    same size (gcc 11). From comments in the previous attempts this seems
>    also the case for earlier compiler versions
>
> b. I didn't change the function name to choice_* as suggested by Andrew
>    Morton in 20191023155619.43e0013f0c8c673a5c508c1e@linux-foundation.org
>    because other people argumented in favor of shorter names for these
>    simple helpers - if they are long and people simply not use due to
>    that, we failed. However as pointed out in v1 of this patchseries,
>    onoff(), yesno(), enabledisable(), enableddisabled() have some
>    issues: the last 2 are hard to read and for the first 2 it would not
>    be hard to have the symbol to clash with variable names.
>    From comments in v1, most people were in favor (or at least not
>    opposed) to using str_on_off(), str_yes_no(), str_enable_disable()
>    and str_enabled_disabled().
>
> c. Use string_helper.h for these helpers - pulling string.h in the
>    compilations units was one of the concerns and I think re-using this
>    already existing header is better than creating a new string-choice.h
>
> d. One alternative to all of this suggested by Christian König
>    (43456ba7-c372-84cc-4949-dcb817188e21@amd.com) would be to add a
>    printk format. But besides the comment, he also seemed to like
>    the common function. This brought the argument from others that the
>    simple yesno()/enabledisable() already used in the code (or new
>    renamed version) is easier to remember and use than e.g. %py[DOY]

I do not see any impediments to this series to be pulled.
Thanks for the work you've done!

> Changes in v2:
>
>   - Use str_ prefix and separate other words with underscore: it's a
>     little bit longer, but should improve readability
>
>   - Patches we re-split due to the rename: first patch adds all the new
>     functions, then additional patches try to do one conversion at a
>     time. While doing so, there were some fixes for issues already
>     present along the way
>
>   - Style suggestions from v1 were adopted
>
> In v1 it was suggested to apply this in drm-misc. I will leave this to
> maintainers to decide: maybe it would be simpler to merge the first
> patches on drm-intel-next, wait for the back merge and merge the rest
> through drm-misc - my fear is a big conflict with other work going in
> drm-intel-next since the bulk of the rename is there.
>
> I tried to figure out acks and reviews from v1 and apply them to how the
> patches are now split.
>
> thanks
> Lucas De Marchi
>
> Lucas De Marchi (11):
>   lib/string_helpers: Consolidate string helpers implementation
>   drm/i915: Fix trailing semicolon
>   drm/i915: Use str_yes_no()
>   drm/i915: Use str_enable_disable()
>   drm/i915: Use str_enabled_disabled()
>   drm/i915: Use str_on_off()
>   drm/amd/display: Use str_yes_no()
>   drm/gem: Sort includes alphabetically
>   drm: Convert open-coded yes/no strings to yesno()
>   tomoyo: Use str_yes_no()
>   cxgb4: Use str_yes_no()
>
>  drivers/gpu/drm/amd/amdgpu/atom.c             |   4 +-
>  .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c |  14 +-
>  drivers/gpu/drm/dp/drm_dp.c                   |   3 +-
>  drivers/gpu/drm/drm_client_modeset.c          |   3 +-
>  drivers/gpu/drm/drm_gem.c                     |  23 +-
>  drivers/gpu/drm/i915/display/g4x_dp.c         |   6 +-
>  .../gpu/drm/i915/display/intel_backlight.c    |   3 +-
>  drivers/gpu/drm/i915/display/intel_ddi.c      |   4 +-
>  drivers/gpu/drm/i915/display/intel_display.c  |  46 ++--
>  .../drm/i915/display/intel_display_debugfs.c  |  74 +++---
>  .../drm/i915/display/intel_display_power.c    |   4 +-
>  .../drm/i915/display/intel_display_trace.h    |   9 +-
>  drivers/gpu/drm/i915/display/intel_dp.c       |  20 +-
>  drivers/gpu/drm/i915/display/intel_dpll.c     |   3 +-
>  drivers/gpu/drm/i915/display/intel_dpll_mgr.c |   7 +-
>  drivers/gpu/drm/i915/display/intel_dsi_vbt.c  |   7 +-
>  drivers/gpu/drm/i915/display/intel_fbc.c      |   4 +-
>  drivers/gpu/drm/i915/display/intel_fdi.c      |   8 +-
>  drivers/gpu/drm/i915/display/intel_hdmi.c     |   3 +-
>  drivers/gpu/drm/i915/display/intel_sprite.c   |   6 +-
>  drivers/gpu/drm/i915/display/vlv_dsi_pll.c    |   3 +-
>  .../gpu/drm/i915/gem/selftests/huge_pages.c   |   9 +-
>  .../drm/i915/gem/selftests/i915_gem_context.c |   7 +-
>  drivers/gpu/drm/i915/gt/intel_breadcrumbs.c   |   3 +-
>  drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  11 +-
>  .../drm/i915/gt/intel_execlists_submission.c  |   7 +-
>  drivers/gpu/drm/i915/gt/intel_gt_pm.c         |   3 +-
>  drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c |  52 ++--
>  drivers/gpu/drm/i915/gt/intel_rc6.c           |   5 +-
>  drivers/gpu/drm/i915/gt/intel_reset.c         |   3 +-
>  drivers/gpu/drm/i915/gt/intel_rps.c           |  13 +-
>  drivers/gpu/drm/i915/gt/intel_sseu.c          |   9 +-
>  drivers/gpu/drm/i915/gt/intel_sseu_debugfs.c  |  10 +-
>  drivers/gpu/drm/i915/gt/selftest_timeline.c   |   3 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |   5 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_log.c    |   5 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_rc.c     |   6 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c   |   4 +-
>  drivers/gpu/drm/i915/gt/uc/intel_uc.c         |  14 +-
>  drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c |  20 +-
>  drivers/gpu/drm/i915/i915_debugfs.c           |  17 +-
>  drivers/gpu/drm/i915/i915_driver.c            |   4 +-
>  drivers/gpu/drm/i915/i915_gpu_error.c         |   9 +-
>  drivers/gpu/drm/i915/i915_params.c            |   5 +-
>  drivers/gpu/drm/i915/i915_utils.h             |  21 +-
>  drivers/gpu/drm/i915/intel_device_info.c      |   8 +-
>  drivers/gpu/drm/i915/intel_dram.c             |  10 +-
>  drivers/gpu/drm/i915/intel_pm.c               |  14 +-
>  drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c  |   4 +-
>  drivers/gpu/drm/i915/selftests/i915_active.c  |   3 +-
>  drivers/gpu/drm/i915/vlv_suspend.c            |   3 +-
>  drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c |   5 +-
>  drivers/gpu/drm/radeon/atom.c                 |   3 +-
>  drivers/gpu/drm/v3d/v3d_debugfs.c             |  11 +-
>  drivers/gpu/drm/virtio/virtgpu_debugfs.c      |   4 +-
>  .../ethernet/chelsio/cxgb4/cxgb4_debugfs.c    | 249 ++++++++++--------
>  include/linux/string_helpers.h                |  20 ++
>  security/tomoyo/audit.c                       |   2 +-
>  security/tomoyo/common.c                      |  19 +-
>  security/tomoyo/common.h                      |   1 -
>  60 files changed, 482 insertions(+), 373 deletions(-)
>
> --
> 2.34.1
>


-- 
With Best Regards,
Andy Shevchenko

WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: "Emma Anholt" <emma@anholt.net>,
	"David Airlie" <airlied@linux.ie>,
	nouveau@lists.freedesktop.org,
	"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
	"Rasmus Villemoes" <linux@rasmusvillemoes.dk>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"Chris Wilson" <chris@chris-wilson.co.uk>,
	"Vishal Kulkarni" <vishal@chelsio.com>,
	"Francis Laniel" <laniel_francis@privacyrequired.com>,
	"Kentaro Takeda" <takedakn@nttdata.co.jp>,
	amd-gfx@lists.freedesktop.org, "Ben Skeggs" <bskeggs@redhat.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Harry Wentland" <harry.wentland@amd.com>,
	"Petr Mladek" <pmladek@suse.com>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Leo Li" <sunpeng.li@amd.com>,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	"Raju Rangoju" <rajur@chelsio.com>,
	"Jani Nikula" <jani.nikula@linux.intel.com>,
	"Julia Lawall" <julia.lawall@lip6.fr>,
	"Rahul Lakkireddy" <rahul.lakkireddy@chelsio.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Christian König" <christian.koenig@amd.com>,
	"Sergey Senozhatsky" <sergey.senozhatsky@gmail.com>,
	linux-security-module <linux-security-module@vger.kernel.org>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	netdev <netdev@vger.kernel.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH v2 00/11] lib/string_helpers: Add a few string helpers
Date: Wed, 26 Jan 2022 12:22:46 +0200	[thread overview]
Message-ID: <CAHp75VcheiM7gNW+zP2Ve8qOj40158aOM0OkhUjyODd+V3sYjQ@mail.gmail.com> (raw)
In-Reply-To: <20220126093951.1470898-1-lucas.demarchi@intel.com>

On Wed, Jan 26, 2022 at 11:39 AM Lucas De Marchi
<lucas.demarchi@intel.com> wrote:
>
> Add some helpers under lib/string_helpers.h so they can be used
> throughout the kernel. When I started doing this there were 2 other
> previous attempts I know of, not counting the iterations each of them
> had:
>
> 1) https://lore.kernel.org/all/20191023131308.9420-1-jani.nikula@intel.com/
> 2) https://lore.kernel.org/all/20210215142137.64476-1-andriy.shevchenko@linux.intel.com/#t
>
> Now there is also the v1 of this same patch series:
> https://lore.kernel.org/all/20220119072450.2890107-1-lucas.demarchi@intel.com/
>
> Going through the comments I tried to find some common ground and
> justification for what is in here, addressing some of the concerns
> raised.
>
> a. This version should be a drop-in replacement for what is currently in
>    the tree, with no change in behavior or binary size. For binary
>    size what I checked was that the linked objects in the end have the
>    same size (gcc 11). From comments in the previous attempts this seems
>    also the case for earlier compiler versions
>
> b. I didn't change the function name to choice_* as suggested by Andrew
>    Morton in 20191023155619.43e0013f0c8c673a5c508c1e@linux-foundation.org
>    because other people argumented in favor of shorter names for these
>    simple helpers - if they are long and people simply not use due to
>    that, we failed. However as pointed out in v1 of this patchseries,
>    onoff(), yesno(), enabledisable(), enableddisabled() have some
>    issues: the last 2 are hard to read and for the first 2 it would not
>    be hard to have the symbol to clash with variable names.
>    From comments in v1, most people were in favor (or at least not
>    opposed) to using str_on_off(), str_yes_no(), str_enable_disable()
>    and str_enabled_disabled().
>
> c. Use string_helper.h for these helpers - pulling string.h in the
>    compilations units was one of the concerns and I think re-using this
>    already existing header is better than creating a new string-choice.h
>
> d. One alternative to all of this suggested by Christian König
>    (43456ba7-c372-84cc-4949-dcb817188e21@amd.com) would be to add a
>    printk format. But besides the comment, he also seemed to like
>    the common function. This brought the argument from others that the
>    simple yesno()/enabledisable() already used in the code (or new
>    renamed version) is easier to remember and use than e.g. %py[DOY]

I do not see any impediments to this series to be pulled.
Thanks for the work you've done!

> Changes in v2:
>
>   - Use str_ prefix and separate other words with underscore: it's a
>     little bit longer, but should improve readability
>
>   - Patches we re-split due to the rename: first patch adds all the new
>     functions, then additional patches try to do one conversion at a
>     time. While doing so, there were some fixes for issues already
>     present along the way
>
>   - Style suggestions from v1 were adopted
>
> In v1 it was suggested to apply this in drm-misc. I will leave this to
> maintainers to decide: maybe it would be simpler to merge the first
> patches on drm-intel-next, wait for the back merge and merge the rest
> through drm-misc - my fear is a big conflict with other work going in
> drm-intel-next since the bulk of the rename is there.
>
> I tried to figure out acks and reviews from v1 and apply them to how the
> patches are now split.
>
> thanks
> Lucas De Marchi
>
> Lucas De Marchi (11):
>   lib/string_helpers: Consolidate string helpers implementation
>   drm/i915: Fix trailing semicolon
>   drm/i915: Use str_yes_no()
>   drm/i915: Use str_enable_disable()
>   drm/i915: Use str_enabled_disabled()
>   drm/i915: Use str_on_off()
>   drm/amd/display: Use str_yes_no()
>   drm/gem: Sort includes alphabetically
>   drm: Convert open-coded yes/no strings to yesno()
>   tomoyo: Use str_yes_no()
>   cxgb4: Use str_yes_no()
>
>  drivers/gpu/drm/amd/amdgpu/atom.c             |   4 +-
>  .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c |  14 +-
>  drivers/gpu/drm/dp/drm_dp.c                   |   3 +-
>  drivers/gpu/drm/drm_client_modeset.c          |   3 +-
>  drivers/gpu/drm/drm_gem.c                     |  23 +-
>  drivers/gpu/drm/i915/display/g4x_dp.c         |   6 +-
>  .../gpu/drm/i915/display/intel_backlight.c    |   3 +-
>  drivers/gpu/drm/i915/display/intel_ddi.c      |   4 +-
>  drivers/gpu/drm/i915/display/intel_display.c  |  46 ++--
>  .../drm/i915/display/intel_display_debugfs.c  |  74 +++---
>  .../drm/i915/display/intel_display_power.c    |   4 +-
>  .../drm/i915/display/intel_display_trace.h    |   9 +-
>  drivers/gpu/drm/i915/display/intel_dp.c       |  20 +-
>  drivers/gpu/drm/i915/display/intel_dpll.c     |   3 +-
>  drivers/gpu/drm/i915/display/intel_dpll_mgr.c |   7 +-
>  drivers/gpu/drm/i915/display/intel_dsi_vbt.c  |   7 +-
>  drivers/gpu/drm/i915/display/intel_fbc.c      |   4 +-
>  drivers/gpu/drm/i915/display/intel_fdi.c      |   8 +-
>  drivers/gpu/drm/i915/display/intel_hdmi.c     |   3 +-
>  drivers/gpu/drm/i915/display/intel_sprite.c   |   6 +-
>  drivers/gpu/drm/i915/display/vlv_dsi_pll.c    |   3 +-
>  .../gpu/drm/i915/gem/selftests/huge_pages.c   |   9 +-
>  .../drm/i915/gem/selftests/i915_gem_context.c |   7 +-
>  drivers/gpu/drm/i915/gt/intel_breadcrumbs.c   |   3 +-
>  drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  11 +-
>  .../drm/i915/gt/intel_execlists_submission.c  |   7 +-
>  drivers/gpu/drm/i915/gt/intel_gt_pm.c         |   3 +-
>  drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c |  52 ++--
>  drivers/gpu/drm/i915/gt/intel_rc6.c           |   5 +-
>  drivers/gpu/drm/i915/gt/intel_reset.c         |   3 +-
>  drivers/gpu/drm/i915/gt/intel_rps.c           |  13 +-
>  drivers/gpu/drm/i915/gt/intel_sseu.c          |   9 +-
>  drivers/gpu/drm/i915/gt/intel_sseu_debugfs.c  |  10 +-
>  drivers/gpu/drm/i915/gt/selftest_timeline.c   |   3 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |   5 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_log.c    |   5 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_rc.c     |   6 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c   |   4 +-
>  drivers/gpu/drm/i915/gt/uc/intel_uc.c         |  14 +-
>  drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c |  20 +-
>  drivers/gpu/drm/i915/i915_debugfs.c           |  17 +-
>  drivers/gpu/drm/i915/i915_driver.c            |   4 +-
>  drivers/gpu/drm/i915/i915_gpu_error.c         |   9 +-
>  drivers/gpu/drm/i915/i915_params.c            |   5 +-
>  drivers/gpu/drm/i915/i915_utils.h             |  21 +-
>  drivers/gpu/drm/i915/intel_device_info.c      |   8 +-
>  drivers/gpu/drm/i915/intel_dram.c             |  10 +-
>  drivers/gpu/drm/i915/intel_pm.c               |  14 +-
>  drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c  |   4 +-
>  drivers/gpu/drm/i915/selftests/i915_active.c  |   3 +-
>  drivers/gpu/drm/i915/vlv_suspend.c            |   3 +-
>  drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c |   5 +-
>  drivers/gpu/drm/radeon/atom.c                 |   3 +-
>  drivers/gpu/drm/v3d/v3d_debugfs.c             |  11 +-
>  drivers/gpu/drm/virtio/virtgpu_debugfs.c      |   4 +-
>  .../ethernet/chelsio/cxgb4/cxgb4_debugfs.c    | 249 ++++++++++--------
>  include/linux/string_helpers.h                |  20 ++
>  security/tomoyo/audit.c                       |   2 +-
>  security/tomoyo/common.c                      |  19 +-
>  security/tomoyo/common.h                      |   1 -
>  60 files changed, 482 insertions(+), 373 deletions(-)
>
> --
> 2.34.1
>


-- 
With Best Regards,
Andy Shevchenko

  parent reply	other threads:[~2022-01-26 10:23 UTC|newest]

Thread overview: 118+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26  9:39 [PATCH v2 00/11] lib/string_helpers: Add a few string helpers Lucas De Marchi
2022-01-26  9:39 ` [Nouveau] " Lucas De Marchi
2022-01-26  9:39 ` Lucas De Marchi
2022-01-26  9:39 ` [Intel-gfx] " Lucas De Marchi
2022-01-26  9:39 ` Lucas De Marchi
2022-01-26  9:39 ` [PATCH v2 01/11] lib/string_helpers: Consolidate string helpers implementation Lucas De Marchi
2022-01-26  9:39   ` [Nouveau] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-01-26  9:39   ` [Intel-gfx] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-01-26  9:39 ` [PATCH v2 02/11] drm/i915: Fix trailing semicolon Lucas De Marchi
2022-01-26  9:39   ` [Nouveau] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-01-26  9:39   ` [Intel-gfx] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-01-26 14:52   ` Jani Nikula
2022-01-26 14:52     ` Jani Nikula
2022-01-26 14:52     ` [Intel-gfx] " Jani Nikula
2022-01-26 14:52     ` Jani Nikula
2022-01-26 14:52     ` [Nouveau] " Jani Nikula
2022-01-26  9:39 ` [PATCH v2 03/11] drm/i915: Use str_yes_no() Lucas De Marchi
2022-01-26  9:39   ` [Nouveau] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-01-26  9:39   ` [Intel-gfx] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-02-01 21:25   ` [Intel-gfx] " Matt Roper
2022-02-01 21:25     ` [Nouveau] " Matt Roper
2022-02-01 21:25     ` Matt Roper
2022-02-01 21:25     ` Matt Roper
2022-01-26  9:39 ` [PATCH v2 04/11] drm/i915: Use str_enable_disable() Lucas De Marchi
2022-01-26  9:39   ` [Nouveau] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-01-26  9:39   ` [Intel-gfx] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-02-01 21:23   ` [Intel-gfx] " Matt Roper
2022-02-01 21:23     ` [Nouveau] " Matt Roper
2022-02-01 21:23     ` Matt Roper
2022-02-01 21:23     ` Matt Roper
2022-01-26  9:39 ` [PATCH v2 05/11] drm/i915: Use str_enabled_disabled() Lucas De Marchi
2022-01-26  9:39   ` [Nouveau] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-01-26  9:39   ` [Intel-gfx] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-02-01 21:21   ` [Intel-gfx] " Matt Roper
2022-02-01 21:21     ` [Nouveau] " Matt Roper
2022-02-01 21:21     ` Matt Roper
2022-02-01 21:21     ` Matt Roper
2022-01-26  9:39 ` [PATCH v2 06/11] drm/i915: Use str_on_off() Lucas De Marchi
2022-01-26  9:39   ` [Nouveau] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-01-26  9:39   ` [Intel-gfx] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-02-01 21:15   ` [Intel-gfx] " Matt Roper
2022-02-01 21:15     ` [Nouveau] " Matt Roper
2022-02-01 21:15     ` Matt Roper
2022-02-01 21:15     ` Matt Roper
2022-01-26  9:39 ` [PATCH v2 07/11] drm/amd/display: Use str_yes_no() Lucas De Marchi
2022-01-26  9:39   ` [Nouveau] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-01-26  9:39   ` [Intel-gfx] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-01-26 14:35   ` Harry Wentland
2022-01-26 14:35     ` Harry Wentland
2022-01-26 14:35     ` [Intel-gfx] " Harry Wentland
2022-01-26 14:35     ` Harry Wentland
2022-01-26 14:35     ` [Nouveau] " Harry Wentland
2022-01-26  9:39 ` [PATCH v2 08/11] drm/gem: Sort includes alphabetically Lucas De Marchi
2022-01-26  9:39   ` [Nouveau] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-01-26  9:39   ` [Intel-gfx] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-01-26 14:54   ` Jani Nikula
2022-01-26 14:54     ` Jani Nikula
2022-01-26 14:54     ` [Intel-gfx] " Jani Nikula
2022-01-26 14:54     ` Jani Nikula
2022-01-26 14:54     ` [Nouveau] " Jani Nikula
2022-01-26  9:39 ` [PATCH v2 09/11] drm: Convert open-coded yes/no strings to yesno() Lucas De Marchi
2022-01-26  9:39   ` [Nouveau] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-01-26  9:39   ` [Intel-gfx] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-01-26 10:12   ` Andy Shevchenko
2022-01-26 10:12     ` Andy Shevchenko
2022-01-26 10:12     ` [Intel-gfx] " Andy Shevchenko
2022-01-26 10:12     ` Andy Shevchenko
2022-01-26 10:12     ` [Nouveau] " Andy Shevchenko
2022-01-26 10:43     ` [Intel-gfx] " Lucas De Marchi
2022-01-26 10:43       ` [Nouveau] " Lucas De Marchi
2022-01-26 10:43       ` Lucas De Marchi
2022-01-26 10:43       ` Lucas De Marchi
2022-01-26 12:15       ` Andy Shevchenko
2022-01-26 12:15         ` Andy Shevchenko
2022-01-26 12:15         ` Andy Shevchenko
2022-01-26 12:15         ` [Nouveau] " Andy Shevchenko
2022-01-26 14:57   ` Jani Nikula
2022-01-26 14:57     ` Jani Nikula
2022-01-26 14:57     ` [Intel-gfx] " Jani Nikula
2022-01-26 14:57     ` Jani Nikula
2022-01-26 14:57     ` [Nouveau] " Jani Nikula
2022-01-26  9:39 ` [PATCH v2 10/11] tomoyo: Use str_yes_no() Lucas De Marchi
2022-01-26  9:39   ` [Nouveau] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-01-26  9:39   ` [Intel-gfx] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-01-26  9:39 ` [PATCH v2 11/11] cxgb4: " Lucas De Marchi
2022-01-26  9:39   ` [Nouveau] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-01-26  9:39   ` [Intel-gfx] " Lucas De Marchi
2022-01-26  9:39   ` Lucas De Marchi
2022-01-26 10:22 ` Andy Shevchenko [this message]
2022-01-26 10:22   ` [PATCH v2 00/11] lib/string_helpers: Add a few string helpers Andy Shevchenko
2022-01-26 10:22   ` [Intel-gfx] " Andy Shevchenko
2022-01-26 10:22   ` Andy Shevchenko
2022-01-26 10:22   ` [Nouveau] " Andy Shevchenko
2022-01-26 17:41 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for lib/string_helpers: Add a few string helpers (rev2) Patchwork
2022-01-26 17:45 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-01-26 18:12 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-01-26 23:49 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

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=CAHp75VcheiM7gNW+zP2Ve8qOj40158aOM0OkhUjyODd+V3sYjQ@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=airlied@linux.ie \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bskeggs@redhat.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=davem@davemloft.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emma@anholt.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=harry.wentland@amd.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=julia.lawall@lip6.fr \
    --cc=kuba@kernel.org \
    --cc=laniel_francis@privacyrequired.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=lucas.demarchi@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=pmladek@suse.com \
    --cc=rahul.lakkireddy@chelsio.com \
    --cc=rajur@chelsio.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=sunpeng.li@amd.com \
    --cc=takedakn@nttdata.co.jp \
    --cc=vishal@chelsio.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.