From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 33484C433FE for ; Wed, 19 Jan 2022 20:18:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C47810E32C; Wed, 19 Jan 2022 20:18:41 +0000 (UTC) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4B53010F0A9; Wed, 19 Jan 2022 19:36:06 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10231"; a="305904264" X-IronPort-AV: E=Sophos;i="5.88,300,1635231600"; d="scan'208";a="305904264" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 11:24:17 -0800 X-IronPort-AV: E=Sophos;i="5.88,300,1635231600"; d="scan'208";a="532444461" Received: from smile.fi.intel.com ([10.237.72.61]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 11:24:08 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nAGXp-00CEYE-CW; Wed, 19 Jan 2022 21:22:57 +0200 Date: Wed, 19 Jan 2022 21:22:57 +0200 From: Andy Shevchenko To: David Laight Subject: Re: [PATCH 1/3] lib/string_helpers: Consolidate yesno() implementation Message-ID: References: <20220119072450.2890107-1-lucas.demarchi@intel.com> <20220119072450.2890107-2-lucas.demarchi@intel.com> <20220119100102.61f9bfde@gandalf.local.home> <06420a70f4434c2b8590cc89cad0dd6a@AcuMS.aculab.com> <9c26ca9bf75d494ea966059d9bcbc2b5@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9c26ca9bf75d494ea966059d9bcbc2b5@AcuMS.aculab.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Mailman-Approved-At: Wed, 19 Jan 2022 20:18:36 +0000 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Emma Anholt , David Airlie , "nouveau@lists.freedesktop.org" , Joonas Lahtinen , Rasmus Villemoes , "dri-devel@lists.freedesktop.org" , Chris Wilson , Vishal Kulkarni , Francis Laniel , Kentaro Takeda , "amd-gfx@lists.freedesktop.org" , Ben Skeggs , Jakub Kicinski , Harry Wentland , Petr Mladek , Sakari Ailus , Leo Li , "intel-gfx@lists.freedesktop.org" , Raju Rangoju , Lucas De Marchi , 'Steven Rostedt' , Julia Lawall , Rahul Lakkireddy , Jani Nikula , Rodrigo Vivi , Mikita Lipski , Eryk Brol , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , Christian =?iso-8859-1?Q?K=F6nig?= , Sergey Senozhatsky , "linux-security-module@vger.kernel.org" , Daniel Vetter , "netdev@vger.kernel.org" , Alex Deucher , Andrew Morton , "David S . Miller" Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" 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