Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp606424imm; Wed, 20 Jun 2018 03:48:21 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK8qM5YaR88I6VSpUAVe6H5ZyLkDm0e/nErq3T0HJlss1Jol6BVzzw/iiSpGUMIUy07Ht18 X-Received: by 2002:a62:1747:: with SMTP id 68-v6mr21929442pfx.69.1529491701778; Wed, 20 Jun 2018 03:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529491701; cv=none; d=google.com; s=arc-20160816; b=kU0/tqgwHDBtrwZ0msOaSg0wQNaYOCBbKpfWfVYYr/Jm2QsdaB4sAU53b2/vpufpbs HWzalfaGHfxBkjKyvpJJN10LS8YpUCKYIVSR54dMdgrxR+q+ttqg+h/GcKaobetO5BdY OyawB8QZoeY0Tj15gXtyShhsZ9EfF44OL6P0ShmQs6A4w+sIF8q4O7DhaPwU90V3gLuM 9c4LMPTIJWkh9omMfivEueB84U8azCrlTopvShbFCELEv2G1kG+pLR7ExX5oyoUXS1b8 p/534OPnW15Wer7t/j98QqQhCaR38oqPIxdAlDzqMsnY7v9jwI9UwONm8x+AOmvax34A YnjA== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=JsgsRxT5t1nzY5rTKPysk00JJwF+p0PqMqgjMhv5xww=; b=YNW0+DhoUtSeBqCYYHpZVcG8RNnHbnJwzP1RCqBnuotWs/or+t/zfKYiONryS8pO7o j6W4XDuQvxvgdQs7xN0odJDyj1Usbyf1iOyUySA9BS7Ww5qC3K8GV6TL8VUGHS0zOxog gpX8/ow7JAXmNcbpIIbyuZ+ZJYFuvP9bAGl2NxieA/p9ZeRsIL5XkZsHDrx+GyY7l7he mapdt0MScy+e7RPnD64wXltkEahs0l5L2rHBdmonyVBLIMzzVsuokmkL6m0dp7VOA/rT 6r/e0Z3ecnHNCnbQS3dhorWkCvexXVyQDtorn8gpPAer9nqVphEUWiwpDus9mnELwDr6 zIzg== 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 s4-v6si1703221pgq.454.2018.06.20.03.48.07; Wed, 20 Jun 2018 03:48:21 -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 S1754017AbeFTKrX (ORCPT + 99 others); Wed, 20 Jun 2018 06:47:23 -0400 Received: from mx2.suse.de ([195.135.220.15]:39663 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750793AbeFTKrU (ORCPT ); Wed, 20 Jun 2018 06:47:20 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 7F9C8AC2E; Wed, 20 Jun 2018 10:47:18 +0000 (UTC) Date: Wed, 20 Jun 2018 12:47:15 +0200 From: Michal =?UTF-8?B?U3VjaMOhbmVr?= To: Andrew Morton 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: <20180620124715.58680ad5@kitsune.suse.cz> In-Reply-To: <20180619163647.23c8a5d7370258c9e43141c3@linux-foundation.org> References: <20180619163647.23c8a5d7370258c9e43141c3@linux-foundation.org> Organization: SUSE Linux X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-suse-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, 19 Jun 2018 16:36:47 -0700 Andrew Morton wrote: > 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. Yes, the complaint came with the nested arguments which are now not pursued anymore. The grammar is really not very nice as it is, though. > 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? Seems better than repeating the same code 3 times. > Can't be done with some C helpers? You could not change the control flow then, could you? Technically you could return something and decide based on that I suppose. > 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 :( Yes, some description can be added, too. Thanks Michal