From patchwork Tue Jun 30 13:33:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 192089 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3822761ilg; Tue, 30 Jun 2020 06:34:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwA3MHzDjmA5MR770Rfu/Gc1Z60DK91kJ/G9a6b308XPJ0V0XqCbqJMZdQgSu4DiNpocHW/ X-Received: by 2002:a17:906:aac9:: with SMTP id kt9mr15365013ejb.488.1593524069171; Tue, 30 Jun 2020 06:34:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593524069; cv=none; d=google.com; s=arc-20160816; b=WGjMu2Ik32ePJDD5eXyMLf9W5PRMoeF+8R0/iH+FM2YyGn6n3i1+VLhMgzywRY0gFZ tAfBOvSTHEV7X/j5np9q7Kttc9s8kJKs/cM9oOSLySwr71a/KhNqw1zyJzZCdGAuVIa3 0JP8UawSANWtW6P5Jyu3w853okgLSXqDkIbGvH5MmGSTvaO72dpWiMNCIgkIVS66N/yS XvWhlcNQFI0bn7xcmcJd6qQcwOex+Sq7mpJ2h4mLxszqFyLC1UHA4B9LIZ07Jabtxn9S 4RQB9echBybGz98DJczNVnGJZOcTnCF8yWzh84C20x5qmP+S2vP9a/06guIsnqJ2G1RN ghQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Aqos2NxgL6TqV6vtAHFj09o8FM67bpNGP+lJI0qHUic=; b=C5evAC0e3szUKvB006uZPCgQbG/z9kW1W1clYyQY8entqgVqgqgdX8OBlvZ4OZff79 NcAynATrHXSPWwYDIgkkFfojPh7030fZPcw/YcCZQBJ8zoPhUDsY32AA91czsm2QjVDu Be8CHxevVMKyWWbmB3qCFKBtm66lgzPNnZ9+kTRiCFYDfozjw7+Vn1N5xbYxQObAooh3 Y4XrE5K1Cu5iAzJAjNjiFg9LeUw1EPv8qOaIoFg1bpLBaO5xo9TLwQqA51DnnGFTPWKr LTdizCwu0Bdv3Tw47QuQh1oj2zayqGn09sPFW6WWtZZJA2m48UDK//9SUhvrZypTtpCS rIog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tUr7wg3W; spf=pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id re20si1789653ejb.31.2020.06.30.06.34.28; Tue, 30 Jun 2020 06:34:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tUr7wg3W; spf=pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732879AbgF3Ne1 (ORCPT + 5 others); Tue, 30 Jun 2020 09:34:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388188AbgF3NeC (ORCPT ); Tue, 30 Jun 2020 09:34:02 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EB87C03E97E for ; Tue, 30 Jun 2020 06:34:01 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id z15so8920569wrl.8 for ; Tue, 30 Jun 2020 06:34:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Aqos2NxgL6TqV6vtAHFj09o8FM67bpNGP+lJI0qHUic=; b=tUr7wg3Wznr91hdBXq50eNTGAccm33bM6tBl1CH1AYKPp7JvNXSuZ0fLootAup+nLZ 7xkoMJq1lUn19jzjKvVfTuaHmloQm+V871dkMcRy9T/bH3j7+hJYql6Pv+wj15mhtdHE z+p3HQuk511W60JvRiiE4ZaHUMC3YYw6cpfddvAPSL7oz94GQ5JxL/eIwpYYN7AI7zER 02C7um3AfjHlBzqoZ7eQY2pLhJAu4hgYRRVaj6miRKRa0ZaL2ZCGcKELxqLOX9qJJhcc kU1S0ht8R33R/0IqyPDqJyOcr1Rc3GifN2tOTQKD40fTDw1T9liHtszfTp2Uvn3pJlru HMeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Aqos2NxgL6TqV6vtAHFj09o8FM67bpNGP+lJI0qHUic=; b=WBpfl2CUbuBTkDAfmgN/HgEhfT0O+4Txma16EA5EUfq4jrlpcgHBc3MeMAWlG5iGI7 JNwPDPdKcYFWOW44CNZ4iubGwnxiSs/hbEG42krpJF+C/Dk0QP4i251frr3SmKFkS8/g plQm3+A8C0QpyGx4b99ZxNR0pus67W8AAEHyhs9K6idcKPB+hpWU30S2ul1sAjXmMC4w b5b3olrD84G8D3qxaWcWzl43A4EAm9klYz3hZA67CtYcTre+TVXyVvDRItqC53vfQ/io n2kWIfnPJ4F55oQaNoBMEN4xtukucf3ZVPIxsfr8ay3UhddmqYm3LPPE9YGNH2bFpaxS 4gSQ== X-Gm-Message-State: AOAM533wfPO23oiArj5cLECEQYon9d09RrgpYGMkGNhzkJwEQgJ62hBd uhqREm7FKxgLd+m+F2cfPG5smA== X-Received: by 2002:a5d:68c7:: with SMTP id p7mr23139275wrw.16.1593524039424; Tue, 30 Jun 2020 06:33:59 -0700 (PDT) Received: from localhost.localdomain ([2.27.35.144]) by smtp.gmail.com with ESMTPSA id z16sm3682464wrr.35.2020.06.30.06.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2020 06:33:58 -0700 (PDT) From: Lee Jones To: linus.walleij@linaro.org, bgolaszewski@baylibre.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Lee Jones , Asmaa Mnebhi Subject: [PATCH 10/10] gpio: gpio-mlxbf2.c: Provide __releases() annotation to stop confusing Sparse Date: Tue, 30 Jun 2020 14:33:45 +0100 Message-Id: <20200630133345.2232932-11-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200630133345.2232932-1-lee.jones@linaro.org> References: <20200630133345.2232932-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Sparse cannot peer into other functions to see when and if locks are acquired and released, thus it simply warns that a 'context imbalance' is detected instead. Let's be kind to Sparse and let it know that this behaviour is intentional. drivers/gpio/gpio-mlxbf2.c:125:12: warning: context imbalance in 'mlxbf2_gpio_lock_acquire' - different lock contexts for basic block drivers/gpio/gpio-mlxbf2.c:151:13: warning: context imbalance in 'mlxbf2_gpio_lock_release' - unexpected unlock Cc: Asmaa Mnebhi Signed-off-by: Lee Jones --- drivers/gpio/gpio-mlxbf2.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.25.1 Reviewed-by: Asmaa Mnebhi Signed-off-by: Lee Jones diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c index 861a8d0a84be0..befa5e1099439 100644 --- a/drivers/gpio/gpio-mlxbf2.c +++ b/drivers/gpio/gpio-mlxbf2.c @@ -149,6 +149,8 @@ static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs) * Release the YU arm_gpio_lock after changing the direction mode. */ static void mlxbf2_gpio_lock_release(struct mlxbf2_gpio_context *gs) + __releases(&gs->gc.bgpio_lock) + __releases(yu_arm_gpio_lock_param.lock) { writel(YU_ARM_GPIO_LOCK_RELEASE, yu_arm_gpio_lock_param.io); spin_unlock(&gs->gc.bgpio_lock);