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: 11633955 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 54DA113B6 for ; Tue, 30 Jun 2020 13:36:10 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 162AC206B6 for ; Tue, 30 Jun 2020 13:36:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nCmkopla"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="tUr7wg3W" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 162AC206B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aszNcjHcFF3T7Gm4JbPlr//d7JOPfnB7zigMe/q6fks=; b=nCmkoplaIjK7UNY0Lz/jiQAJ9 InRKWVugePBc1Nz0xIv+7tEtkDsltWG4oIy8ErHwigmpwYV0KgkkbabxmqXxqCGLsCbdCWjj4I9SW Uit5CM3r/+QA0psA6T72QXHOtgAG9VIGkFq/MsFkQmNcTo6MndWucSaTln+yED5XSgCVBwOsbf5xf 7+ffdcw/NQ+19AIoJthtF01uwpVX5KPNV/fK+A+bFiL8j4U8STI7eWm+pEDSYIpPdk1SLwrwYKkct 8MeK2Ly3jhXmzJXvJcLLIps0uu3Cxp6CcB5YYtZmE1hcskMhE0fOfX8zqFCN6KLUuuEj9CiW1X+hc FJcnyO4wg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqGPJ-0004V6-3T; Tue, 30 Jun 2020 13:34:41 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqGOe-0004FQ-Dr for linux-arm-kernel@lists.infradead.org; Tue, 30 Jun 2020 13:34:01 +0000 Received: by mail-wr1-x444.google.com with SMTP id o11so20199300wrv.9 for ; Tue, 30 Jun 2020 06:34:00 -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=qPh4inQlyI0fvkNDG7tfKu7FfyVUhhvpn60lCYtcHNUArYUmz7ZPXH5uvfFzA0Vsam i/GhxJCHLdeVROx9AIogr/Qp7yO0esNPJj4EEGzpMuM5XeHn/xHKleTSu19capFNOO/x IU/IRqdW1WAAo4XXVADcTX/nSrdVUk4zOfD/jYimgY/T3hJdcVZ3Xd0hDHr37ucVvrDN K0TLNdix8QvTKM0sSwvK2reUbjOvKljGCZd/eX3BlFoSGNmbMHg2kAH88i7WdJG0J3XC 2LPBep5z1blu/nT/qO7lY8pRld1ODajqOaXiQMRwptVyK8YAqCrR8JMbTizVKcFSDkHt RZVA== X-Gm-Message-State: AOAM5304T4NDEMT8NS/+7gn3rYJaPzNsLSLgTi15BMZdfZsJm2y8UGDk bMrqC17Bru0lJNIPWRwFy1l2fw== X-Google-Smtp-Source: ABdhPJx9WxsVZ5j6ppbW2LpfgLfGN/iYhXnS9SqvRlEbRO7i3cfvBgwP5qkADNjWMaQO/b1FJ/QXnQ== 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 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 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Asmaa Mnebhi , linux-gpio@vger.kernel.org, Lee Jones , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 Reviewed-by: Asmaa Mnebhi Signed-off-by: Lee Jones --- drivers/gpio/gpio-mlxbf2.c | 2 ++ 1 file changed, 2 insertions(+) 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);