Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5466386pxb; Wed, 26 Jan 2022 12:39:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9/ZVaMshqFajvJH2QntMKCCBM9M8kUu43avYr4celHQjP6H3kGvT2+nrWt0UBwwKE1i/G X-Received: by 2002:a62:1ec7:: with SMTP id e190mr196657pfe.66.1643229588001; Wed, 26 Jan 2022 12:39:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643229587; cv=none; d=google.com; s=arc-20160816; b=iy7SQb+cgF9IWLB+ypWxfWrrqbbuYoS1v78NxPqjsloHLAFBT5OYfSl0OkRNI+R9iU okZex0w6i9v0osg77wpOYW9H2PGzXQw7CaBw5X98U6qRAMrg1H+by/ZvOqNQD97NRKlL u/DfYW7KeuDASVxMpzIOhHMSoGyY+kLXj7tWCQbEwdap4ux+wjoeoecGpMpA3hE60CPA 85h87wQhnsU7hBl/6qc4RJKVRX3zVcdq4Kc+ToDKs4QSUC1YTvcU58oHuRwWcdguuPG4 QAqQc129soFEpR7uw/kyXLmec10thfxQvZMFIrgJ5aYu1IhYhBE2toa27SA/WzAq23yB 7bYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XgLmP60uTOhEwX/oPavSs2Rgu5/iSU4i/4ioM9eabuo=; b=OHcXPjlgjyeejgdmLCVMoHM0zh39LQUjRCUN/lgt9oTZfsNCN80SSScqx9worb1Ki7 VYgRoIeiYOt1toj4PnaoAA964MLN+HO4RjEt6Qgtp1sIK/t76OYhoEI8FtvWgTkI1Fho izmF3GRnwhn7dBsSaJeJqErlxGYvDaDzaM+VRcCTzMaHXDY7ozm8M0s2rwIDovhxTlvP JDEmPATsqL1FE5EL7z35PNz2itn0R1OUkQ14AgSSls+Q6ug9E8DxLlvVz6BVHdA5P/yj hDBIkCoU1bG5t1js8UhTe/bd8+pY2E9/rNCkOHzoPA535ssFEe+2GEQzeV53USbV1WwT o2Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GsrV4KKk; 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 m7si188953pfd.342.2022.01.26.12.39.35; Wed, 26 Jan 2022 12:39:47 -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=GsrV4KKk; 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 S238754AbiAZJFa (ORCPT + 99 others); Wed, 26 Jan 2022 04:05:30 -0500 Received: from mga17.intel.com ([192.55.52.151]:44553 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231404AbiAZJF3 (ORCPT ); Wed, 26 Jan 2022 04:05:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643187929; x=1674723929; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=ggEHQETAv3lIPyDtUG98X3fyvSWeMQrZEDGtYqjDGro=; b=GsrV4KKkI9aTnAL2asGlOF2XIAK+9sMQv4az0wGVCL6X/0dPYtnWobWZ b12eVG/Y019aQBgft0tyiMUzLEPEEduhS/Pyjz7UqqaN5ryb6CuFa5c1C 8UEscW/PQu3mtPXMOn4NSOQP/le9i6HVPSIQzp6xAD/41cWGEwK/ouxIL aX9uBIiyjK5+nwKG1LlJDo8EYrVObpOCPye5/O/21HqZfOdfKTq/a2XUh BcyksDa7zfWNX3LshJMj4Ir0h7uBM9Q00iM6AMtbu6G8JEV6i6kqgghlj bYA9+SW+WxpjR0LGd2SPBj7VdyBAXBwrD08UZqaP7z5tkq56oHAg9sO4N A==; X-IronPort-AV: E=McAfee;i="6200,9189,10238"; a="227184325" X-IronPort-AV: E=Sophos;i="5.88,317,1635231600"; d="scan'208";a="227184325" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 01:05:28 -0800 X-IronPort-AV: E=Sophos;i="5.88,317,1635231600"; d="scan'208";a="628246433" Received: from richardt-mobl1.amr.corp.intel.com (HELO ldmartin-desk2) ([10.212.143.219]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 01:05:28 -0800 Date: Wed, 26 Jan 2022 01:05:27 -0800 From: Lucas De Marchi To: Andy Shevchenko 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 , Julia Lawall , Rahul Lakkireddy , Steven Rostedt , Rodrigo Vivi , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Christian =?utf-8?B?S8O2bmln?= , Sergey Senozhatsky , linux-security-module@vger.kernel.org, netdev@vger.kernel.org, Alex Deucher , Andrew Morton , "David S . Miller" Subject: Re: [PATCH 3/3] drm: Convert open yes/no strings to yesno() Message-ID: <20220126090527.ksuah5m6xctx7jjo@ldmartin-desk2> X-Patchwork-Hint: comment 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; format=flowed Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 19, 2022 at 09:30:47PM +0200, Andy Shevchenko wrote: >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). now that we are converting to str_yes_no(), we will have a few more chars. Some maintainers may be more strict on the 80 or 100 chars. I will assume whatever is in the code base is the preferred form. thanks Lucas De Marchi > >-- >With Best Regards, >Andy Shevchenko > >