Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp718552ybn; Wed, 2 Oct 2019 05:13:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZccTTsINHxDc7wb8Lva4r/PA4dc729EO/i6PVEI8IIZxifqzDXMc4W0ty3O3+miVYmdu1 X-Received: by 2002:a17:907:388:: with SMTP id ss8mr2721889ejb.26.1570018395245; Wed, 02 Oct 2019 05:13:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570018395; cv=none; d=google.com; s=arc-20160816; b=LExPcu+dbyQRCOapwkt9oKVVpwPpHB1sfc13ff52TSCGg2Le0i8NMqymwPEIganjVj iNQveF/En6ZOA61p8yi/R4TCEROgw85VS6tX7jEtudmTUwKj0HCM1snZpGU5GnTF+P9f 6PHRUHWU6P7+NThY0B2RKTgpzRXKBvEZMCMSXfEqCJVgyHbUlVfSvQXIQJZdwo0xO7Oi jgb/PZvIc46uamwDiksO4jH/g4UN0pFU20omuqQnGBLwKhpL7tfaoTY5Q96fcjUo0V8m U3xBW05d5v2OlOM+Bnea4cp+JHLqX4w1ROU7zuAIWTdu6JyopwQ4QViBenaMWfmHvc1z Yt9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=YqW4lirDp6dhPL53QREOEClblGXQffbz/DGv2dLJs4Q=; b=kPG9WJXErPZSUIL35JbdOzvwQAfsNsitxMscVKMyGIyXfc+JgKUpwXI3zDCY/SriIT zT3mO4E+ms5abnBFI3A0qWILvhODnk4OTEAFFkRqYONAy9XnDn9zA3Rc7fQhXz7y/U0n n6dvT0eheH/ApYJJklj6KfJ5YF6rQ4ern+FuyRPvFJqwQKmwFy1E8f1rvgLv3Fj1aUPF fOW4QE4waEJF+MDtbpmKXh78zl/6SDPWcc0QGUnhgSv1U9ugvYdPGSt+wLuHuYQTwCCi oA25QXj9KBx1Q1BQ/ZShRXCqZiXl8Fivq3Af5U/IEImLkP01TQ1Fr6CyO5/0mVMEW5zC ezVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=ISl1taxi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8si10379996eju.351.2019.10.02.05.12.51; Wed, 02 Oct 2019 05:13:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=ISl1taxi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727503AbfJBLAl (ORCPT + 99 others); Wed, 2 Oct 2019 07:00:41 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:46583 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbfJBLAl (ORCPT ); Wed, 2 Oct 2019 07:00:41 -0400 Received: by mail-lj1-f196.google.com with SMTP id d1so16603525ljl.13 for ; Wed, 02 Oct 2019 04:00:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=YqW4lirDp6dhPL53QREOEClblGXQffbz/DGv2dLJs4Q=; b=ISl1taxiHeTMVMMOn0n8wcdg1xJCR1fcz2fZFt8tGPPObtsnfloz8d6yuwZ/9jaDBC EpdDdSIVXj2fa5iKwOBPzK1izqeisJnL+CPOwUoqWwMd4nnpL+vDOFHoSeaHcSqS4GjT iCUvnNTfZGkmnxxuPGn9m+87WKlq8hpi7/JB8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=YqW4lirDp6dhPL53QREOEClblGXQffbz/DGv2dLJs4Q=; b=kM657xP4nH2p1I5IAgJ96RXEW61XkH8gn/9sZr6YZT30G1sKsy5DC1aBqrONfPqQHY ZCFzudpUmYqebSTapCP4lYxEnHH3i1wLUoSzAyvtpCsMQo0PMhnmilCT9cYQ+iO8RckD vEtAwMk3iO6ukKU2UgcM1upuA7YxeXHvBpaqyOKTFk44aBODgTzeunLzTkj0hWYuxEP6 /SJax4b9BEv7gRyjC2jN07FM/pNxmvEbTbyHLciIOoiWzUPSdpMKh/VKAktUekzEKaif jtJPV3DzsrZqoCglE2r/5Hoyd8botLGrxgX+RnMSwdYWGcTUO6HgGwvFRXKyfXlURe+w v3fA== X-Gm-Message-State: APjAAAWgD9GL/Qu8iThlZXLIk4SLm4ZXZ5Wzs3AiOoCAq9JGgODQD2Ji 0O1Gyp3QFBC7cTV8ljFEm+0SKQ== X-Received: by 2002:a2e:86d5:: with SMTP id n21mr1977522ljj.1.1570014037566; Wed, 02 Oct 2019 04:00:37 -0700 (PDT) Received: from [172.16.11.28] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id y22sm4544784lfb.75.2019.10.02.04.00.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Oct 2019 04:00:37 -0700 (PDT) Subject: Re: [PATCH v3] string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers To: Jani Nikula , linux-kernel@vger.kernel.org Cc: Joonas Lahtinen , Rodrigo Vivi , intel-gfx@lists.freedesktop.org, Vishal Kulkarni , netdev@vger.kernel.org, Greg Kroah-Hartman , linux-usb@vger.kernel.org, Andrew Morton , Julia Lawall References: <8e697984-03b5-44f3-304e-42d303724eaa@rasmusvillemoes.dk> <20191001080739.18513-1-jani.nikula@intel.com> <87eezvbgp1.fsf@intel.com> From: Rasmus Villemoes Message-ID: Date: Wed, 2 Oct 2019 13:00:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <87eezvbgp1.fsf@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/10/2019 12.11, Jani Nikula wrote: > On Tue, 01 Oct 2019, Jani Nikula wrote: >> While the main goal here is to abstract recurring patterns, and slightly >> clean up the code base by not open coding the ternary operators, there >> are also some space savings to be had via better string constant >> pooling. > > Make that > > """ > While the main goal here is to abstract recurring patterns, and slightly > clean up the code base by not open coding the ternary operators, using > functions to access the strings also makes it easier to seek different > implementation options for potential space savings on string constants > in the future. > """ > > to be more explicit that this change does not directly translate to any > space savings. > > Rasmus, okay with that? It's rather fluffy, but it doesn't make unfounded claims about space savings, so in that regard I'm fine with it. [It's probably just my lack of imagination, but I still fail to see how one could ever achieve better than the linker creating just 1 vmlinux-wide instance of "enabled", which I believe happens regardless of whether one uses these helpers or not.] Rasmus