Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1419165yba; Wed, 24 Apr 2019 22:30:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+TPz9AozQYfyzOLb06AwI4e0lA0iShc4pdXct2msqn8Ki0lJg9POg/hmdM5kfuWWuS9y6 X-Received: by 2002:a17:902:820a:: with SMTP id x10mr37716167pln.316.1556170250022; Wed, 24 Apr 2019 22:30:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556170250; cv=none; d=google.com; s=arc-20160816; b=TVprjIZwFTL3DxresBKyelUUILqiUkZlAnglLrBoGCWk8as5LO1YWL4m+yOoF3JSom 24sQsG2XNk79hBPAkzs+2udLgr2jtZhoYBabsYWLi3OnGl/6pVKSw/9cLy9/tkpvYpOJ IVqV+l60QH9kLpn3z4LYTIafwggYfp83eq9XGzQLTZCboli7/ZrK4LbN79ZOCQxhv4J6 liktQcPNlQegVugxhRDjWEEVwSI876VpYkSkD1NCMB0tLFj91ZHNUybqycXsdNwZaMUT 5DbWzwwc0aLZQnt4lXIprGjY4xVREXUGJs7t0y0ypxZimG4cj8KluPTtaPv1+9c6vNCj V+rg== 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=hoYlU4h2BS7LsPaxrwOG0yrHKWblezJ1lOgpeqL2lpM=; b=MtitciSN+ly7MHfjpQnNHdjldfJ2OkKOl5JWoscPiA1ecoFUJQjURB6e4lfva7DW4I CjBJJCUUkrs/dedPicR/6+6rAxG2gwTt3mPxVxjKl7RUEpEpp2sgWRrUeiqxlpVrlBQz xmENageqnSMr5KvGnOA3Aal7oDhfOL43CcGbIHcO9ULh1FXZQSSyvO7JGC4+daV6tYP3 f/YQP8+K9oYM4gZQWmzDVmdOYW+atKe3tbwD7wAj0rmaTkjWqUcQnTxzytcpWADDJNPv 7RCJUouSqog5oBUWdZJEWiOPZv+Z2BlVyh8+7jc5Ko0aCsVBOdxHjckieJljpP9N/xkJ aVfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kFjBv3qm; 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 w126si22840538pfw.53.2019.04.24.22.30.24; Wed, 24 Apr 2019 22:30:50 -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=kFjBv3qm; 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 S2388774AbfDXSIU (ORCPT + 99 others); Wed, 24 Apr 2019 14:08:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:40644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387782AbfDXRQJ (ORCPT ); Wed, 24 Apr 2019 13:16:09 -0400 Received: from localhost (62-193-50-229.as16211.net [62.193.50.229]) (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 E51EA21905; Wed, 24 Apr 2019 17:16:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556126168; bh=PO/yaHkXr1k8Q6yErNLuuV7ICyFfqYMoqqeWyMgH8ZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kFjBv3qmuXAv+OkwsKIaMohtzeM3WweldCLrj1dwaH2I+y42jIofuvtIf6nnV+m/W ZXTTzL+wvffFh2UwrY9sJ4d2PxOkKHHfZ/vJ+e2oGF9h8jk+8MLsfjUSbZflRojrAf xHS/LVDvSlxUHSc2qFGVNrQ9m6CdXN/Uv8Rjrkms= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Nathan Chancellor , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 015/168] enic: fix build warning without CONFIG_CPUMASK_OFFSTACK Date: Wed, 24 Apr 2019 19:07:39 +0200 Message-Id: <20190424170924.451707436@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190424170923.452349382@linuxfoundation.org> References: <20190424170923.452349382@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 [ 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 9ef4caa4b84d..3c20d0dc9256 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