Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp444142ybz; Wed, 29 Apr 2020 03:08:57 -0700 (PDT) X-Google-Smtp-Source: APiQypKzdAtFuR1vfTCgyDG8QEcOjykI4uoTikbk//cxHz+1iC+zK02EtTbDMABUdRGhe3QTFkyD X-Received: by 2002:a17:906:5958:: with SMTP id g24mr1980714ejr.58.1588154937537; Wed, 29 Apr 2020 03:08:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588154937; cv=none; d=google.com; s=arc-20160816; b=XSS/5fMXDlHJ85jrGqTxZC6q82aYok8YI4ZfarUVsq7e4OfDRBs4cTq3ckodwx2XTR YTV8JkhWEW3qZfm/hDisoxYl0q42VoHQrH9WRjbeGcRq7qqAjYEkrs05WGFuwMuRtzOs XpCTqhScmME+czd0Lkmw2UZLpaoDMJhxjdtJSjVWGKliF5pPT5Z/xwA8W/YOdY8UPcnD l6URx5UWR7BeaaEODCpV6xi2tgLwNPqJJXLkucI/qmGSfu0KVxXdqN4LOXBXGrxUNMJc +YSIWgaT0CgWWw70MvT5Y5B2583V7wiv6eBwPvkrQ7cZjsYEjteMolELSJf8MhZIGa3Z K68A== 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=K7tV0HkT7HrwkRP5DztAp91Q49aDaAWOUuwdASD/KEg=; b=mcMUcQRJpiL3Vu08vP+szKyWHW24h4UUiphy+VZf4JKJ3GqyjO+warbof8tOb17mkB n6AfOcdvxnCmH/+dWcNSNIsa78sSfYe3m1PgUtx3DgEAhiMMcrEASeO27/AKdmHS9ZEl JWTSe6PU9lPT3TwIPZdZICHicH/GjAqnrQ7iI/1JKULlgzRcinESqL6fHUyFz9DtDGu1 srODFshgZc1LsAUhyx6ounlkYnELwCDdQJjm1Uhb/8jEWFoPoWu4OjULY4upXuSH3ZI6 F7vw4M128dJk7aVWOH+6NQbI0clkXl9iRLnfeqnGACCDb0ernwkhUEU1WCwifp8pbfrR 9ujQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rF05JE99; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id q7si3197866eds.494.2020.04.29.03.08.33; Wed, 29 Apr 2020 03:08:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@gmail.com header.s=20161025 header.b=rF05JE99; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726914AbgD2KG5 (ORCPT + 99 others); Wed, 29 Apr 2020 06:06:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726859AbgD2KGx (ORCPT ); Wed, 29 Apr 2020 06:06:53 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AFEAC03C1AD; Wed, 29 Apr 2020 03:06:52 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id h4so1354937wmb.4; Wed, 29 Apr 2020 03:06:52 -0700 (PDT) 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=K7tV0HkT7HrwkRP5DztAp91Q49aDaAWOUuwdASD/KEg=; b=rF05JE99smwY21LygzHWkyP9ZOixx+Xowt/nid3jshRTyRymbu4qrcFO6C1wAH7yYR +rVY7f3hwXkj4x9/XcJOBXh/Kx328F92FSKgjv8OihGSJFMMonzEGsPHWux91FYj1haW KZ0UzIeecYZ40m4aC3wU5T3Rgafjdc3NmLMiDWHug5CUvYBxpq5EDH6UzwgShT2d0J9Q huYLXsuln4s9W+5xOe9sD7HngHevHno1QR/NgLGG6Iv9ttCKeuluqe/uoJI9rPexhMBz 9VU041oytVG54JyrzKKIOnW4hpf+bRzTPqPDFhiDwJzJphaE3HMEaitRo31sb/tlA/xf nx/w== 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=K7tV0HkT7HrwkRP5DztAp91Q49aDaAWOUuwdASD/KEg=; b=WeK4wsaUF6JKTTOFaVfKssY4+MxQTyoce17gbl6OejGv8gV15YftRQKHV5xhFnAPCy zcKJvWycnzkv9SleEVTcRRveEACu4Oy6oUKDynFK7wZqvBAozvJBSzU30tI6La5gt1TR 0zFCFWVd+XXpvQod80i1AHHV+uJVjtek/HKn0sT5Znc3k0AAT7RzdWE0SR+ZA4TUFox0 5Xsi59ec6ffkyphETcw5pIR7U3U45saTPLJvsXprhU4qDOz+EkLpDnI/m7uQfRuW8zRl gd1MklDslTni3rqi1NpNmyHHx3s+klsZg6Zqta24lc/BcUeUVM/X/bufTwK/2kDtWfVI Klyg== X-Gm-Message-State: AGi0PuY4XUqGgd+F6GPVL6hqAa/ZS4m8+XkktVFE73G8AqBnndgvBPYm 2hJRy0e3HI7rgm8fjAyDk94SI2xwF+cu X-Received: by 2002:a05:600c:2dcf:: with SMTP id e15mr2497790wmh.171.1588154811040; Wed, 29 Apr 2020 03:06:51 -0700 (PDT) Received: from ninjahost.lan (host-2-102-14-195.as13285.net. [2.102.14.195]) by smtp.gmail.com with ESMTPSA id 1sm7205478wmi.0.2020.04.29.03.06.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2020 03:06:50 -0700 (PDT) From: Jules Irenge To: linux-kernel@vger.kernel.org Cc: Felipe Balbi , Greg Kroah-Hartman , Andrey Konovalov , Alan Stern , Chunfeng Yun , "Jacky.Cao@sony.com" , linux-usb@vger.kernel.org (open list:USB GADGET/PERIPHERAL SUBSYSTEM) Subject: [PATCH 5/6] USB: dummy-hcd: Add missing annotation for set_link_state() Date: Wed, 29 Apr 2020 11:05:27 +0100 Message-Id: <20200429100529.19645-6-jbi.octave@gmail.com> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200429100529.19645-1-jbi.octave@gmail.com> References: <0/6> <20200429100529.19645-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 set_link_state() warning: context imbalance in set_link_state() - unexpected unlock The root cause is the missing annotation at set_link_state() Add the missing __must_hold(&dum->lock) Signed-off-by: Jules Irenge --- drivers/usb/gadget/udc/dummy_hcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c index 4c9d1e49d5ed..c07ddf11e137 100644 --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c @@ -427,6 +427,7 @@ static void set_link_state_by_speed(struct dummy_hcd *dum_hcd) /* caller must hold lock */ static void set_link_state(struct dummy_hcd *dum_hcd) + __must_hold(&dum->lock) { struct dummy *dum = dum_hcd->dum; unsigned int power_bit; -- 2.25.3