Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5656082img; Wed, 27 Mar 2019 12:33:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8od17NU7OP19/pwKGmjYPiZ0lvVn6oX+haTP6HoKZYGEQctgpXIdB6Aad6BlVEJQZw1NV X-Received: by 2002:a17:902:9001:: with SMTP id a1mr8631964plp.96.1553715227610; Wed, 27 Mar 2019 12:33:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553715227; cv=none; d=google.com; s=arc-20160816; b=MAVQw1ztNg5O49s2BA5zS4X+4gucC5mEkSbQNaRJ2d4xnMSTnhV62GvzJMCry1UWCE 0uKvu6UOliCaA8w/reIGciQyx3HC51fBgEwBTHFD8WaXJoizD8T+xBPx3i8nnnzZmTgc u/sasWrrkrag0frg/cjvRr+y5Ord2yQD6vU28+zhLX1frVUSoImC8zdnsAF2jjDx7R7y 0UUAEK9iMRqt18jBeG9baHYnCSg7KCEAPIubcXPlJX38LrSIEcV4T3CvZ6jE8PIjLp2R PetPnAkdRchCgHn0V/3Q2cGQxPJV4xTgNNHUUY0Pt4rYdXQ3RPzuN6F5PIuJ4Bfldg9O v+Eg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tnKU9qDNoQnv5A5qj3jwh0d9nS1reiAENwZnk0bbLq4=; b=O+zlqRFiy1TFX6fmvxTfLak6PQLCwMi7GWOrRhlp4FjDj1wESAph8e3AXIAtNm4fGX LCDtOZEmIXJloKLRJPeW+xABZ/NSgpnJ8amH9KduY0WLS3Ppmb5/PYffY0o2V5pkgYgw VoYOgPo5rH7fYjY/e4nGlrGiysTdTpHXrS3c74BaBY8JHR+iovS3wzWcXHh1jiMnuBXr ASAaeelQLXjwSKkQrkKI72CM1w5fJ3GBK/HFx+Z84MHBUy6MxrWe47QYShpMaAV2v54W KTOyVXJtlJPUrBbrNVuqVzDrXjLjkk4wEr3M0mvAy7mP4DF1+TglmkzAFrtSn7qMWc+d eWzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gW5C4Dvy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e3si18780234pfi.223.2019.03.27.12.33.32; Wed, 27 Mar 2019 12:33:47 -0700 (PDT) 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=gW5C4Dvy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387611AbfC0Tc5 (ORCPT + 99 others); Wed, 27 Mar 2019 15:32:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:42568 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731039AbfC0SCh (ORCPT ); Wed, 27 Mar 2019 14:02:37 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8E92F2184C; Wed, 27 Mar 2019 18:02:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553709757; bh=LZAMRbWj6YIz0nyzX700ZvhA3w5bIiuo25m9k+FuR1o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gW5C4Dvy7hUz1d7CphEyiQUgNxf8J06s252SCFsYeg5KtO473wJuzhT4BLUU3/GDj M9XtpyVLrn2qLqv77WsygJKfP83vd5Xa5WZs2TuybXYyp5PkHqSt8h6dkvosM0L1MW psYKQ+LNO6Fvy1dIjcgR1b685e9TDkqrMTBmfrWY= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Arnd Bergmann , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.0 023/262] enic: fix build warning without CONFIG_CPUMASK_OFFSTACK Date: Wed, 27 Mar 2019 13:57:58 -0400 Message-Id: <20190327180158.10245-23-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann [ Upstream commit 43d281662fdb46750d49417559b71069f435298d ] The enic driver relies on the CONFIG_CPUMASK_OFFSTACK feature to dynamically allocate a struct member, but this is normally intended for local variables. Building with clang, I get a warning for a few locations that check the address of the cpumask_var_t: drivers/net/ethernet/cisco/enic/enic_main.c:122:22: error: address of array 'enic->msix[i].affinity_mask' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] As far as I can tell, the code is still correct, as the truth value of the pointer is what we need in this configuration. To get rid of the warning, use cpumask_available() instead of checking the pointer directly. Fixes: 322cf7e3a4e8 ("enic: assign affinity hint to interrupts") Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/cisco/enic/enic_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c index 9a7f70db20c7..733d9172425b 100644 --- a/drivers/net/ethernet/cisco/enic/enic_main.c +++ b/drivers/net/ethernet/cisco/enic/enic_main.c @@ -119,7 +119,7 @@ static void enic_init_affinity_hint(struct enic *enic) for (i = 0; i < enic->intr_count; i++) { if (enic_is_err_intr(enic, i) || enic_is_notify_intr(enic, i) || - (enic->msix[i].affinity_mask && + (cpumask_available(enic->msix[i].affinity_mask) && !cpumask_empty(enic->msix[i].affinity_mask))) continue; if (zalloc_cpumask_var(&enic->msix[i].affinity_mask, @@ -148,7 +148,7 @@ static void enic_set_affinity_hint(struct enic *enic) for (i = 0; i < enic->intr_count; i++) { if (enic_is_err_intr(enic, i) || enic_is_notify_intr(enic, i) || - !enic->msix[i].affinity_mask || + !cpumask_available(enic->msix[i].affinity_mask) || cpumask_empty(enic->msix[i].affinity_mask)) continue; err = irq_set_affinity_hint(enic->msix_entry[i].vector, @@ -161,7 +161,7 @@ static void enic_set_affinity_hint(struct enic *enic) for (i = 0; i < enic->wq_count; i++) { int wq_intr = enic_msix_wq_intr(enic, i); - if (enic->msix[wq_intr].affinity_mask && + if (cpumask_available(enic->msix[wq_intr].affinity_mask) && !cpumask_empty(enic->msix[wq_intr].affinity_mask)) netif_set_xps_queue(enic->netdev, enic->msix[wq_intr].affinity_mask, -- 2.19.1