public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail•com>
To: David Laight <David.Laight@aculab•com>
Cc: "'Steven Rostedt'" <rostedt@goodmis•org>,
	"Lucas De Marchi" <lucas.demarchi@intel•com>,
	"linux-kernel@vger•kernel.org" <linux-kernel@vger•kernel.org>,
	"intel-gfx@lists•freedesktop.org"
	<intel-gfx@lists•freedesktop.org>,
	"dri-devel@lists•freedesktop.org"
	<dri-devel@lists•freedesktop.org>,
	"amd-gfx@lists•freedesktop.org" <amd-gfx@lists•freedesktop.org>,
	"linux-security-module@vger•kernel.org"
	<linux-security-module@vger•kernel.org>,
	"nouveau@lists•freedesktop.org" <nouveau@lists•freedesktop.org>,
	"netdev@vger•kernel.org" <netdev@vger•kernel.org>,
	"Alex Deucher" <alexander.deucher@amd•com>,
	"Andrew Morton" <akpm@linux-foundation•org>,
	"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>, "Eryk Brol" <eryk.brol@amd•com>,
	"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>,
	"Mikita Lipski" <mikita.lipski@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>,
	"Vishal Kulkarni" <vishal@chelsio•com>
Subject: Re: [PATCH 1/3] lib/string_helpers: Consolidate yesno() implementation
Date: Wed, 19 Jan 2022 21:22:57 +0200	[thread overview]
Message-ID: <YehlEe1prbwhxZEv@smile.fi.intel.com> (raw)
In-Reply-To: <9c26ca9bf75d494ea966059d9bcbc2b5@AcuMS.aculab.com>

On Wed, Jan 19, 2022 at 04:38:26PM +0000, David Laight wrote:
> > > > > +static inline const char *yesno(bool v) { return v ? "yes" : "no"; }
> > 
> > 	return "yes\0no" + v * 4;
> > 
> > :-)
> 
> except '"no\0\0yes" + v * 4' works a bit better.

Is it a C code obfuscation contest?

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2022-01-19 19:35 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19  7:24 [PATCH 0/3] lib/string_helpers: Add a few string helpers Lucas De Marchi
2022-01-19  7:24 ` [PATCH 1/3] lib/string_helpers: Consolidate yesno() implementation Lucas De Marchi
2022-01-19  9:18   ` Sakari Ailus
2022-01-19 15:06     ` Steven Rostedt
2022-01-19 19:25       ` Andy Shevchenko
2022-01-19 21:00         ` Steven Rostedt
2022-01-19 21:04           ` Andy Shevchenko
2022-01-21  1:37           ` Joe Perches
2022-01-19 20:43       ` [Intel-gfx] " Lucas De Marchi
     [not found]   ` <CAHp75Vf5QOD_UtDK8VbxNApEBuJvzUic0NkzDNmRo3Q7Ud+=qw@mail.gmail.com>
2022-01-19 15:01     ` Steven Rostedt
2022-01-19 16:37       ` David Laight
2022-01-19 16:38         ` David Laight
2022-01-19 19:22           ` Andy Shevchenko [this message]
2022-01-19 20:58             ` Steven Rostedt
2022-01-19 22:25             ` David Laight
2022-01-19  7:24 ` [PATCH 2/3] lib/string_helpers: Add helpers for enable[d]/disable[d] Lucas De Marchi
     [not found]   ` <CAHp75Vc4bdu1OTi2t-fHeHkmnVgd6LCdeotnGEH_+q4EGk3OmQ@mail.gmail.com>
2022-01-19  9:42     ` Lucas De Marchi
2022-01-19  7:24 ` [PATCH 3/3] drm: Convert open yes/no strings to yesno() Lucas De Marchi
2022-01-19 19:30   ` Andy Shevchenko
2022-01-26  9:05     ` Lucas De Marchi
2022-01-19  8:02 ` [PATCH 0/3] lib/string_helpers: Add a few string helpers Jani Nikula
2022-01-19 13:18 ` Petr Mladek
2022-01-19 14:16   ` Jani Nikula
2022-01-19 16:15     ` Daniel Vetter
2022-01-19 20:53       ` [Intel-gfx] " Lucas De Marchi
2022-01-19 21:07         ` Andy Shevchenko
2022-01-20  8:38     ` Petr Mladek
2022-01-20  9:12       ` David Laight
2022-01-20  9:12       ` Jani Nikula
2022-01-20 10:45         ` Petr Mladek

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=YehlEe1prbwhxZEv@smile.fi.intel.com \
    --to=andy.shevchenko@gmail$(echo .)com \
    --cc=David.Laight@aculab$(echo .)com \
    --cc=airlied@linux$(echo .)ie \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=alexander.deucher@amd$(echo .)com \
    --cc=amd-gfx@lists$(echo .)freedesktop.org \
    --cc=bskeggs@redhat$(echo .)com \
    --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=emma@anholt$(echo .)net \
    --cc=eryk.brol@amd$(echo .)com \
    --cc=gregkh@linuxfoundation$(echo .)org \
    --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=julia.lawall@lip6$(echo .)fr \
    --cc=kuba@kernel$(echo .)org \
    --cc=laniel_francis@privacyrequired$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-security-module@vger$(echo .)kernel.org \
    --cc=linux@rasmusvillemoes$(echo .)dk \
    --cc=lucas.demarchi@intel$(echo .)com \
    --cc=mikita.lipski@amd$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nouveau@lists$(echo .)freedesktop.org \
    --cc=pmladek@suse$(echo .)com \
    --cc=rahul.lakkireddy@chelsio$(echo .)com \
    --cc=rajur@chelsio$(echo .)com \
    --cc=rodrigo.vivi@intel$(echo .)com \
    --cc=rostedt@goodmis$(echo .)org \
    --cc=sakari.ailus@linux$(echo .)intel.com \
    --cc=sergey.senozhatsky@gmail$(echo .)com \
    --cc=sunpeng.li@amd$(echo .)com \
    --cc=takedakn@nttdata$(echo .)co.jp \
    --cc=vishal@chelsio$(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