Skip to content

Commit

Permalink
hv: Remove unnecessary comparison of unsigned against 0
Browse files Browse the repository at this point in the history
pfncount is of type u32 and thus can never be smaller than 0.

Found by the coverity scanner, CID 143213.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Tobias Klauser authored and Greg Kroah-Hartman committed May 3, 2014
1 parent 3a28fa3 commit 24b8a40
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/hv/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,8 +682,7 @@ int vmbus_sendpacket_multipagebuffer(struct vmbus_channel *channel,
u32 pfncount = NUM_PAGES_SPANNED(multi_pagebuffer->offset,
multi_pagebuffer->len);


if ((pfncount < 0) || (pfncount > MAX_MULTIPAGE_BUFFER_COUNT))
if (pfncount > MAX_MULTIPAGE_BUFFER_COUNT)
return -EINVAL;

/*
Expand Down

0 comments on commit 24b8a40

Please sign in to comment.