Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5425079rdb; Wed, 13 Dec 2023 08:16:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMg4wOytyMo7ML9pvvyc9XoRe6s+6Cncjn1C+NbSEULZw6stz9O1xcShfjpOeDSh3658zY X-Received: by 2002:a05:6a20:2927:b0:18b:960a:efc2 with SMTP id t39-20020a056a20292700b0018b960aefc2mr3892626pzf.10.1702484183948; Wed, 13 Dec 2023 08:16:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702484183; cv=none; d=google.com; s=arc-20160816; b=mck77txS3AbFvDJuJKTa3ycmQ3Q/2Kls3eN6FPHcZKEEqOHHqneZdmA5mxstjPTyqY ppAX0vYqleDirh37ttjg5zseSOXQyb49Uowo5PlH8cHgszkAzv7Ep8+w6rDvc97RnJQb OuPbfhvs1gYYH8x1esXUcnzHklEJaczX1z3VKWL6zUIlNT82vOJaAENyzcZI1dZoaqka nCXWye6VD3mP00giV0kFKRzJe/qKpYkc/QDGixDXM6L2Q4fdJiaE9jeFXXfQcEPn3f3F K06K2sIkdw6JxRGht80I7BpRu0m9oE9/p7a8EPR0aAxSMaNvGtvFCYp8O5leGCaibonn fQUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=j5XWSXMuQI8BI27DjafZ4lKITNNCK67srbDQ/z6mcEI=; fh=zVDxrptoeZ9MRfn7koif1R2qpCu1LNNm0XkfV9+WS24=; b=DprK+WELxTG72hJugDpUZm08nk2jqD24Q1KcUW2Q1P++T6Q0P5nkZ+u2Vppg4ccRIG 1h9Et2t/hcEQ/vqThFn4/uiTBNuTzSg9fkl3ioJokivazspbwkgD2GzV2cIRXpp2tEfU 3wc8Op8yzHnp7dr8QOmtMC4Ign8TfrVCqPqOMEsicDRk/qBL1IscQT9Jl6/rHAYR+oA8 m811gVfNULiBG9PHMktZSZ/5FM8jvd1okaG0pDJCACofHmYXrLFdJtswFBck6uvdceqV Fww/O+uBvvSDgWjLMsEskfN5a2Ub3PO0aVRyVKKqPnbxZy7hXGow38zWHcibaF+/uUfs 5uZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=jAqjbAhu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id d18-20020a056a00199200b006ce51863712si9890971pfl.330.2023.12.13.08.16.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 08:16:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=jAqjbAhu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 97403807385F; Wed, 13 Dec 2023 08:16:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377779AbjLMQQJ (ORCPT + 99 others); Wed, 13 Dec 2023 11:16:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378934AbjLMQPo (ORCPT ); Wed, 13 Dec 2023 11:15:44 -0500 Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 824DF181 for ; Wed, 13 Dec 2023 08:15:50 -0800 (PST) Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-20316647099so873229fac.2 for ; Wed, 13 Dec 2023 08:15:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1702484150; x=1703088950; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=j5XWSXMuQI8BI27DjafZ4lKITNNCK67srbDQ/z6mcEI=; b=jAqjbAhu40L8XpY/FnbgTCGqyAnN+HRcEw5P40Dqg7bWwuvWF1xU/Wwp63kLyg39wv nLB9iSgeytjhW9kT1P0Y6/ewNFM+KJ96lOtDcLcRFWQI82v/WCMUG1p5mgLQ6785rfGB p9gsnmZBhkIIWTnqcOaPBSSkyb9xSGogB1yzAmb0M4OO2MhVYDruQoRuwNPiPIt01cft 5Aor9lLApHt4ihRXGlpL1lReFl36pzAbT916UOidrXNwhmD1OfGu3zTgWh86JsVy6FT8 IFC/DfkOon7MmaljykrHf/sbNuL4zBzDlcRgknOiAvcikpVZU6EaeB84ZPf6NGnxE0cF YgFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702484150; x=1703088950; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j5XWSXMuQI8BI27DjafZ4lKITNNCK67srbDQ/z6mcEI=; b=aozU1qEXxc4UCqeS3ZYYBrVoZH/RnF66fKCpNTJoes7UCRFAZheiF5Uf3Xl/o/mgsE Tu7Z16Pdw4ovURuH3cwkTU5TKT5x8aRGEiZcGvnQY9Rquonj/dORJKf+HlpEW+vL/VwF y3CM5IHtkjJj2ZmkJIQcl2qGNLxA6R8ig9em6HkK3L12i6W72GeMGBIu2V7J1E+Wo7ks 8Waehy2J68D14/fx+sTMe6tWBaC/RGolNFKLJejXmX45bpKevx9hxlqlDx0NoU+nXvob YqFmZw4X1uIdoNCqBMssXSd2JRShymCTVuTPbLDa5GY4WupMMlsjsVCzN9o1zpfBm5md RQsQ== X-Gm-Message-State: AOJu0YxWoZhLOsgzEDOJO+O1elMksSqCnKemfR4c9jY8XwgeFm6JEGuc f/t1InQdNH0Vy4D3WuOWoHkw4aI7P2rDPF8aBwGq1Q== X-Received: by 2002:a05:6870:392c:b0:203:13ec:ab01 with SMTP id b44-20020a056870392c00b0020313ecab01mr2449120oap.86.1702484149882; Wed, 13 Dec 2023 08:15:49 -0800 (PST) MIME-Version: 1.0 References: <20231212054253.50094-1-warthog618@gmail.com> <20231212054253.50094-2-warthog618@gmail.com> In-Reply-To: From: Bartosz Golaszewski Date: Wed, 13 Dec 2023 17:15:38 +0100 Message-ID: Subject: Re: [PATCH 1/4] gpiolib: cdev: relocate debounce_period_us from struct gpio_desc To: Andy Shevchenko Cc: Kent Gibson , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linus.walleij@linaro.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 13 Dec 2023 08:16:21 -0800 (PST) On Wed, Dec 13, 2023 at 5:12=E2=80=AFPM Andy Shevchenko w= rote: > > On Wed, Dec 13, 2023 at 11:59:26PM +0800, Kent Gibson wrote: > > On Wed, Dec 13, 2023 at 04:40:12PM +0100, Bartosz Golaszewski wrote: > > > On Wed, Dec 13, 2023 at 3:27=E2=80=AFPM Kent Gibson wrote: > > > > On Wed, Dec 13, 2023 at 03:54:53PM +0200, Andy Shevchenko wrote: > > > > > On Tue, Dec 12, 2023 at 01:42:50PM +0800, Kent Gibson wrote: > > ... > > > > > > > +static struct supinfo supinfo; > > > > > > > > > > Why supinfo should be a struct to begin with? Seems to me as an u= nneeded > > > > > complication. > > > > > > I think we should keep it as a struct but defined the following way: > > > > > > struct { > > > spinlock_t lock; > > > struct rb_root tree; > > > } supinfo; > > > > That is what I meant be merging the struct definition with the variable > > definition. Or is there some other way to completely do away with the > > struct that I'm missing? > > Look at the top of gpiolib.c: > > static DEFINE_MUTEX(gpio_lookup_lock); > static LIST_HEAD(gpio_lookup_list); > > In the similar way you can simply do > > static DEFINE_SPINLOCK(gpio_sup_lock); > static struct rb_root gpio_sup_tree; > The fact that this has been like this, doesn't mean it's the only right way. IMO putting these into the same structure makes logical sense. Bart > > > > Yeah, that is a hangover from an earlier iteration where supinfo wa= s > > > > contained in other object rather than being a global. > > > > Could merge the struct definition into the variable now. > > -- > With Best Regards, > Andy Shevchenko > > >