Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2201199ybt; Mon, 15 Jun 2020 22:51:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeeTfn1NiIRfG4pFBif3XBW3abDYVkURQg7kQrGQsr+3yJCMhRlhSima8lvEYcgiAbRlyx X-Received: by 2002:a50:a701:: with SMTP id h1mr1048785edc.170.1592286718791; Mon, 15 Jun 2020 22:51:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592286718; cv=none; d=google.com; s=arc-20160816; b=JQ+8uiUSTgsFddqKymaBTXHIEA/WybvEzAn7bJzD36jbkuWhUrL9rlWM2lKCcBTOS7 Tpt7I2Wjf/wCdfXXxUC/1vStGotZAnL/Dd5mDntDxsbRq0nUqswnuol51Iv2C9lIfJzW kYUzFuZgJBY0hYWQfa4ZPcfHIBmtXsLTHYh+vi/FDefhRwXkjA0C1UR57lrIgznMrFtZ Jh4jeMl0FgLJ7YuKvy2heYtvlSSrJlvtZLytgwDR0NSXygv8y96v7wQP7RkIbWOaj4RG spRSJWurogWdKKygcHOAHQxBmzNOllDYINzJwdvGtQjF32UAlbmvHsCevyaOvFSp475U DzTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=6kNv3/nwhWtlNUH7eRCq8sD+149stMVa1OEvvQPeJOQ=; b=mBUpOI9fTKZEdkHvn4POt9RAtd3uJpOmFu7qVR2fKA03SQM/Ub5wNNvgaJeKWomY4A wOHlPQWEXyf2o3O0n4pO/RsPb9cbATvEFXdh8Te7Gp2bLosZxGyUGG0lrA2r7Y0jdJpJ DD5lTYn75gPmfAjSkXsRDTYQC4Gy1SGo6h5kVZLMMBoRbJgzXfhGHJcWPYvJWkDgTgwq 6r8n2a46TP7ZhF7INeWbCcek5doqPyG2Ou+y3SJ0GIntbJwDcdf3JoXqskvFZbcoC+ad jQKULjkoviC0yN6CnOVlO20vt2iQq+c4FkX/hUioc4hsn7w51jILhozX7RrvmBznBd0E 0dRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nShA9M8o; 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 f6si9802490ejr.283.2020.06.15.22.51.36; Mon, 15 Jun 2020 22:51:58 -0700 (PDT) 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=20161025 header.b=nShA9M8o; 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 S1726394AbgFPFry (ORCPT + 99 others); Tue, 16 Jun 2020 01:47:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725710AbgFPFry (ORCPT ); Tue, 16 Jun 2020 01:47:54 -0400 Received: from mail-vk1-xa43.google.com (mail-vk1-xa43.google.com [IPv6:2607:f8b0:4864:20::a43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27D61C05BD43 for ; Mon, 15 Jun 2020 22:47:54 -0700 (PDT) Received: by mail-vk1-xa43.google.com with SMTP id p187so4526345vkf.0 for ; Mon, 15 Jun 2020 22:47:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6kNv3/nwhWtlNUH7eRCq8sD+149stMVa1OEvvQPeJOQ=; b=nShA9M8oAP/uXZ3i7WEsOeiZdmR5e8n7b6wJ8Te/MvwEuS0+sHy0LMh2ZE4+kWUzDW vA24FMrFKn+LS6KceSsoH+Bj41BURuoRyN+M2w6cSR7asNh/JsQNUJsGC7JKXFmk1QhQ vxcciKqzLEnGrx6DqcLLSlkgp434ALIJNb87doNgWvVf9/p1bwKlERUcmbsU4mlowAgU 8X8aaO6ix3H264mZ2nJaNYMLCZzrxmi5SVGg+vKAPPp/hXUsJ6b8Bz9yTjcI8TqbAXEW rDZmQd6NTH6WqxRcuWDswiLXY1aqItGyTuzPxClYLdD7s8luJ+Qn7aDejjnArfMawUt0 z+WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6kNv3/nwhWtlNUH7eRCq8sD+149stMVa1OEvvQPeJOQ=; b=ZbuB3s41BF2Lnwkhf3eRhNxuWMl3SAegshiQsJW67cAOajYRO9snpXv4RYPxY3J7yW L8cRS040AS2ocwAwVViXU3mAyxBLAqRSEDgyAQYKlwLEGE1hXPStC88Q2qiEtQGEWbUr t3YXomIsVVz7PTq9pZnmg01c8ycb3q0Sa8m/rMpsLVWxsEqTvktnFm9NUomucKDLnGpD GHcEn7MO8RYo+5XAtgRv5+OJI0LqkoudNSU/84L7XOd8rtKRd+Zmu9f0C131XQ3XyMya 7lRWKzb4OsQiEjCuacsOpuUzNekUZAuJvmRQJLtMfCEWUhl7AQ+jfXMOx5qmWkBiub2a +aEw== X-Gm-Message-State: AOAM533LDkXoUJ9pQnVmURRfBmPxm2Ftg0x0AlbZrfG3cUjaCCCTexJN w4pfwLUNgN1dcDGMOc7X+BcU2yW1ZysvOnMrBUk= X-Received: by 2002:a1f:9350:: with SMTP id v77mr379210vkd.93.1592286473111; Mon, 15 Jun 2020 22:47:53 -0700 (PDT) MIME-Version: 1.0 References: <20200613155738.2249399-1-jim.cromie@gmail.com> <20200613155738.2249399-14-jim.cromie@gmail.com> <20200615151414.GI31238@alley> In-Reply-To: <20200615151414.GI31238@alley> From: jim.cromie@gmail.com Date: Mon, 15 Jun 2020 23:47:26 -0600 Message-ID: Subject: Re: [PATCH v2 13/24] dyndbg: combine flags & mask into a struct, use that To: Petr Mladek Cc: Jason Baron , LKML , akpm@linuxfoundation.org, Greg KH , Rasmus Villemoes Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 15, 2020 at 9:14 AM Petr Mladek wrote: > > On Sat 2020-06-13 09:57:27, Jim Cromie wrote: > > combine flags & mask into a struct, and replace those 2 parameters in > > 3 functions: ddebug_change, ddebug_parse_flags, ddebug_read_flags, > > altering the derefs in them accordingly. > > > > This simplifies the 3 function sigs, preparing for more changes. > > We dont yet need mask from ddebug_read_flags, but will soon. > > --- > > lib/dynamic_debug.c | 46 +++++++++++++++++++++++---------------------- > > 1 file changed, 24 insertions(+), 22 deletions(-) > > > > diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c > > index 93c627e9c094..8dc073a6e8a4 100644 > > --- a/lib/dynamic_debug.c > > +++ b/lib/dynamic_debug.c > > @@ -62,6 +62,11 @@ struct ddebug_iter { > > unsigned int idx; > > }; > > > > +struct flagsettings { > > Please. use underscore to help with parsing such a long names. > I mean use: flags_settings. > ok > > + unsigned int flags; > > + unsigned int mask; > > +}; > > static int ddebug_change(const struct ddebug_query *query, > > - unsigned int pflags, unsigned int mask) > > + struct flagsettings *mods) > > > -static int ddebug_read_flags(const char *str, unsigned int *flags) > > +static int ddebug_read_flags(const char *str, struct flagsettings *f) > > > -static int ddebug_parse_flags(const char *str, unsigned int *flagsp, > > - unsigned int *maskp) > > +static int ddebug_parse_flags(const char *str, struct flagsettings *mods) > > What "mods" stands for, please? > modifying_flags, or modifiers. the original flags & mask bundled together ie the pfmlt in echo +pfmlt > control > I have to say that using a parameter called "mods" in a function > called parse_flags() is inconsistent and confusing. > does the above help ? I could go with modifying_flags keep in mind the name has to suit all + - = operations I'll review all the new names. I recall you didnt like filterflags either, so I wasnt sufficently clear there either. Im mulling a better explanation. > Best Regards, > Petr