[PATCH 20/30] pcnet32: Add missing annotation for pcnet32_suspend()

From: Jules Irenge
Date: Fri Feb 14 2020 - 15:50:12 EST


Sparse reports a warning at pcnet32_suspend()

warning: context imbalance in pcnet32_suspend() - unexpected unlock

The root cause is the missing annotation at pcnet32_suspend()
Add the missing __must_hold(&lp->lock) annotattion

Signed-off-by: Jules Irenge <jbi.octave@xxxxxxxxx>
---
drivers/net/ethernet/amd/pcnet32.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c
index dc7d88227e76..ac6c19441932 100644
--- a/drivers/net/ethernet/amd/pcnet32.c
+++ b/drivers/net/ethernet/amd/pcnet32.c
@@ -684,7 +684,7 @@ static void pcnet32_poll_controller(struct net_device *dev)
* lp->lock must be held.
*/
static int pcnet32_suspend(struct net_device *dev, unsigned long *flags,
- int can_sleep)
+ int can_sleep) __must_hold(&lp->lock)
{
int csr5;
struct pcnet32_private *lp = netdev_priv(dev);
--
2.24.1