Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6050354rdb; Thu, 14 Dec 2023 07:09:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMUXKFGo0pNS6QCe7+qKheEJB9MdaKIpljusnGcKkgfBjHU4Nzp2yMnADZ+ApchrWlDnqz X-Received: by 2002:a17:903:32c8:b0:1d0:5806:f45d with SMTP id i8-20020a17090332c800b001d05806f45dmr10870834plr.42.1702566570863; Thu, 14 Dec 2023 07:09:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702566570; cv=none; d=google.com; s=arc-20160816; b=xt8e2FyEucubeltk4HiIM0Sc1KFx/lJeoZ0YmerykYG2FQ5+666YATcaoTZuVkFcz5 1ju26KM4xlOvA7tyfpR3dW2hFFGGcQIaq2/UviSMNlsK91D3JMONmU4sq+o5+J5wfMey btiRupiH9dki0/B52o892ULVzXavkxlgiflSi8AlBPHBGffhRo7AhFCLi2pnyZGY03AA fU998GPz5hOdMRxvg7CmCFni0x/NDPNPiiTfX8ocAlilfzFtIdu0BV4zL93TqqHqPESV XwGU61UuG8RReCPtuBHTnccnLD3USt5kjXSPVdQkRaJx5OpqmV5So3cISEXlxW8SIDkn YaBw== 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; bh=AfzpLL5ZHzN0URZzYz6ny+t8XCG5IigNGGSYeTKR0L4=; fh=BiTih3HBn05OJvpBeKJCJhFgvirybBPBq65CdTV6sMo=; b=a3e+/8g87ITm30q93owNKiON2pd3y73U2Ag5LfjaGXrj8IY+YhkUOW9/mu/vhGm+rT 2Bfu1Z9jT9QDMku41slyYtH26lxl5FMLpZK+Q3UAJlMdTZSAUPw+R/rUVh+vo479gXZx yZoEBASUGCH9XbAJAbHwFLtOVMtPzjz2knYIrz81em4tV0P3ujEZjQ/a9VH0cqwt/J94 nRz2wzXPDXghWaZjM8XkudoHMyfT/r+hGCOqfxuD2J50IXHZE4YHhcA95jOaNKhm5n5l /bgrNhTIVq7a9NFrk6dXewxpEliYuJORexJQz4cn93pzOM+lC/+eIEVnKjtP/UrNJ6ZI 57nA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id x3-20020a170902ea8300b001cfdd05b5a3si11418338plb.434.2023.12.14.07.09.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 07:09:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id C5C5681C0C87; Thu, 14 Dec 2023 07:09:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573649AbjLNPJB (ORCPT + 99 others); Thu, 14 Dec 2023 10:09:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573642AbjLNPJA (ORCPT ); Thu, 14 Dec 2023 10:09:00 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E8438E; Thu, 14 Dec 2023 07:09:07 -0800 (PST) X-IronPort-AV: E=McAfee;i="6600,9927,10924"; a="2217992" X-IronPort-AV: E=Sophos;i="6.04,275,1695711600"; d="scan'208";a="2217992" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2023 07:09:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10924"; a="844740792" X-IronPort-AV: E=Sophos;i="6.04,275,1695711600"; d="scan'208";a="844740792" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga004.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2023 07:09:05 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rDnKg-00000005sHL-1OEJ; Thu, 14 Dec 2023 17:09:02 +0200 Date: Thu, 14 Dec 2023 17:09:01 +0200 From: Andy Shevchenko To: Kent Gibson Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, brgl@bgdev.pl, 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> 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 X-Spam-Status: No, score=-1.0 required=5.0 tests=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 fry.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 (fry.vger.email [0.0.0.0]); Thu, 14 Dec 2023 07:09:15 -0800 (PST) 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: ... > > +/* > > + * Used to populate gpio_v2_line_info with cdev specific fields not contained > > + * in the struct gpio_desc. > > + * A line is determined to contain supplemental information by > > + * line_is_supplemental(). > > + */ > > +static struct { > > + /* a rbtree of the struct lines containing the supplemental info */ > > + struct rb_root tree; > > + /* covers tree */ > > + spinlock_t lock; > > +} supinfo; Hmm... If I read the kernel-doc script it should support anonymous structs and unions... ... > > +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), I even checked the current tree, we have 32 users of this pattern in drivers/. > }; -- With Best Regards, Andy Shevchenko