Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2166939ybv; Fri, 14 Feb 2020 12:50:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzocnCN/c9KkO3maA/OnySSBp/JA90TinCaTi3MpztvchWsyGadg5WjCMqaDZf/8Mtzhb57 X-Received: by 2002:a9d:7ada:: with SMTP id m26mr3820524otn.111.1581713421527; Fri, 14 Feb 2020 12:50:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581713421; cv=none; d=google.com; s=arc-20160816; b=UCn99ks+UYN5mQP0T6iQuXaMTUATEVho49eGaWLT061ahgtDMci3A7E46U8Jn0VjHo ZFvVfpGSu/d5pXxGVFoPstvWhfUVsSVeTTxNDePa/C5A5rqaepzwFN4G8DSKmnxb75hb zgW01I+xUTVtFw+ALeQaLaQ9Xnf7x5oiJv6+HqI5LdH6ukx2vUlqFLsXMagNk6cEeoYz EK9MspUrcMFpUn6mvmfFDRC7BZAyvtwVk4AuNJMlckUYXIQR3EPCU7T9leFY8FWkngKw 8wf64u67yeQuJHt0OirfRiIE+49o5p8rbXdaSaZsWD8X7jdSuRrdnhyk9KAfsWunZVNI hbpw== 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=qDX7xlEByvANKkjxM9Lv4JgW0Vs/V0JakfLRr2ITPLY=; b=tAO8NXGn062S8dZgTLWbBzeCuV1mSrPzlJ5EkdbLVg/kqGfHl1+mN2dxaN3uFlGBp/ Dy0xTozue1fZsuq1g2g8m6yZrxaWxFwwIyg/Ai49Gn9uij93rmeqiA/47O9HGoJCNh6P PIzkziszVcEkbDHy195YcY2kQbR+3+mSqc1V5zIXp0dWxj8JEfim63hMX69burZz0PaJ izOcuAFR2JEKSthRYBSHLiIngIkrsux/MvK+ONTIBHmFNtCLsNvVF7oOfRBhNVO92OUU tMP0rzGtEt/IkHsS1Xh/p6RpEU4KIaSm6QE2WcxtQO5mPkw4ksnugN641DQLut1Yjbpm XcFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="UE6/SgkK"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p11si3653335ota.300.2020.02.14.12.50.09; Fri, 14 Feb 2020 12:50:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="UE6/SgkK"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389053AbgBNUtF (ORCPT + 99 others); Fri, 14 Feb 2020 15:49:05 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54524 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388570AbgBNUs4 (ORCPT ); Fri, 14 Feb 2020 15:48:56 -0500 Received: by mail-wm1-f67.google.com with SMTP id g1so11325607wmh.4 for ; Fri, 14 Feb 2020 12:48:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qDX7xlEByvANKkjxM9Lv4JgW0Vs/V0JakfLRr2ITPLY=; b=UE6/SgkKeuTAsuXRIfdruwtL4gLAHWdQHQuDPd5zsch1GyoZc10regB3JX4ooDZQek F+O+w+/DnzDQLYkzk75nu2DfPcfeYKIHxpIqcJ9HJyZuD/QNCL/jtjeQTXZ1F6uEFTdE tieHtFiUclWWr8cHAxB0SroTyBhIdLMvdhML687x/jU75l3+8mxbXGVRTH92hEgVQbbb 5xEl+rIoIcN+pM3bZoUuu4Zze1bzlTIOrqthuQ13+ktnHrCRsSPvMIfV/gBbIycUQtaB 4vPx346JrOGgjPT1cA4jkoicTH3xDxL8loA6N/RN5p3RJZuYDDK8eGSPk27IRxzGPs4r mQoQ== 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=qDX7xlEByvANKkjxM9Lv4JgW0Vs/V0JakfLRr2ITPLY=; b=qAXTRr1smkMp6HijC9JkNjFSSqQhxrSCDNf6CljQwaws43fSiednyYmPmMJa+isClD MqbdREvUw2QjKEPhFusaJ3QpAtJFbFgUtRhJ4KUCXZRm1e2BSbdC9TbLT4N+T+jePLer KfuvOUqDKg+ZaNYu6HVYkaJTfQR89p8LPosd91BFYqstqaNLkf+hn8KIItxvj7852Wwf E9F9qLW+mrM8GHDeFPeW9rRmG3wK6rSgC3YOo5B/o6ssgdck7znmfp/5Rkd/0mMvV9mK b48/kLvQUOKrRjnF9VvFLG1cl9yvsnoMecl0M3W55nOTAyMHGvkXh5vnb4RYNeNGWIeH eA5A== X-Gm-Message-State: APjAAAUr7CSr9I7FSmXUGqDErBIUdbxZp2gY3L6jR+nJ+U5jMcucMAC7 6NDitqn+Plja7vxR7kZM6imN5h9fNM9u X-Received: by 2002:a7b:c4c3:: with SMTP id g3mr6300205wmk.131.1581713333906; Fri, 14 Feb 2020 12:48:53 -0800 (PST) Received: from ninjahost.lan (host-2-102-13-223.as13285.net. [2.102.13.223]) by smtp.googlemail.com with ESMTPSA id y12sm8660782wmj.6.2020.02.14.12.48.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 12:48:53 -0800 (PST) From: Jules Irenge To: linux-kernel@vger.kernel.org Cc: boqun.feng@gmail.com, Jules Irenge , Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: [PATCH 18/30] driver core: Add missing annotation for device_links_write_lock() Date: Fri, 14 Feb 2020 20:47:29 +0000 Message-Id: <20200214204741.94112-19-jbi.octave@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200214204741.94112-1-jbi.octave@gmail.com> References: <0/30> <20200214204741.94112-1-jbi.octave@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sparse reports a warning at device_links_write_lock() warning: context imbalance in evice_links_write_lock() - wrong count at exit The root cause is the missing annotation at device_links_write_lock() Add the missing __acquires(&device_links_srcu) annotation Signed-off-by: Jules Irenge --- drivers/base/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index 42a672456432..fc7f1b8746da 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -64,7 +64,7 @@ static inline void device_links_write_unlock(void) mutex_unlock(&device_links_lock); } -int device_links_read_lock(void) +int device_links_read_lock(void) __acquires(&device_links_srcu) { return srcu_read_lock(&device_links_srcu); } -- 2.24.1