Received: by 2002:a05:7412:d002:b0:f9:9049:d2ea with SMTP id bd2csp53276rdb; Wed, 20 Dec 2023 03:56:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHoS7WNiN4Vx0JkuKFPGGOA/TJbDnf392FfPojmcVEIP0X3pZOpOAjp7EK0gv+npKTf8KSr X-Received: by 2002:a9d:4b06:0:b0:6d9:d87c:3633 with SMTP id q6-20020a9d4b06000000b006d9d87c3633mr19069010otf.56.1703073376510; Wed, 20 Dec 2023 03:56:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703073376; cv=none; d=google.com; s=arc-20160816; b=v6VMD5jb0T14/fnx0Xxlc5yNS3/booZIXFugdTZ3+1dfEkr65cyLBSBZ/bJ/DTiZBY ypYcnxl+ac/lFglhI3VOi+YUjE5YT/V3yQriC7r5r2d+/ypxomgZhLNRGwS4QCM6gU5s uN/e4z9pUDfJOzR4XFDL5qyRxAd1/SATzDuJo0OT7ztKFwIF8So+d9f9YqTy3tj7qjgj GO32ASVr2tGtOdYgo43TtuOksEMx7a25X3FRVBIjN7LXgMp98zgsco50/kihaYGSmncn E9pVuIY/aH3GF5ja7J8luWnBkF9tKkxnZujnOrut6izMgNh5929WL8yrOBnO2XiFHV3P unjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=HoU9Jsp7eaiJ/AocK9g8uZTZIG/z7L3SRiAFrDPyw/I=; fh=JvfyXho3ZGZPzSyE8oh8LetuM8USeqU5EGmpKjBGpy4=; b=r2GB7KMh5SUUOAUbwPjLtgYj3z9m/Naw0XeHwS6QHxKnhdSIeF2BrmC/icW5w46x0e i3BtsWQdHJ4vJqAqd7kW7JfRdDdO6h3diQpqi72g80Snq8Mmayox3yIwdigK5zUXTzJ3 Ody7rNklZxDgOAh+/lA+NsTfnhFME0vUyLsn0+2xhCIQyUmuRUCTMqs+O7VVJNTAI5M6 mMtVbW/ky4y4i7cdmsCByrjdZNWYfUhm8z3dMun1nToEYhlGV1eIEPz3TdT9XuA7kEZJ ehAQRL+24pdQnMzYyxJqFJU9lK4lHdwVg25XOA0xKp7ERdPeNy78lgj/CJK+AmFk4MIv 2Wbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aZCFzj3L; spf=pass (google.com: domain of linux-kernel+bounces-6854-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6854-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s16-20020a63f050000000b005cd7fc2c654si824320pgj.459.2023.12.20.03.56.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 03:56:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-6854-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aZCFzj3L; spf=pass (google.com: domain of linux-kernel+bounces-6854-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6854-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3DBC9288FC0 for ; Wed, 20 Dec 2023 11:56:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 15DF221A19; Wed, 20 Dec 2023 11:56:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="aZCFzj3L" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com [209.85.219.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA34E2232C for ; Wed, 20 Dec 2023 11:56:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f174.google.com with SMTP id 3f1490d57ef6-dbd4608121fso2594089276.0 for ; Wed, 20 Dec 2023 03:56:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703073361; x=1703678161; 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=HoU9Jsp7eaiJ/AocK9g8uZTZIG/z7L3SRiAFrDPyw/I=; b=aZCFzj3LMVCB1ysxNChD+IjYxypcHEwIduKzZhK2s2qmn+7sMfbuM5cQhV6KsDHCJp OfT7FNGDRQ4TEDGQjDuddJkI0kSc0RPJ608SNcCfkBfuTh1RBvb6OifDmbAOVJfV3yuq 8/ThSNLxA8xHqFZYIzJwerhfVvg+Q8+P+Rd/tLttx81O04AIWocKZad6IwX0mKW2aWKo d7fciy2HLEEShRRAVY6hJ4PelaeYCiqggPZwZYXB6hzouttoIVmKv9fijiqB8LTVJsQD JRlCf7eVmzVhDV3yUMgLsMhqaLGM8VuORKoQ/+7rc7mddAcZjqZAFDqaaSw0Y7sJTh2F hT/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703073361; x=1703678161; 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=HoU9Jsp7eaiJ/AocK9g8uZTZIG/z7L3SRiAFrDPyw/I=; b=Wn4E8IQlmCxSm1NRZRhRn8s6xiBA0Ht9IG4f4W5/Pyc2Isc5LRHcafusRiwvsxN3zz 1ceQapv++oLYm2jxHdIvbfrC0e2MlykH8P6oJt2csqp5AhQVuVxh6ovJnPsmDyjdyZOg QyhtFfYkfwRB8XhL6bkdJYTFa715Ir/8AsAiMLonDQ9ggfV8h7LK/skEznm1y9qGfJHK FcM8FKVFcfB5q3TRhqDd4KP2G/ehscDbKi3so1AuPS7A8QaWVCVSti75pENiWghnC6zt tZhYmcM6/BZ12E3Rd/csN1m/gxxBC5BxEdkWhU1E0oifhQLrDu5lnIHzDv0G0Lc44l2y qygQ== X-Gm-Message-State: AOJu0Yy2HH2e9XPriQ+hFZrvzGGWgA4YyYn8G+yaQPns7Yq5RFhEBH1U ret37Egoc3/NCTn+ikiUTIiGDyPfCqcpk5472NAvwm9t2VZ+7sG9 X-Received: by 2002:a25:aa2e:0:b0:dbc:d38f:da48 with SMTP id s43-20020a25aa2e000000b00dbcd38fda48mr6920174ybi.28.1703073361472; Wed, 20 Dec 2023 03:56:01 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231220015106.16732-1-warthog618@gmail.com> <20231220015106.16732-5-warthog618@gmail.com> In-Reply-To: <20231220015106.16732-5-warthog618@gmail.com> From: Linus Walleij Date: Wed, 20 Dec 2023 12:55:50 +0100 Message-ID: Subject: Re: [PATCH 4/4] gpiolib: cdev: replace locking wrappers for gpio_device with guards To: Kent Gibson , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, brgl@bgdev.pl, andy@kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable (+PeterZ) On Wed, Dec 20, 2023 at 2:52=E2=80=AFAM Kent Gibson = wrote: > Replace the wrapping functions that inhibit removal of the gpio_device > with equivalent guard macros. > > Signed-off-by: Kent Gibson (...) > +DEFINE_CLASS(_read_sem_guard, > + struct rw_semaphore *, > + up_read(_T), > + ({ > + down_read(sem); > + sem; > + }), > + struct rw_semaphore *sem); Isn't this so generic that it should be in ? Otherwise all the patches look good to me. Yours, Linus Walleij