Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp994338yba; Thu, 4 Apr 2019 02:00:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwcuoeiZRwxSI01lrwtqY7X+v76gIrqclS0P2Co/rwSey10NaZn/0VkGO3gAvocs9xPwLU4 X-Received: by 2002:a17:902:9a83:: with SMTP id w3mr5181016plp.241.1554368428556; Thu, 04 Apr 2019 02:00:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554368428; cv=none; d=google.com; s=arc-20160816; b=g32hkmcglT1Xvd8COVTEBmBdBOJFKFdP9U72SdxwJ1UIGIZpMv6QASASzaQc63xv8L jPqCMzEajRvC57B8bL1KuLOwBqnDP//C3jCpnXPx45XMdSinYqEQtfFNU2DsgH5aFtnQ 68lZlaxah19fJ7NzDxwB4PRlUTqtujJTSo46E3092yZl5FOJ6EP5i4tm0ByO2y5XOmlV LgIJI7nCnmuJ8TTy+j10Ps66uQEMDs4/qfPnWUwErYS4itPNgm9MXmQjX0JmKi+GKZ7S PXfxjIVCJOjvp+Ybz8cmxGuQyKx558DAXS03DrvTaCe7kHru9BHwENJTi3gfHh9Jdork YY6w== 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=2AM/NVkvjVWvHaAup2+Wi3jNbv9lC0Cz1TtvPhpevpA=; b=N/yciph/sEtJuwkzvbw2US2V49lZXZZPEVnCmNc+4R7QeBwiXWrGQ6uC5C8ND6IZ4E BeWq/pSakiaG5zZ8pbTPEghZOKbCN8liqRnohkynKK9u/s9oIVYV6nJPPb295oj/R7L/ tWMqtf4WuO4GHG1NOMZqGeW6Ck0/TmMV6HKa9Hko3zKyYUy3ZH8wFl84Rz0dcbCclZ8b wRW6HpfeO6smlic8PtX55gyDiKM3fsRWA4yxbmHQg21NQ/ZabJlcf1mED20p3j7jkByp rraS1Iz4QvSThKFPeDo+CDVmSuSuKD3iYHpNYzeGoQ6X2WUoLDn8wrHfWW/dkafOvKjR Ucgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cjsTP5Xn; 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 u79si12155952pfa.6.2019.04.04.02.00.13; Thu, 04 Apr 2019 02:00:28 -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=cjsTP5Xn; 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 S1731109AbfDDI7k (ORCPT + 99 others); Thu, 4 Apr 2019 04:59:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:35960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731098AbfDDI7f (ORCPT ); Thu, 4 Apr 2019 04:59:35 -0400 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 E91E720652; Thu, 4 Apr 2019 08:59:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368374; bh=FDLj2gQDtfh77BzlMtLajaBM0hcPDgSPGsjfv2S5TZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cjsTP5XnKK9cR+BWx0JVc98EfMbvIHANCRiLZwB/6zQ7ZtGvTuzi2vwzicpqHL8CH DfuBDW2HijHjbfjUUAaBA2R4rB1JsPRQ3cWtg17FVL1POSxmuGk0/s2KQjqD7WCX6N 3IIwL6+X+TrDgb7xX/CrElI+QU6dITpssUuMH6AM= 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.19 016/187] enic: fix build warning without CONFIG_CPUMASK_OFFSTACK Date: Thu, 4 Apr 2019 10:45:53 +0200 Message-Id: <20190404084603.861490774@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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