lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 19 Jan 2022 01:42:49 -0800
From:   Lucas De Marchi <lucas.demarchi@...el.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Emma Anholt <emma@...olt.net>, David Airlie <airlied@...ux.ie>,
        "nouveau@...ts.freedesktop.org" <nouveau@...ts.freedesktop.org>,
        Rasmus Villemoes <linux@...musvillemoes.dk>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        Chris Wilson <chris@...is-wilson.co.uk>,
        Vishal Kulkarni <vishal@...lsio.com>,
        Francis Laniel <laniel_francis@...vacyrequired.com>,
        Kentaro Takeda <takedakn@...data.co.jp>,
        Mikita Lipski <mikita.lipski@....com>,
        "amd-gfx@...ts.freedesktop.org" <amd-gfx@...ts.freedesktop.org>,
        Ben Skeggs <bskeggs@...hat.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Petr Mladek <pmladek@...e.com>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Leo Li <sunpeng.li@....com>,
        "intel-gfx@...ts.freedesktop.org" <intel-gfx@...ts.freedesktop.org>,
        Raju Rangoju <rajur@...lsio.com>,
        Julia Lawall <julia.lawall@...6.fr>,
        Rahul Lakkireddy <rahul.lakkireddy@...lsio.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Rodrigo Vivi <rodrigo.vivi@...el.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Eryk Brol <eryk.brol@....com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Christian König <christian.koenig@....com>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        "linux-security-module@...r.kernel.org" 
        <linux-security-module@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Alex Deucher <alexander.deucher@....com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        "David S . Miller" <davem@...emloft.net>
Subject: Re: [PATCH 2/3] lib/string_helpers: Add helpers for
 enable[d]/disable[d]

On Wed, Jan 19, 2022 at 11:20:38AM +0200, Andy Shevchenko wrote:
>On Wednesday, January 19, 2022, Lucas De Marchi <lucas.demarchi@...el.com>
>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 <lucas.demarchi@...el.com>
>> ---
>>  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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ