Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp91781imm; Tue, 19 Jun 2018 16:37:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIg/iLahKn79kgZ/ZfcAU9mWKipEEmomzJj2TaULjg56UiwXZ6hpop0pc1UKsx5a3cO9T3j X-Received: by 2002:a63:83c3:: with SMTP id h186-v6mr16278671pge.298.1529451477657; Tue, 19 Jun 2018 16:37:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529451477; cv=none; d=google.com; s=arc-20160816; b=yDYfDhXIc1Bmxiulpw3PBFMrMWtZH4RfRiPeCOlUIOI1AgjbLh3F3pORiFZskIa18r l9VfrwHWxD2EqfR4FhzkOnL9iF8eecJ19OrxvjeRL31LhQZlgFXKDTXQu++J8WEAvBB4 eq9pwMzdBBFsPk3FCgGKwy+o/+cmTGODmyH4lAS9wOb4wTYGff5XKEj4Le4H4EFyiCAg UPttR5u1Q/pyY4OuqXoeHNTQjpTLp+3Rh0ZkwwZhYNCRAzMG5Giqglec+k8EUcGDazlo eyjIgArntrOJ2rcUxOZThjmPcuDOft/qvTWA/qR+lhckvHKIW4f8b351tyU1h+gEOVdq P89g== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=+Pf6uvlfyB3YZVjxWlsV5eKSKbNKfDnpHjJZC/f1NVo=; b=LkOPNkFg/7my4wvkrKtgpT2jJy45Lz8dHEV4VIGis3RC1wLqiZWIFrvbV65YSpuQoG iNeX5UxIJxNCkzeNEDaOPu6uKy7eNPXkEX3CdljX67F0WB3ZgjPAIdoboO54RfExYc0V zFH4kkSOpFltgRvDTzoZvZMTxFntgvppt3Jrs/9z97NbRh5wwUvtKSR04jlajAsDsNOl GdZdHsIAkUYKtd8ZsNSgTJv1IAiBie83rD6ZK5QRv4I8c7+Twd2oMxHjUGDcDRlmcHFF KQr6LkPiENgS0/MSatDsKQsHQbBrWkEHRSA69+Yi+Y3eQ14QAxMsuEYSlHfHPLocCC9r 5A4g== ARC-Authentication-Results: i=1; mx.google.com; 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 z63-v6si603361pgb.456.2018.06.19.16.37.42; Tue, 19 Jun 2018 16:37:57 -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; 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 S1752825AbeFSXgx (ORCPT + 99 others); Tue, 19 Jun 2018 19:36:53 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43274 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751955AbeFSXgt (ORCPT ); Tue, 19 Jun 2018 19:36:49 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.9.92]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E3720106B; Tue, 19 Jun 2018 23:36:48 +0000 (UTC) Date: Tue, 19 Jun 2018 16:36:47 -0700 From: Andrew Morton To: Michal Suchanek Cc: Jonathan Corbet , Arnd Bergmann , Frederic Weisbecker , Ingo Molnar , Aaron Wu , Tony Luck , Thomas Gleixner , "Steven Rostedt," , Laura Abbott , Dominik Brodowski , Alexey Dobriyan , Tom Lendacky , Jeffrey Hugo , Baoquan He , Ilya Matveychikov , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v10 0/5] Kernel parameter parser cleanup/enhancement Message-Id: <20180619163647.23c8a5d7370258c9e43141c3@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 5 Jun 2018 18:43:07 +0200 Michal Suchanek wrote: > due to work on the fadump_extra_args I looked at the kernel parameter parser > and found its grammar rather curious. > > It supports double quotes but not any other quoting characters so double quotes > cannot be quoted. What's more, the quotes can be anywhere in the parameter > name or value and are interpteted but are removed only from start and end of > the parameter value. > > These are the patches not specific to fadump which somewhat straighten the > qouting grammar to make it on par with common shell interpreters. > > Specifically double and single quotes can be used for quoting as well as > backslashes with the usual shell semantic. All quoting characters are removed > while the parameters are parsed. Well. It's nice. I guess. Is there any demand for these capabilities? I don't recall ever having seen a complaint - kernel parameters tend to be pretty simple things. Also, the break_arg_end() and squash_char() macros make me want to cry. A macro which changes control flow hidden inside another macro! Are they reeeealy necessary? Can't be done with some C helpers? Maybe put inquote, backslash, args, i into a new struct parser_state and pass a pointer to that around the place? At the very least, those macros should be apologetically documented :(