Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5598516img; Wed, 27 Mar 2019 11:25:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7jgIYxMilUCxIBPeVwYz/sMjPmGs8dwGmSYIbuOuwIg/v6M0cTw4OgT2Fz9CsUpwRyk6O X-Received: by 2002:a65:49c4:: with SMTP id t4mr35949297pgs.421.1553711103894; Wed, 27 Mar 2019 11:25:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553711103; cv=none; d=google.com; s=arc-20160816; b=cukcdq2UC9yiDly72dpr2kgKyusmVlbtD6iTPe5G117o1wOb3o4Gb4mBUhRciw3hYO nsMeyBiTJ+pWKyEBdbOu2Jmxgh4WKavgfRvyGtN6JcF2aafsA4p42eJeu4fcR4mEKXlx lWaaCvknIxaA4FLQabnmkdYerhueFcOLks75kY4Ugvay35iJ8M2jVK/AT1vf11P9/8bq GAJRiKoLxKcJVES28wn/xY6eLiBLSaFF/kJ6qEMHKR7EUxSgwbP7Ox77xnsWHU05Wbtx k7gKIfTdkbpgNASANCR8BbCO5Owbq/m15wfCVTMwq1F7h/0rOWod4QF+tawJ8a5EksJs ILhQ== 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=XZJCT7V93RulGG85ZTtTgrSCtnBBUd/K/ppPXqFRCOo=; b=M/FnjAidRYxHVsjNd0QVoJ3zv5sQK8jsCWvm8zjW7lbfGOXH/fYnegAB5oS7FKBybg yqbnZ+JIHh6yTPWAeU+SydmcP0ZlKH2g2V2kIkIfcbbUpgk806ZDtWpFmSC/RfEVbsxq 8nWaUnCHfFaUJBxoeJsBqmvMhwuYB/1eXhWKMrqrl+oocIzEdIMkw042npPhNaDWUyjN dOhcyLcFY1u5X706k6WMipXBToVrdBesT6FQUmAbWy2QtqDlbBqXSXIMbQaH/THhifdX A8MAF09Pp3nQ6coAPASM++ofzEq7HSXBbWzQtWo8RJUzwm2JoBS3JRu06g2l9P2pu8Wa 0sKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ekj+hZ2H; 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 g10si20761141plb.375.2019.03.27.11.24.48; Wed, 27 Mar 2019 11:25:03 -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=ekj+hZ2H; 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 S2391383AbfC0SXA (ORCPT + 99 others); Wed, 27 Mar 2019 14:23:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:38628 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391033AbfC0SUz (ORCPT ); Wed, 27 Mar 2019 14:20:55 -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 E679121738; Wed, 27 Mar 2019 18:20:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710854; bh=nzw6NS/MtDkgG/Y2W1X7xtWF4nDDjzt8jOGA9YuQgFc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ekj+hZ2HLh+9fNyXCBZ9QFoCQ5pzx7rwo5JnYvUqTi5O6yp33U0ZVnF6ejrLGsV39 phl/q3sL+KX6vqCpT+qTlAp3XrZXmXoThj2SvgNDUIjLKvTHzdmZKWgDW3qIBns0nq kspG6u8zCRIbLVRFyrGCeYOUrR1rQY12vT5PYM10= 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 4.9 08/87] enic: fix build warning without CONFIG_CPUMASK_OFFSTACK Date: Wed, 27 Mar 2019 14:19:21 -0400 Message-Id: <20190327182040.17444-8-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327182040.17444-1-sashal@kernel.org> References: <20190327182040.17444-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 89acf7bc4cf9..b73d9ba9496c 100644 --- a/drivers/net/ethernet/cisco/enic/enic_main.c +++ b/drivers/net/ethernet/cisco/enic/enic_main.c @@ -120,7 +120,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, @@ -149,7 +149,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, @@ -162,7 +162,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