From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7D91C433DB for ; Thu, 4 Mar 2021 11:01:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 80C6764F2B for ; Thu, 4 Mar 2021 11:01:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239224AbhCDLAQ (ORCPT ); Thu, 4 Mar 2021 06:00:16 -0500 Received: from mga02.intel.com ([134.134.136.20]:23011 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239212AbhCDLAF (ORCPT ); Thu, 4 Mar 2021 06:00:05 -0500 IronPort-SDR: friwKbRkLyQ45Fj+y30t5ibN11MQWqyauzSKbftBuE4GdpwIYY3irEveV8LnZWc6DuuKvBR4ad zfbvgNNC8z8Q== X-IronPort-AV: E=McAfee;i="6000,8403,9912"; a="174507475" X-IronPort-AV: E=Sophos;i="5.81,222,1610438400"; d="scan'208";a="174507475" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2021 02:58:19 -0800 IronPort-SDR: Pz2VyUquBb9azIc1O51nDtKqJMbK0ZToGPO7EKOTYrthZ+lPzlkBYT8ImUhNrPBxaA+ucZGs1M 0CH/yLmzHQeQ== X-IronPort-AV: E=Sophos;i="5.81,222,1610438400"; d="scan'208";a="400557230" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2021 02:58:17 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lHlgN-009rQ0-4a; Thu, 04 Mar 2021 12:58:15 +0200 Date: Thu, 4 Mar 2021 12:58:15 +0200 From: Andy Shevchenko To: Geert Uytterhoeven Cc: "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , Linus Walleij , Bartosz Golaszewski Subject: Re: [PATCH v1 2/2] gpio: aggregator: Replace custom get_arg() with a generic next_arg() Message-ID: References: <20210301165932.62352-1-andriy.shevchenko@linux.intel.com> <20210301165932.62352-2-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 04, 2021 at 10:01:46AM +0100, Geert Uytterhoeven wrote: > Hi Andy, > > On Mon, Mar 1, 2021 at 5:59 PM Andy Shevchenko > wrote: > > cmdline library provides next_arg() helper to traverse over parameters > > and their values given in command line. Replace custom approach in the driver > > by it. > > > > Signed-off-by: Andy Shevchenko > > Thanks for your patch! > > > --- a/drivers/gpio/gpio-aggregator.c > > +++ b/drivers/gpio/gpio-aggregator.c > > @@ -93,13 +68,9 @@ static int aggr_parse(struct gpio_aggregator *aggr) > > if (!bitmap) > > return -ENOMEM; > > > > - for (name = get_arg(&args), offsets = get_arg(&args); name; > > - offsets = get_arg(&args)) { > > - if (IS_ERR(name)) { > > - pr_err("Cannot get GPIO specifier: %pe\n", name); > > - error = PTR_ERR(name); > > - goto free_bitmap; > > - } > > + args = next_arg(args, &name, &p); > > + while (*args) { > > + args = next_arg(args, &offsets, &p); > > As name and offsets should not contain equal signs (can they?), > I guess using next_arg() is fine. Even though we can use double quotes (AFAICU the next_arg() code). > Reviewed-by: Geert Uytterhoeven Thanks! -- With Best Regards, Andy Shevchenko