Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp292386rdb; Tue, 19 Dec 2023 17:51:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IHsEyqkoAQ6yxRUkM6bXW+NO9Z+oHQVWAgadiRADVijxu28FZ9UoqiSeDpbw4BtGZFuSY1C X-Received: by 2002:a17:906:92:b0:a23:6265:f3b3 with SMTP id 18-20020a170906009200b00a236265f3b3mr1805294ejc.51.1703037092516; Tue, 19 Dec 2023 17:51:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703037092; cv=none; d=google.com; s=arc-20160816; b=ERsrmyWVFTAMR5B5DL54uENhoh4UxsoE0Bm3Ves7UnaMM8IFgbyVcmI6rNXCpsahP6 uNLxW8WnyhgLtngm5B/Na1VN3CnSj8dAnB2/hk0fixbXmt/pg/mjRCjbeczlhJIiod7E OsUiB1KSmoLLDcdOv+oUqIziylkX/j32hDMiJ9GATODwc+xGYmjiGEoiqdKUi9oUuDyG JxksqnjQqIYQi9Oeo2CBiU9IGJ1HzuJXQxj4tmogc5W8a8pWmY0t4b7mhTJaAb5vSBEg ajr/yiwqfFtDke2jJsQWckQvKjuyXc5GyO4kxmxxkOy4s95+NXL42jy/7m33xakcBrwk bJ3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=W2rAgpDBZW7ef2pt8PKnHiTbIJVIFNinygdxFgXy9i8=; fh=GNOA1jdeAuH+tfAEzFx15vIukVGFZnqrW9xHApUHjl0=; b=JUL5CM7PPR0+8sWG4nGhjnXssPfh5u+t/84s1/VkVqqPfgHc0OJSt5Lr0m83Gi+nRi O62ab0fP3diHAfRW+8jNR+5TSStRqbjVlxcTduq3J4ZJtY++fgAKFb+GL62JQ7E8xuls DAqzpNC+BpjQZfvtmjnmcRLgQUx5MCmbYFIEOgp9R3M2upir8HxObFYy9y+Yy4SZXXFc O1fXYb0HJd51daue1kMMCQMi/EZ5ja0XgpqEA/ARupQzHEGDiWqgABGKVSclnQselqub F6Oc21M3ySikz29YNnl7Uo0keH4iuJwkZPLLh3Zdmflb3yw+ZxOHhP6kZxpkNeQL8A0p uZJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=AFLGyrur; spf=pass (google.com: domain of linux-kernel+bounces-6266-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6266-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id bm6-20020a170906c04600b009d464ba0b23si11417981ejb.111.2023.12.19.17.51.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 17:51:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-6266-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=AFLGyrur; spf=pass (google.com: domain of linux-kernel+bounces-6266-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6266-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 15E1B1F26775 for ; Wed, 20 Dec 2023 01:51:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A33F07497; Wed, 20 Dec 2023 01:51:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AFLGyrur" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) (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 944BEEAC9; Wed, 20 Dec 2023 01:51:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-3ba2dd905f9so3448586b6e.2; Tue, 19 Dec 2023 17:51:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703037082; x=1703641882; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=W2rAgpDBZW7ef2pt8PKnHiTbIJVIFNinygdxFgXy9i8=; b=AFLGyrurjnkurSm17auE/cuq+J3fik+5bObr4KGxpa7NQ/NaRDvCnpOfrHIBVLK8CS lYJCFhRSEWcVswN5DL+0PTfq6ibruU7gKnr9zrf6MeTUhFkFCtDnLRykdpVX4+kJPDEP kTRLKZg21uUag6c2rsP4sE0lEOrOh9bc65QqQkOVfPbuLIiKm7VSNtBsplcIhUFYuibC Nyrxc9RwuhLHO5KwuU6IZIwxTADr9XVP2smhHGba8IaNc1llMNP2dse/TCvG2ebNchPk kSBgfa3lQ6BYGQO0+yCgfQAXwTzM2FKUM7A+62/X8ylz3FbJcGIslrWGnLEM6Xb7KQ1o Uz4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703037082; x=1703641882; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=W2rAgpDBZW7ef2pt8PKnHiTbIJVIFNinygdxFgXy9i8=; b=IcMFSka0SX/tFTflFHV485QqYMwCTOQ7JXqNKjfuD0CZVZHtVju3vdaMUvjOOx6l/w l3k6fPfwjLmOQmZr2q1vkh82cNS611khxPP8UoIwnFskApHuGod1zefQIb5SCm1eBoLr vVQa4Ivp8VyxhqpoM3R7rITQiaYACvOP4BzYd0gCRc6g5nNH2//e5PYzjKFPvwQF+KrB 8GHjmM4PSLCPIm5AjV9m4kJ/gvC9HWevYGch2nTfkOG/v2kVvOp7yCsoULx0+VjICI4P A8FshWj5NQtHcO/01profXg2nG5l/BtZr9mkuChQdTKkg2DGWl7EBQSFFaYA2Ac8VhsY fCxg== X-Gm-Message-State: AOJu0YwGrrt7JrPRemlAnrHAHrVVLuVmyJg2TatsmkXo9nLTFq50W2L/ R3FBetdJN49BwkIwNk7kwPsxCrHUL18= X-Received: by 2002:a05:6808:1a16:b0:3bb:634f:66ed with SMTP id bk22-20020a0568081a1600b003bb634f66edmr2139784oib.11.1703037082448; Tue, 19 Dec 2023 17:51:22 -0800 (PST) Received: from rigel.home.arpa (60-241-235-125.tpgi.com.au. [60.241.235.125]) by smtp.gmail.com with ESMTPSA id c17-20020a631c51000000b005b92e60cf57sm20133208pgm.56.2023.12.19.17.51.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 17:51:22 -0800 (PST) From: Kent Gibson To: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, brgl@bgdev.pl, linus.walleij@linaro.org, andy@kernel.org Cc: Kent Gibson Subject: [PATCH 0/4] gpiolib: cdev: guard tidying Date: Wed, 20 Dec 2023 09:51:02 +0800 Message-Id: <20231220015106.16732-1-warthog618@gmail.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series contains some tidying up of gpiolib-cdev following the recent adoption of guard(). The first couple of patches are minor fixes inspired by recent submissions and reviews for gpiolib.c. Patch 1 adds a missing include. Patch 2 switches allocation of struct linereq from kzalloc() to kvzalloc() as it can be larger than one page - even more so after the recent relocation of debounce_period_us. Patch 3 tidies up the functions that use a guard on the linereq config_mutex. Patch 4 tidies up the functions that use a guard on the gpio_device. The new guard macro definitions probably should be relocated into gpiolib.h, and I'll do that for v2 if there is a general consensus. I also note that gpio_ioctl() is NOT covered by a guard to inhibit removal of the gpio_device. This looks like a bug to me, unless there is some higher level locking at play that I am unaware of? Cheers, Kent. Kent Gibson (4): gpiolib: cdev: include overflow.h gpiolib: cdev: allocate linereq using kvzalloc() gpiolib: cdev: replace locking wrappers for config_mutex with guards gpiolib: cdev: replace locking wrappers for gpio_device with guards drivers/gpio/gpiolib-cdev.c | 263 +++++++++++------------------------- 1 file changed, 79 insertions(+), 184 deletions(-) -- 2.39.2