Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8084288ybn; Tue, 1 Oct 2019 03:00:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwN/IhhZxxgGuU9U5GUagxfkpfSJJJnBmSTGL/zXbIaU4LBnPg42iGBhMKZuc5zPwpTAbOM X-Received: by 2002:a17:907:211c:: with SMTP id qn28mr23316232ejb.244.1569924005605; Tue, 01 Oct 2019 03:00:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569924005; cv=none; d=google.com; s=arc-20160816; b=vC/J7Zk6h5widwBywDZ7QPaQQC/pF8XPzdJFBqm2eMuompPKqOIzmJOSge8DrdGuZN 1gXCwVOfFkmh97F+4e6jde2oAfapGb+7RRW0GDbBtZo9zf7oH+hPUhVdELU50nng+uj0 iGx5enFF48TOjydJfzV5zW2uB50VYI7SsFlJKWtp//5mM/0lNZBWHr/VNiCuxFXbLrJv bw1nzDL1V93kfTTer4CoRwSW+9KO6MhIPFFW1z0MGSMgW3VhtJNNgxY+bKTajX0rBaay nyNF1WcEpxwsT3L97+GH4NpuZC4lik/QUfJu6fu5exkFM4pEDSbWEb7pBFt66sMyVx7z pfYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=/7qYwM2ecb1kH+0BwQvwlBLwAA00riVd4HsBOnaRaFo=; b=Gdsi3UAty4wm0ltPTd1oYUXSaT+Z5HKLuAcYHgD825EcmuPEUqDwnHiqNtOqiOOIiz 49btn0kzmeliMEaEG6rb7m2rwIeHjPYCwBEtcNjJ5qjV+KA4T8yO0U6cMfHWZ1ZpL6A3 9XBxw1hF2EgH6FayhdEj3B+71Bo9TA2X7ySKokAbih5ze/t3kTqszYQoX2cVadpUy0/F PukqXMEFKlz2TInl4/j/oSijK1e1nVDIVjgbPULdAwoC8yf+FffbuVMnP8L/xCI8vWGs hJ97nCFXIgLe4UrS04Wl023gCp/dgVDY4dvbCqfuToR2OTKwzKhMEYkW6TAG6irQ39gz ZwvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gsqEsnnh; 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 gf5si8151851ejb.324.2019.10.01.02.59.40; Tue, 01 Oct 2019 03:00:05 -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=@kernel.org header.s=default header.b=gsqEsnnh; 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 S1729745AbfJAJ7R (ORCPT + 99 others); Tue, 1 Oct 2019 05:59:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:37010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725765AbfJAJ7R (ORCPT ); Tue, 1 Oct 2019 05:59:17 -0400 Received: from localhost (unknown [89.205.130.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1BAED2190F; Tue, 1 Oct 2019 09:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569923954; bh=6BQj7mEtfMmysioXhhYw2T2ycMJfZtHk5KXS+5M9J/I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gsqEsnnhnu/YvGG69TnK4g5a2xTa+FgrBXr/RiK7xIdHcSVquGY5kk5UCPw0iPfki 6IRV7Bm90LEpF2HwXQ4tSoA/ymTVqyAIm66I8530Ysgg8KutObDwHg80mjPMs70gDR DwW9tjRLUXtLNXrmKQhvnYg1xEvyDLnKrCMVglag= Date: Tue, 1 Oct 2019 11:59:11 +0200 From: Greg Kroah-Hartman To: Jani Nikula Cc: Rasmus Villemoes , linux-kernel@vger.kernel.org, Joonas Lahtinen , Rodrigo Vivi , intel-gfx@lists.freedesktop.org, Vishal Kulkarni , netdev@vger.kernel.org, linux-usb@vger.kernel.org, Andrew Morton , Julia Lawall Subject: Re: [PATCH v3] string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers Message-ID: <20191001095911.GA2945944@kroah.com> References: <8e697984-03b5-44f3-304e-42d303724eaa@rasmusvillemoes.dk> <20191001080739.18513-1-jani.nikula@intel.com> <20191001093849.GA2945163@kroah.com> <87blv0dcol.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87blv0dcol.fsf@intel.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 01, 2019 at 12:42:34PM +0300, Jani Nikula wrote: > On Tue, 01 Oct 2019, Greg Kroah-Hartman wrote: > > On Tue, Oct 01, 2019 at 11:07:39AM +0300, Jani Nikula wrote: > >> The kernel has plenty of ternary operators to choose between constant > >> strings, such as condition ? "yes" : "no", as well as value == 1 ? "" : > >> "s": > >> > >> $ git grep '? "yes" : "no"' | wc -l > >> 258 > >> $ git grep '? "on" : "off"' | wc -l > >> 204 > >> $ git grep '? "enabled" : "disabled"' | wc -l > >> 196 > >> $ git grep '? "" : "s"' | wc -l > >> 25 > >> > >> Additionally, there are some occurences of the same in reverse order, > >> split to multiple lines, or otherwise not caught by the simple grep. > >> > >> Add helpers to return the constant strings. Remove existing equivalent > >> and conflicting functions in i915, cxgb4, and USB core. Further > >> conversion can be done incrementally. > >> > >> 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. > >> > >> Cc: Joonas Lahtinen > >> Cc: Rodrigo Vivi > >> Cc: intel-gfx@lists.freedesktop.org > >> Cc: Vishal Kulkarni > >> Cc: netdev@vger.kernel.org > >> Cc: Greg Kroah-Hartman > >> Cc: linux-usb@vger.kernel.org > >> Cc: Andrew Morton > >> Cc: linux-kernel@vger.kernel.org > >> Cc: Julia Lawall > >> Cc: Rasmus Villemoes > >> Reviewed-by: Greg Kroah-Hartman # v1 > > > > As this is a totally different version, please drop my reviewed-by as > > that's really not true here :( > > I did indicate it was for v1. Indeed v2 was different, but care to > elaborate what's wrong with v3? No idea, but I haven't reviewed it yet, so to put my tag on there isn't the nicest... greg k-h