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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 889E6C433EF for ; Wed, 19 Jan 2022 20:58:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245336AbiASU6f (ORCPT ); Wed, 19 Jan 2022 15:58:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245242AbiASU60 (ORCPT ); Wed, 19 Jan 2022 15:58:26 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00A3BC061574; Wed, 19 Jan 2022 12:58:25 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C0646B81B40; Wed, 19 Jan 2022 20:58:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD93AC340E1; Wed, 19 Jan 2022 20:58:19 +0000 (UTC) Date: Wed, 19 Jan 2022 15:58:18 -0500 From: Steven Rostedt To: Andy Shevchenko Cc: David Laight , Lucas De Marchi , "linux-kernel@vger.kernel.org" , "intel-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "amd-gfx@lists.freedesktop.org" , "linux-security-module@vger.kernel.org" , "nouveau@lists.freedesktop.org" , "netdev@vger.kernel.org" , Alex Deucher , Andrew Morton , Ben Skeggs , Christian =?UTF-8?B?S8O2bmln?= , Chris Wilson , Daniel Vetter , David Airlie , "David S . Miller" , Emma Anholt , Eryk Brol , Francis Laniel , Greg Kroah-Hartman , Harry Wentland , Jakub Kicinski , Jani Nikula , Joonas Lahtinen , Julia Lawall , Kentaro Takeda , Leo Li , Mikita Lipski , Petr Mladek , Rahul Lakkireddy , Raju Rangoju , Rasmus Villemoes , Rodrigo Vivi , Sakari Ailus , Sergey Senozhatsky , Vishal Kulkarni Subject: Re: [PATCH 1/3] lib/string_helpers: Consolidate yesno() implementation Message-ID: <20220119155818.7ab45e0e@gandalf.local.home> In-Reply-To: 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> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 Jan 2022 21:22:57 +0200 Andy Shevchenko wrote: > 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? > return '/'/'/'; -- Steve 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 ECFADC433F5 for ; Wed, 19 Jan 2022 20:58:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 10CCD10E201; Wed, 19 Jan 2022 20:58:30 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4619110E203; Wed, 19 Jan 2022 20:58:28 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D4040B81BFB; Wed, 19 Jan 2022 20:58:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD93AC340E1; Wed, 19 Jan 2022 20:58:19 +0000 (UTC) Date: Wed, 19 Jan 2022 15:58:18 -0500 From: Steven Rostedt To: Andy Shevchenko Message-ID: <20220119155818.7ab45e0e@gandalf.local.home> In-Reply-To: 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> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Nouveau] [PATCH 1/3] lib/string_helpers: Consolidate yesno() implementation X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list 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 , Jani Nikula , Julia Lawall , Rahul Lakkireddy , Rodrigo Vivi , Mikita Lipski , Eryk Brol , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , Christian =?UTF-8?B?S8O2bmln?= , Sergey Senozhatsky , "linux-security-module@vger.kernel.org" , David Laight , Daniel Vetter , "netdev@vger.kernel.org" , Alex Deucher , Andrew Morton , "David S . Miller" Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" On Wed, 19 Jan 2022 21:22:57 +0200 Andy Shevchenko wrote: > 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? > return '/'/'/'; -- Steve 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 3A5A8C433EF for ; Wed, 19 Jan 2022 20:58:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B35610E1E7; Wed, 19 Jan 2022 20:58:30 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4619110E203; Wed, 19 Jan 2022 20:58:28 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D4040B81BFB; Wed, 19 Jan 2022 20:58:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD93AC340E1; Wed, 19 Jan 2022 20:58:19 +0000 (UTC) Date: Wed, 19 Jan 2022 15:58:18 -0500 From: Steven Rostedt To: Andy Shevchenko Subject: Re: [PATCH 1/3] lib/string_helpers: Consolidate yesno() implementation Message-ID: <20220119155818.7ab45e0e@gandalf.local.home> In-Reply-To: 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> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Emma Anholt , David Airlie , "nouveau@lists.freedesktop.org" , Rasmus Villemoes , "dri-devel@lists.freedesktop.org" , Chris Wilson , Vishal Kulkarni , Francis Laniel , Kentaro Takeda , "amd-gfx@lists.freedesktop.org" , Ben Skeggs , Jakub Kicinski , Petr Mladek , Sakari Ailus , Leo Li , "intel-gfx@lists.freedesktop.org" , Raju Rangoju , Lucas De Marchi , Julia Lawall , Rahul Lakkireddy , Rodrigo Vivi , Mikita Lipski , Eryk Brol , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , Christian =?UTF-8?B?S8O2bmln?= , Sergey Senozhatsky , "linux-security-module@vger.kernel.org" , David Laight , "netdev@vger.kernel.org" , Alex Deucher , Andrew Morton , "David S . Miller" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed, 19 Jan 2022 21:22:57 +0200 Andy Shevchenko wrote: > 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? > return '/'/'/'; -- Steve 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 56516C433EF for ; Wed, 19 Jan 2022 20:58:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A3E7110E209; Wed, 19 Jan 2022 20:58:29 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4619110E203; Wed, 19 Jan 2022 20:58:28 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D4040B81BFB; Wed, 19 Jan 2022 20:58:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD93AC340E1; Wed, 19 Jan 2022 20:58:19 +0000 (UTC) Date: Wed, 19 Jan 2022 15:58:18 -0500 From: Steven Rostedt To: Andy Shevchenko Message-ID: <20220119155818.7ab45e0e@gandalf.local.home> In-Reply-To: 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> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Intel-gfx] [PATCH 1/3] lib/string_helpers: Consolidate yesno() implementation X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Emma Anholt , David Airlie , "nouveau@lists.freedesktop.org" , 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 , Julia Lawall , Rahul Lakkireddy , Mikita Lipski , Eryk Brol , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , Christian =?UTF-8?B?S8O2bmln?= , Sergey Senozhatsky , "linux-security-module@vger.kernel.org" , David Laight , "netdev@vger.kernel.org" , Alex Deucher , Andrew Morton , "David S . Miller" Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Wed, 19 Jan 2022 21:22:57 +0200 Andy Shevchenko wrote: > 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? > return '/'/'/'; -- Steve 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 14138C433F5 for ; Wed, 19 Jan 2022 21:04:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A52ED10E1CB; Wed, 19 Jan 2022 21:04:01 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4619110E203; Wed, 19 Jan 2022 20:58:28 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D4040B81BFB; Wed, 19 Jan 2022 20:58:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD93AC340E1; Wed, 19 Jan 2022 20:58:19 +0000 (UTC) Date: Wed, 19 Jan 2022 15:58:18 -0500 From: Steven Rostedt To: Andy Shevchenko Subject: Re: [PATCH 1/3] lib/string_helpers: Consolidate yesno() implementation Message-ID: <20220119155818.7ab45e0e@gandalf.local.home> In-Reply-To: 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> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 19 Jan 2022 21:04:00 +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 , Jani Nikula , Julia Lawall , Rahul Lakkireddy , Rodrigo Vivi , Mikita Lipski , Eryk Brol , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , Christian =?UTF-8?B?S8O2bmln?= , Sergey Senozhatsky , "linux-security-module@vger.kernel.org" , David Laight , 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, 19 Jan 2022 21:22:57 +0200 Andy Shevchenko wrote: > 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? > return '/'/'/'; -- Steve