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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEB8CC4167B for ; Thu, 30 Nov 2023 16:46:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232511AbjK3Qq1 (ORCPT ); Thu, 30 Nov 2023 11:46:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232540AbjK3QqW (ORCPT ); Thu, 30 Nov 2023 11:46:22 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4475B1A3; Thu, 30 Nov 2023 08:46:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701362788; x=1732898788; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=j5Z3BZaa2KzJMDfJc7votNXQvTdpf9ABYw6btdhHDko=; b=Fr0cjvmf3JjxHDict5dQdrfhkDN0XYcnCjmVPzJRNd0QnnwTDlPDjIrT cARQatiC/EyhP1hxB4HSNHjKSpsTrHdgUQ6dvxjKjtZ3KvppvOkASDzej NbAdzgMmMiKPn1sWK+iBFN6gDx2DnjiA1+XAyDS1CscM79zA20a42Ypz3 T2pMUYVi9AXdlnpbgBmS1dGBTuO/TRGc1HPPJ13dLy5dSwZ7u4+46P5ua cl/44TRcDLY1/IBKaocvKMh+aYL/NKVnQ6dGOdWpJe2dHhxxEEyq1HDAE VU7HTDsyYLrATQU+ZbNuKz7F99aEPMAXBxSUM+3BJeCJy0jFwtmT2oWRr g==; X-IronPort-AV: E=McAfee;i="6600,9927,10910"; a="12063772" X-IronPort-AV: E=Sophos;i="6.04,239,1695711600"; d="scan'208";a="12063772" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2023 08:46:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10910"; a="745705348" X-IronPort-AV: E=Sophos;i="6.04,239,1695711600"; d="scan'208";a="745705348" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga006.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2023 08:46:26 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1r8kBD-00000000kVt-24gm; Thu, 30 Nov 2023 18:46:23 +0200 Date: Thu, 30 Nov 2023 18:46:23 +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 v2 10/10] gpiolib: remove gpiochip_is_requested() Message-ID: References: <20231130134630.18198-1-brgl@bgdev.pl> <20231130134630.18198-11-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231130134630.18198-11-brgl@bgdev.pl> 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, Nov 30, 2023 at 02:46:30PM +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. ... > - cpy = kstrdup(label, GFP_KERNEL); > - if (!cpy) > - return ERR_PTR(-ENOMEM); > + scoped_guard(spinlock_irqsave, &gpio_lock) { > + if (!test_bit(FLAG_REQUESTED, &desc->flags)) > + return NULL; > + cpy = kstrdup(desc->label, GFP_KERNEL); > + if (!cpy) > + return ERR_PTR(-ENOMEM); You just introduced these lines earlier in the series, and here you moved them again. With guard() instead it may be kept in a better shape. > + } -- With Best Regards, Andy Shevchenko