Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2701002rdb; Mon, 4 Dec 2023 05:22:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQ2PiusqOkM01mWX2Dk09F9w6nTsNoDEzt/oySQSaTfxqMIpvGKWAdPDKEAa3na8KtUNLO X-Received: by 2002:a17:902:c643:b0:1d0:8afd:b28f with SMTP id s3-20020a170902c64300b001d08afdb28fmr2379056pls.90.1701696162154; Mon, 04 Dec 2023 05:22:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701696162; cv=none; d=google.com; s=arc-20160816; b=ZImMxSptiXlbmbIahhGQnEG0gwYTnHeVJWDUnHdu1Tx+pc6RfLJ13eaTlqMCcnCc1D 8CMEb+GDQo7qJZwQkF21qNdzWbJZ3bdkjENHlyfHM+K23kOYPjlrQzHPb40d+gThdHRf Jli2q3XyGwBoXS2O0TcchxHa8GiAzgx/5TeZTwUsjgPa0BFvn57totOp5iEolWgTH7FX M3+Ar93MvjnzQFMfN36Hocm4wjC99xZN4mVKHPSuy/tRr2GOAfl3kINlA/hvnUDm9BJJ mEqpCwXKCqRN4BU8VC/VgLXf65S1IC1oWPOIn2+/8lX97mzfhSJF3ukkp0h/XJ5j9hLA ik7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ZV6x4JBT0XCjDi/0pXH4pjgJZ5ZoiuoT2xctxZ7/n2A=; fh=oR8ZQ0z+ZlZlaV2+jyZwpaPNan+XZoJkFqKcBuPZX9o=; b=LCD37bdg3CcxU5rF6E/JDTl5601Or1FRNmqasxOckHjGz9PpXjEs4/a7+ywMZbKrmH xPaywJKLC5gCc0f4y+cBJeNDX8kk/8whHVnPx6BcnLmw70tZsXsLYRwINWG+YDbmu7AN b9OI3a57cdQlUSHjmToU9642LywKIuiYPekUxO2RFdH604sQWOPjksnfFlgkRSU7W2D3 xlCN7Q1zp+ahP0ggrkvG6mIhPGsLT5gZ5NxTiqNfBHoF25N3HvA18fOcBT/g2N41gxT2 gH6piSe8QjAzLprqZh3prX+Objizo8yhBO2Rf0hQo6sbKVA+PxXYvugbsYkEq8+kHQVv EiyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lEPhtXh5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id n5-20020a170902e54500b001c62b51ac0fsi4716497plf.306.2023.12.04.05.22.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 05:22:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lEPhtXh5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id DF8E5806D823; Mon, 4 Dec 2023 05:22:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233080AbjLDNWX (ORCPT + 99 others); Mon, 4 Dec 2023 08:22:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229711AbjLDNWX (ORCPT ); Mon, 4 Dec 2023 08:22:23 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87AC895; Mon, 4 Dec 2023 05:22:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701696149; x=1733232149; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=NYPKGC2pJ0ArIelYDLqnzlFWuyYkGLKzfqxiiz2YBUk=; b=lEPhtXh5Tt7OlLt6x4C7dQanMkA2Inf989xGOH2MuSteAyjmjIQEOLJo L9ZePuCO6G34i2vizqXxjcE2fxy+2iysNmUjjuyWF6ou0S3VL9GxGIQkm BDeTAkPUYhcdV2nhvzjpj0hrHnBbZJaBUVdfDV8OWzp22P2tKo7l+2/Mc UVlZKTWHyWW5QKPIfJVNH7Sw4mnvLTgpPSLjGBE40dVwi1Y9UBi3oAoHb yX2GFp/252umX5x46RalKkceLWfNwIIWRTSVV0fcJS5V7LnJdQSfs+7Ii RmCezbSacVSrxnYIV8Q/zOOUrHTwaSxxA18nT4eo0iQih8fWrxLzWM/GQ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10913"; a="580801" X-IronPort-AV: E=Sophos;i="6.04,249,1695711600"; d="scan'208";a="580801" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2023 05:22:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10913"; a="894007072" X-IronPort-AV: E=Sophos;i="6.04,249,1695711600"; d="scan'208";a="894007072" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga004.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2023 05:22:27 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rA8u0-00000001l3y-1M4F; Mon, 04 Dec 2023 15:22:24 +0200 Date: Mon, 4 Dec 2023 15:22:24 +0200 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Linus Walleij , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH v3 10/10] gpiolib: remove gpiochip_is_requested() Message-ID: References: <20231204093509.19225-1-brgl@bgdev.pl> <20231204093509.19225-11-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231204093509.19225-11-brgl@bgdev.pl> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 04 Dec 2023 05:22:40 -0800 (PST) On Mon, Dec 04, 2023 at 10:35:09AM +0100, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > We have no external users of gpiochip_is_requested(). Let's remove it > and replace its internal calls with direct testing of the REQUESTED flag. ... > char *gpiochip_dup_line_label(struct gpio_chip *gc, unsigned int offset) > { > - const char *label; > - char *copy; > + struct gpio_desc *desc; > + char *label; > > - label = gpiochip_is_requested(gc, offset); > - if (!label) > + desc = gpiochip_get_desc(gc, offset); > + if (IS_ERR(desc)) > return NULL; > > - copy = kstrdup(label, GFP_KERNEL); > - if (!copy) > + guard(spinlock_irqsave)(&gpio_lock); > + > + if (!test_bit(FLAG_REQUESTED, &desc->flags)) > + return NULL; > + > + label = kstrdup(desc->label, GFP_KERNEL); > + if (!label) > return ERR_PTR(-ENOMEM); > > - return copy; > + return label; > } My gosh, maybe we take better naming to reduce churn here? Whatever, let's stop bikeshedding :-) -- With Best Regards, Andy Shevchenko