]> git.baikalelectronics.ru Git - kernel.git/commit
afs: Fix a Sparse warning in xdr_decode_AFSFetchStatus()
authorDavid Howells <dhowells@redhat.com>
Wed, 23 May 2018 10:32:06 +0000 (11:32 +0100)
committerDavid Howells <dhowells@redhat.com>
Wed, 23 May 2018 10:32:06 +0000 (11:32 +0100)
commit2905fc7122dcde34cb1ef133596f0ceb0a711bac
tree634907a1372ba2872d170af8d36f3303b97de5b1
parent7f4a6c171bc3c8974371655cd5c5a95c945e538b
afs: Fix a Sparse warning in xdr_decode_AFSFetchStatus()

Sparse doesn't appear able to handle the conditionally-taken locks in
xdr_decode_AFSFetchStatus(), even though the lock and unlock are both
contingent on the same unvarying function argument.

Deal with this by interpolating a wrapper function that takes the lock if
needed and calls xdr_decode_AFSFetchStatus() on two separate branches, one
with the lock held and one without.

This allows Sparse to work out the locking.

Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/fsclient.c