Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6796169rdb; Fri, 15 Dec 2023 08:31:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IERYXkwS25NjFNec5fA72qX3VmMGVSOCkrKS1cCTo2kBRbvpjDQxSrAw4VwCe0hl3ZmvGbY X-Received: by 2002:a05:620a:454d:b0:77f:3740:8e50 with SMTP id u13-20020a05620a454d00b0077f37408e50mr21832568qkp.74.1702657876412; Fri, 15 Dec 2023 08:31:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702657876; cv=none; d=google.com; s=arc-20160816; b=bwMSio2LMG9KwfZPxx9KffdBnU09EkoMSKLwFN1zlI6Yn40ebsi7jCLYZwPGZu2xES ykwc1Gu4LzK9/M86FWNDJr7qZa5lULT47+PBwznL1A5V+TzL07hifUVe9p+t5liEWrFO qWOebE/A57WN7RGMEzmFyPBBvErV73hkGk+eys+5M4AczTQcnAxCv+nFNR7vFUOn7/yi iu11UVatct4wOdVDJtbUO6Hnqt/Gf9TCBbMUunW7xkKXX2FBi/iMuD8NFc8HDGMwrqPz k+wDXE3Y0VzmHNEJOShMV6McHFhAk510FU6PmUme290yPQ20+cn/7+4h2MGwvMBsmwhg UGpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:references:message-id:subject:cc:to:from:date; bh=E+b3L6sERRBkH3SWTnGjMOvLVDVP0ilBcQKMC2IC8y4=; fh=gWgQkwRx1pRN6B0a6aHplanYDEUMdd1fFwHIg8IIY4Q=; b=BKMCSSZyWiwq4bA2uE7M1glfK4HbebsBVw4ynKqWclCEcapcdWRHyWtDb1ZtV7D1j9 zAbH3LHswN8Tw7O38EqQvQ/kpwSZj+oKkszBjpcIJMtoIrKom9/3fIImT7Mbl0YOWmpI vKaV7OXL2n0JbMpqt0KbV32PzbPnavfGHXVmNfLk4ml0Oq8wk9h8SI6xt8erCXgonsc7 xamdTbEV0zr9twc35ujqKwMiVAMtyTnMO4w7k1wg08FkXyupnNFhKwqd+9DP+HTPgwGW izqnuogXshFYVP2Hq4WNzb81Onb8R4TSkMlK6HAVsFT+FatIK23uNps1KiajKZDBzvrI nU7Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1298-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1298-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id s21-20020a05620a29d500b0077d89d75189si17600567qkp.398.2023.12.15.08.31.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 08:31:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1298-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1298-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1298-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2DF131C2198F for ; Fri, 15 Dec 2023 16:31:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD5973D393; Fri, 15 Dec 2023 16:31:09 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E230FED4; Fri, 15 Dec 2023 16:31:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=kernel.org X-IronPort-AV: E=McAfee;i="6600,9927,10924"; a="394171609" X-IronPort-AV: E=Sophos;i="6.04,279,1695711600"; d="scan'208";a="394171609" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2023 08:31:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10924"; a="840713621" X-IronPort-AV: E=Sophos;i="6.04,279,1695711600"; d="scan'208";a="840713621" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga008.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2023 08:31:05 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rEB5a-00000006AWR-2XWd; Fri, 15 Dec 2023 18:31:02 +0200 Date: Fri, 15 Dec 2023 18:31:02 +0200 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Kent Gibson , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linus.walleij@linaro.org Subject: Re: [PATCH v2 2/5] gpiolib: cdev: relocate debounce_period_us from struct gpio_desc Message-ID: References: <20231214095814.132400-1-warthog618@gmail.com> <20231214095814.132400-3-warthog618@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Thu, Dec 14, 2023 at 10:06:14PM +0100, Bartosz Golaszewski wrote: > On Thu, Dec 14, 2023 at 5:41 PM Andy Shevchenko wrote: > > On Fri, Dec 15, 2023 at 12:14:41AM +0800, Kent Gibson wrote: > > > On Thu, Dec 14, 2023 at 05:09:01PM +0200, Andy Shevchenko wrote: > > > > On Thu, Dec 14, 2023 at 05:03:03PM +0200, Andy Shevchenko wrote: > > > > > On Thu, Dec 14, 2023 at 05:58:11PM +0800, Kent Gibson wrote: ... > > > > > > +static void supinfo_init(void) > > > > > > +{ > > > > > > + supinfo.tree = RB_ROOT; > > > > > > + spin_lock_init(&supinfo.lock); > > > > > > +} > > > > > > > > > > Can it be done statically? > > > > > > > > > > supinfo = { > > > > > .tree = RB_ROOT, > > > > > .lock = __SPIN_LOCK_UNLOCKED(supinfo.lock), > > Double underscore typically means it's private and shouldn't be used. Right, but when you have a struct you have no other means to initialize this directly. > > > > I even checked the current tree, we have 32 users of this pattern in drivers/. See, there are users of the __ initializers. > > > Ah, that is what you meant. Yeah sure can - the supinfo_init() is > > > another hangover from when I was trying to create the supinfo per chip, > > > but now it is a global a static initialiser makes sense. > > > > Yep, the DEFINE_MUTEX() / DEFINE_SPINLOCK() / etc looks better naturally > > than above. > > Yeah, so maybe we should use non-struct, global variables after all. At least this will allow to get rid of (questionable) initcall. > > > And I still haven't received the email you quote there. > > > > :-( I'm not sure we will get it, it most likely that I removed it already > > and it has disappeared due to problems with email server... -- With Best Regards, Andy Shevchenko