Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1195818pxb; Fri, 21 Jan 2022 12:01:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbdyQR42O8GGWrrmeNGHGbqb+6pSm6uu5JrSqexCiDw7kfcSVu7ldBcf8K0kmkHf89VYQx X-Received: by 2002:a17:902:d4d0:b0:14a:7bb6:605b with SMTP id o16-20020a170902d4d000b0014a7bb6605bmr5389137plg.112.1642795272927; Fri, 21 Jan 2022 12:01:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642795272; cv=none; d=google.com; s=arc-20160816; b=KeOH3PgzPv97PCrshZJeChI7N8KCDce0xiT7gLm+j7M8oAo05H+C1ooEJtOFuspPzE C2Cmse73PpgoCMO4oiuNsDAwqg3p5GxxFpNCmnV+BcxlRSFHnMw6XWyNLE/2W/ofPtgW gDmfDup/SKFV4jPb52+EZTYPY1f72LwvBgIZJDfVzggbEmBhODbx/x7vwXNrURJnUiOl R1j+WLRjNHn9XNu9WtxceIbOjn8dvstmwe29ygKoUIyIDjkmTXOrvV0HTTv43TCWyAa3 YsbJDAFk0teYQ9oHrPjEk8uhSmKPBvcOtyEcncWRYnVJrxBjrgCpd0+MCBob2PasC+BJ VAQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=xojkJ/Ev1JQxWU+l4v5pX6LTRg897XTGWEpERg5KC6U=; b=RqKDz2whRfmn2YYyG/o0C4vaLmGqjYh2p45SpeT/0VLSC7jtor3Ee41s2MbQgCbYFN yZnzbZ06F/Gm6PigtETOp4WziNICK4wjjzpMws58ISYoVyyf0R8qIEkKav4Bj5cY0SM3 ZtXu8Lj1aKPp72k1YnVzT4GYdNPZF+LTNn413fyTOqfneiGqKUOtJ3+6VI+v+oY83psD EcIhcT2gqP7oteKtb3FqtRfexjB+K1wVyKN9wDjRrx397ZqK52PUpnsOeg7wx/CKUNAm ejZ3ZTkn9CUd6yhkMdiRnzCTi5wiNqpxDKqmiuK8TA96OtWiGj2tr6wDBptXdk9t+g5P N6sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="m/EXx4aO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 17si7127308pfl.234.2022.01.21.12.01.00; Fri, 21 Jan 2022 12:01:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="m/EXx4aO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357023AbiASTgi (ORCPT + 99 others); Wed, 19 Jan 2022 14:36:38 -0500 Received: from mga03.intel.com ([134.134.136.65]:2092 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357034AbiASTgb (ORCPT ); Wed, 19 Jan 2022 14:36:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642620991; x=1674156991; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=wjoA2KAzAua/sWhboAdUBsDnQlEM3jScHHUyibF2GDY=; b=m/EXx4aOo0j66OMNiEOA9TZ4byifa5vS2jXnLdlP3CVDAz/20sCKq7X9 7Lu43HZh/lb6yRYazJIsfxHzwXN/7jUhpRBTpx+JEgwJrmQBeyq/lU6cu Dzj7PfeBJ1sn5aNyy5usVDn5KV6XREiOPJuihFrNjuip6E42XQ9gZuaBk MBQkCv/znYVXXbXWEjBqVlRzwH/tJvDmayAIxhgS2YqfKJ8WEx2zmbcAz hBPzbGRoKfLXlSM4XRITe8nPYD/vudbq165NqY8XmmBFcdPVftJfylul4 GevokQabSOlcwyV7jRpwqjxUFigm6XacBltFLiEm9J2mLWbAU6LLkRg3P Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10231"; a="245130462" X-IronPort-AV: E=Sophos;i="5.88,300,1635231600"; d="scan'208";a="245130462" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 11:32:06 -0800 X-IronPort-AV: E=Sophos;i="5.88,300,1635231600"; d="scan'208";a="672288940" Received: from smile.fi.intel.com ([10.237.72.61]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 11:31:58 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nAGfP-00CEep-7a; Wed, 19 Jan 2022 21:30:47 +0200 Date: Wed, 19 Jan 2022 21:30:47 +0200 From: Andy Shevchenko To: Lucas De Marchi Cc: 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 =?iso-8859-1?Q?K=F6nig?= , 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 , Steven Rostedt , Vishal Kulkarni Subject: Re: [PATCH 3/3] drm: Convert open yes/no strings to yesno() Message-ID: References: <20220119072450.2890107-1-lucas.demarchi@intel.com> <20220119072450.2890107-4-lucas.demarchi@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220119072450.2890107-4-lucas.demarchi@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 18, 2022 at 11:24:50PM -0800, Lucas De Marchi wrote: > linux/string_helpers.h provides a helper to return "yes"/"no" > strings. Replace the open coded versions with yesno(). The places were > identified with the following semantic patch: > > @@ > expression b; > @@ > > - b ? "yes" : "no" > + yesno(b) > > Then the includes were added, so we include-what-we-use, and parenthesis > adjusted in drivers/gpu/drm/v3d/v3d_debugfs.c. After the conversion we > still see the same binary sizes: > > text data bss dec hex filename > 1442171 60344 800 1503315 16f053 ./drivers/gpu/drm/radeon/radeon.ko > 1442171 60344 800 1503315 16f053 ./drivers/gpu/drm/radeon/radeon.ko.old > 5985991 324439 33808 6344238 60ce2e ./drivers/gpu/drm/amd/amdgpu/amdgpu.ko > 5985991 324439 33808 6344238 60ce2e ./drivers/gpu/drm/amd/amdgpu/amdgpu.ko.old > 411986 10490 6176 428652 68a6c ./drivers/gpu/drm/drm.ko > 411986 10490 6176 428652 68a6c ./drivers/gpu/drm/drm.ko.old > 1970292 109515 2352 2082159 1fc56f ./drivers/gpu/drm/nouveau/nouveau.ko > 1970292 109515 2352 2082159 1fc56f ./drivers/gpu/drm/nouveau/nouveau.ko.old ... > #include > #include > #include > +#include + blank line? > +#include ... > seq_printf(m, "\tDP branch device present: %s\n", > - branch_device ? "yes" : "no"); > + yesno(branch_device)); Now it's possible to keep this on one line. ... > drm_printf_indent(p, indent, "imported=%s\n", > - obj->import_attach ? "yes" : "no"); > + yesno(obj->import_attach)); 81 here, but anyway, ditto! ... > */ +blank line here? > +#include > + > #include "aux.h" > #include "pad.h" ... > seq_printf(m, "MMU: %s\n", > - (ident2 & V3D_HUB_IDENT2_WITH_MMU) ? "yes" : "no"); > + yesno(ident2 & V3D_HUB_IDENT2_WITH_MMU)); > seq_printf(m, "TFU: %s\n", > - (ident1 & V3D_HUB_IDENT1_WITH_TFU) ? "yes" : "no"); > + yesno(ident1 & V3D_HUB_IDENT1_WITH_TFU)); > seq_printf(m, "TSY: %s\n", > - (ident1 & V3D_HUB_IDENT1_WITH_TSY) ? "yes" : "no"); > + yesno(ident1 & V3D_HUB_IDENT1_WITH_TSY)); > seq_printf(m, "MSO: %s\n", > - (ident1 & V3D_HUB_IDENT1_WITH_MSO) ? "yes" : "no"); > + yesno(ident1 & V3D_HUB_IDENT1_WITH_MSO)); > seq_printf(m, "L3C: %s (%dkb)\n", > - (ident1 & V3D_HUB_IDENT1_WITH_L3C) ? "yes" : "no", > + yesno(ident1 & V3D_HUB_IDENT1_WITH_L3C), > V3D_GET_FIELD(ident2, V3D_HUB_IDENT2_L3C_NKB)); I believe it's fine to join back to have less LOCs (yes, it will be 83 or so, but I believe in these cases it's very much okay). -- With Best Regards, Andy Shevchenko