From: Sameeh Jubran Date: Wed, 1 May 2019 13:47:06 +0000 (+0300) Subject: net: ena: fix incorrect test of supported hash function X-Git-Tag: v5.4-rc1~1056^2^2~19^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d3cfe7ddbc3dfbb9b201615b7fef8fd66d1b5fe8;p=platform%2Fkernel%2Flinux-rpi.git net: ena: fix incorrect test of supported hash function ena_com_set_hash_function() tests if a hash function is supported by the device before setting it. The test returns the opposite result than needed. Reverse the condition to return the correct value. Also use the BIT macro instead of inline shift. Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") Signed-off-by: Arthur Kiyanovski Signed-off-by: Sameeh Jubran Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c index b17d435..f9bc0b8 100644 --- a/drivers/net/ethernet/amazon/ena/ena_com.c +++ b/drivers/net/ethernet/amazon/ena/ena_com.c @@ -2195,7 +2195,7 @@ int ena_com_set_hash_function(struct ena_com_dev *ena_dev) if (unlikely(ret)) return ret; - if (get_resp.u.flow_hash_func.supported_func & (1 << rss->hash_func)) { + if (!(get_resp.u.flow_hash_func.supported_func & BIT(rss->hash_func))) { pr_err("Func hash %d isn't supported by device, abort\n", rss->hash_func); return -EOPNOTSUPP;