Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5477907pxb; Wed, 26 Jan 2022 13:00:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqL2Exy8zjJeYH6ycVarlVn1rhxmpPHLNvShEid8T/62HkkW46WoEm/0PNSQh6k41pZiV6 X-Received: by 2002:a17:90b:250b:: with SMTP id ns11mr716626pjb.173.1643230802000; Wed, 26 Jan 2022 13:00:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643230801; cv=none; d=google.com; s=arc-20160816; b=IdtihQaLCvJHvqeAAe/nSAjVZIwvsOyQXN8N+0VSuP0dRDD2ZDh34vLacQexgLdf1p O5KlRGTH5y/c0uw+wzOr1iyjAzxbn7DR1M0m+3aa3RANGVFTbJgAbgrUlyel6r/bG511 BOymlQV9EwaX3XVrTYTKbgaBQD2x6FzzwQxMk3Qyj09deW2a7n+XRNq/NJ7wSg+5LsZ7 HFE5tOFaG2qjF9M85IEb6Wv3n5agIlwpJwPYv/v9rn8Nc/lW+Y8elVRMkxtaIDGIMnr/ c93ovJbaYMHCTAd21zotVse90YQm1J58XkGEvBfdFzQHq91V9CmNpFUam14Y6VfyKWK7 leug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=7of4j6tXJsQTj96IqMsKqWsSKbGVqn3ZKiSJTHPl75E=; b=frbpxGMn1CQpiA1ActzEUaERx67ZwYmGKLsBW8+yJQsU8rf1IL41t8kE30PZrrcs/k rwd6a+GQ/zN/KtcNFKlN4SClPngIN+vONwZm6rjvMT3FHm5vvw54o1004WcsCeivM96W m5BB5Xc4uyz1jpu+sUHJTYssajR6/tgQFDdWsHaZXaje85DIIqrDt6iGHCVngEFd8nYs G4PL9bTJI/vhc6qASSXE5peSqfVEvpzR6yfzWJiEqmH4sJqddcgQNztQ3MoH6WpM47uC EK+nugCjCxKn4yPVNlCFH3X3m85Kw4ULkm6vKqT5oq+T2Z4HGCX8h3G4Xb7LsahQsxWe 8hRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QHZGNvAu; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e18si236370plj.334.2022.01.26.12.59.50; Wed, 26 Jan 2022 13:00:01 -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=@gmail.com header.s=20210112 header.b=QHZGNvAu; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239727AbiAZKNa (ORCPT + 99 others); Wed, 26 Jan 2022 05:13:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239718AbiAZKN2 (ORCPT ); Wed, 26 Jan 2022 05:13:28 -0500 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46738C06161C; Wed, 26 Jan 2022 02:13:28 -0800 (PST) Received: by mail-ed1-x534.google.com with SMTP id m11so68147256edi.13; Wed, 26 Jan 2022 02:13:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7of4j6tXJsQTj96IqMsKqWsSKbGVqn3ZKiSJTHPl75E=; b=QHZGNvAuvGw7dVgE+zNRdndvuugGnChjIbsMvjjz/ITotAgWGyNwZuN48EXCo8az5D RWQMdAopz5nv/RRobC4VoRcuLtfo/RrKWSAUysAnG5W/5/9h/OvMXETCBuAkEbn4m9Vh ZRKNjulT52tFSx8jl00TJVZCKzHeKwvhagWm2XuDHHRI67mQUHyXyGjJwC3tgnpudBHK CUPg3gPeW91RE8SwaJcaX/cvKSHU6keIf7UPLJbzDiBXtJyAMK7gupAvOKDHHEKJh+F3 9WpCas3I2OiV7CjbJWwV6SnsGTJS7yhn6+3ULU7z0WtzzLGHTl8R51wyt+Vu1KuStZpj M64Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7of4j6tXJsQTj96IqMsKqWsSKbGVqn3ZKiSJTHPl75E=; b=q1t0IviRPdFarPCBKA6U2xj6mBJiT6/hkdmgmCzxQKFsawbX/M0vG0rjTq5HD+I2W+ ia3c+IpAySABXPFubpGx+oRXKZ7oJwu8t6nDNNeUl2SQDUN3SPVS4hQ0sRJDeENsoMN3 K0iLU32WBYSU0CJ3rkrUFFZ+F5QD1OOAtn7cFdtRHUxQ4dhYJfWVJIn6i6av178vpWxo yfzchJEsO8ykrCFMF37LTtfFY8NVyVjicfBZ18oAniEwf7hoASBlG6jYtzK22Liqa6Yk nv0BCb+by6r3zrD5QCEBRxXl9G+IqIuOghodF32XToMubmldX5p41Q85KouMbdHaUKkU yeyA== X-Gm-Message-State: AOAM531yvUun8sq+fjOqHIVTWroyMwgHzkm38qVeJCJ0zbcAnyVUARI4 AiZR8LwIuRlYeFrdPq2J9HQOwRkm/RTSDHbhaNI= X-Received: by 2002:a05:6402:35d5:: with SMTP id z21mr17032960edc.29.1643192006805; Wed, 26 Jan 2022 02:13:26 -0800 (PST) MIME-Version: 1.0 References: <20220126093951.1470898-1-lucas.demarchi@intel.com> <20220126093951.1470898-10-lucas.demarchi@intel.com> In-Reply-To: <20220126093951.1470898-10-lucas.demarchi@intel.com> From: Andy Shevchenko Date: Wed, 26 Jan 2022 12:12:50 +0200 Message-ID: Subject: Re: [PATCH v2 09/11] drm: Convert open-coded yes/no strings to yesno() 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 , Andy Shevchenko , Ben Skeggs , =?UTF-8?Q?Christian_K=C3=B6nig?= , Chris Wilson , Daniel Vetter , David Airlie , "David S. Miller" , Emma Anholt , Francis Laniel , Greg Kroah-Hartman , Harry Wentland , Jakub Kicinski , Jani Nikula , Joonas Lahtinen , Julia Lawall , Kentaro Takeda , Leo Li , Petr Mladek , Rahul Lakkireddy , Raju Rangoju , Rasmus Villemoes , Rodrigo Vivi , Sakari Ailus , Sergey Senozhatsky , Steven Rostedt , Vishal Kulkarni Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 26, 2022 at 11:39 AM Lucas De Marchi wrote: > > linux/string_helpers.h provides a helper to return "yes"/"no" strings. > Replace the open coded versions with str_yes_no(). The places were > identified with the following semantic patch: > > @@ > expression b; > @@ > > - b ? "yes" : "no" > + str_yes_no(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 > 51149 3295 212 54656 d580 virtio/virtio-gpu.ko.old > 51149 3295 212 54656 d580 virtio/virtio-gpu.ko > 1441491 60340 800 1502631 16eda7 radeon/radeon.ko.old > 1441491 60340 800 1502631 16eda7 radeon/radeon.ko > 6125369 328538 34000 6487907 62ff63 amd/amdgpu/amdgpu.ko.old > 6125369 328538 34000 6487907 62ff63 amd/amdgpu/amdgpu.ko > 411986 10490 6176 428652 68a6c drm.ko.old > 411986 10490 6176 428652 68a6c drm.ko > 98129 1636 264 100029 186bd dp/drm_dp_helper.ko.old > 98129 1636 264 100029 186bd dp/drm_dp_helper.ko > 1973432 109640 2352 2085424 1fd230 nouveau/nouveau.ko.old > 1973432 109640 2352 2085424 1fd230 nouveau/nouveau.ko This probably won't change for modules, but if you compile in the linker may try to optimize it. Would be nice to see the old-new for `make allyesconfig` or equivalent. ... > seq_printf(m, "\tDP branch device present: %s\n", > - branch_device ? "yes" : "no"); > + str_yes_no(branch_device)); Can it be now on one line? Same Q for all similar cases in the entire series. -- With Best Regards, Andy Shevchenko