Skip to content
Commit 5bc26726 authored by Nimrod Andy's avatar Nimrod Andy Committed by David S. Miller
Browse files

net: fec: Fix sparse warnings with different lock contexts for basic block



reproduce:
make  ARCH=arm C=1 2>fec.txt drivers/net/ethernet/freescale/fec_main.o
cat fec.txt

sparse warnings:
drivers/net/ethernet/freescale/fec_main.c:2916:12: warning: context imbalance
in 'fec_set_features' - different lock contexts for basic block

Christopher Li suggest to change as below:
	if (need_lock) {
		lock();
		do_something_real();
		unlock();
	} else {
		do_something_real();
	}

Reported-by: default avatarFabio Estevam <festevam@gmail.com>
Suggested-by: default avatarChristopher Li <sparse@chrisli.org>
Signed-off-by: default avatarFugang Duan <B38611@freescale.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c53fed07
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment