Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp483177ybl; Tue, 28 Jan 2020 06:39:43 -0800 (PST) X-Google-Smtp-Source: APXvYqzjN1Hm/753ykKR0K/5emHovo3e2BSupZEXZGLGRXolO+yieLJ1RZgekZu2GFtjx98oz+qs X-Received: by 2002:a05:6830:124b:: with SMTP id s11mr16159971otp.333.1580222383545; Tue, 28 Jan 2020 06:39:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580222383; cv=none; d=google.com; s=arc-20160816; b=xEoDbQhOZ5BoatX7riPLdbrc/w/dAInZYaI/5IgLvVxT+CdkJHyxKtTudL2nSUtNlY o602YE7PQqPT8GbNNux3bMKr2bqBm28dXj1R5p+sqpnTNotYF2IDEBFe1Ad7/jm6q124 abDHgE0ETifg4lGHMk2aGrAkGYhQdNx/HdKgMuWdQWdIthwliNDUUC9VPMhUTyrao9JV WSOoVvzx448ZmKaTG8TUQO7B9WhU3xyBnfu3OAR1T34OQaMLGeoP9ZmD/PbMwb1mOI+v VtGVQb+odgBjxjFzBoSXM83kPA2xiys1WLis6UBhEb0uU4g2OV+gkGYs6YfttkQHYVgz uk6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CzFBcI5g0QP1H3TEQUIse//Fcq86iCFml+iYQn6kuw0=; b=c1ORGm3HNUIkdgr022+UJQ3F28me4iGRIUdzl4rVmRPwQ+hIzk9UK/EZW16QiffBd9 jI9/yacYllHNQP6qv+NjgRnG6nL5k4pfXoEW9OfH1bG6r5VbaK/M/Ph0XUHet5lJLMvC pgoBa/boUVm1UdGliaGxSBKg/W1ibBMCcGoG9tNNQqCd+czERVCjLwsjG0h5aq+YUO2F CC5iAu/3WFXZHy5ucX11oG1BpX8kKIzmtmJPEfsxdGq6dMpol4tc/fn3FCmcFkdIMF+2 +br1Dg1oQ3Es/tfzqy7y1g2Ng2SXcMEeYt5Jrnc0O8VVcUaUwqDtuoUgQw2HID6I7qY0 G6Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uNGKVcUl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s7si2632351otd.280.2020.01.28.06.39.31; Tue, 28 Jan 2020 06:39:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uNGKVcUl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731035AbgA1OUK (ORCPT + 99 others); Tue, 28 Jan 2020 09:20:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:44804 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731010AbgA1OUH (ORCPT ); Tue, 28 Jan 2020 09:20:07 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E4E462071E; Tue, 28 Jan 2020 14:20:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221206; bh=SuNEaunjicElcpYE4/DtL1GUO/p8JfWw102Z1PSi99s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uNGKVcUlnO/HkpFQgm6yyetLf6tHnK4jZV6xgsa1RoJsjMoPcrNhH13rrmtjwyMaW e2VdpIaosFoNxrY0HYofEHXsjW8eqmtt2dOXouRXs0Zm3+eLbif0eYGrC8x9Te+IVT wqpjYUVC+9EkRcwyA33fUaFBD1lO2uAARtBPheHs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arthur Kiyanovski , Sameeh Jubran , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 131/271] net: ena: fix incorrect test of supported hash function Date: Tue, 28 Jan 2020 15:04:40 +0100 Message-Id: <20200128135902.353434800@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sameeh Jubran [ Upstream commit d3cfe7ddbc3dfbb9b201615b7fef8fd66d1b5fe8 ] 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 Signed-off-by: Sasha Levin --- drivers/net/ethernet/amazon/ena/ena_com.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c index bcd993140f841..2d196d521b836 100644 --- a/drivers/net/ethernet/amazon/ena/ena_com.c +++ b/drivers/net/ethernet/amazon/ena/ena_com.c @@ -1967,7 +1967,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 -EPERM; -- 2.20.1