From patchwork Tue Aug 10 16:02:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 494353 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp4092066jap; Tue, 10 Aug 2021 09:02:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0VEaDM/EQPhXkcr5MjJGroBB0It5MmygmmIRmglYRzzaVpLQTNQt5OEcSg28MAHptkHKn X-Received: by 2002:a05:6e02:1b84:: with SMTP id h4mr192284ili.115.1628611346443; Tue, 10 Aug 2021 09:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628611346; cv=none; d=google.com; s=arc-20160816; b=Dhn7Uwjyzwo2f/JORvGbQZugxjeOwttzLW/mSAlT+lh3oTvu5OHorMeGz2d0+JFPse jeYKXr81LJwoUQafnv/InFIY/UyU3jRuD7r/BW1uNHf3QKNULyVLmNsDo+a98mA6bndg LgqzoQ0+OJU7NFPSTzj7DsZKVOh70dY5182v5dGI4uaQQR5RYLcsy+SxeAFCSkCBekq+ INmCrLShXXD5fLwxRUCC2/nXmkNJt3ky4ryrxa9UZsDnI0QI90QsSGOTXNcdGij7ke1q Dapo8CnaCgPjK6XpsxngS0OlFAGue2kgOzXERJHD1zUsDA0p3MGn2sh086rl9A4a5rkN FedQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1PRnQFLgAZaDD7EbkN4+BWtHqGym0jkd6ykX1SJWWbg=; b=F4ORyhN5k1rCeer/bv7BvqwoM/uxHIPrwuI+uUP4oSfiVQPtdPtSJ56JC3AjNRy8x3 SNr6+8ehxt3O+z1Cem2MsTcGPsUFzcWDn8MCeKY0Jryy5zc8Q4gbh2EVl6nA+z8tIioM P3ddkUWyl/XAKQQNCI61osa+mZJpaJxsFghk04O+Ty+TgNwRNPfJh62tkbeVzZ92xtCM Og/ELQND7v92LaPNTaaAf/+R2JRKKDF93sLRChAXZd37rSy5JleP9tkW85+QZRyyP2Rq LGZynDLl4rXdQlCqwdpz7FlIf5uUOjdlMoBD7p7QO71pGzzYcdwOHGyizaQ2MVWc3VdD wuKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RgaCat+W; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y1si22533269ilm.61.2021.08.10.09.02.25; Tue, 10 Aug 2021 09:02:26 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RgaCat+W; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236203AbhHJQCq (ORCPT + 8 others); Tue, 10 Aug 2021 12:02:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235497AbhHJQCj (ORCPT ); Tue, 10 Aug 2021 12:02:39 -0400 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BF81C061798 for ; Tue, 10 Aug 2021 09:02:17 -0700 (PDT) Received: by mail-io1-xd29.google.com with SMTP id e186so30923088iof.12 for ; Tue, 10 Aug 2021 09:02:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1PRnQFLgAZaDD7EbkN4+BWtHqGym0jkd6ykX1SJWWbg=; b=RgaCat+Wj7sgZfBz3lRTE4ZluwhtWbKv7VRgfVdJX5vymBcX2czGapoM2BDWpbdEIX skDkn4uJH176nacMm9IaQoXjxR6JR9cnEnkSkIW0y/s2u/rS2qUvA9k3gP3jsMUxMK6F LGWh1NcUskwLYdxTFSos2FIV6hW9yGkfNmCtauUu7RdckLLE6wey+CcP+Dyl+Z4fTFZU TTTgdxLRnaSXVK1zfT236/gCz8ar73Fgdra3zOOeXtcAU28DYiJeXEuX3rJSCpDTLx0l fNB5M9zPPYBMJOPlsER7dNsQupPlkuQir2bZnHC0Hlkdn+Frk7y9y3wdvGfLOsoBf0hL 6kdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1PRnQFLgAZaDD7EbkN4+BWtHqGym0jkd6ykX1SJWWbg=; b=TI4P1OMPfr8/60Xpyh1UZIJANIIc4Lq98ya/3uc3r3oUVLZzfyv5aCH9S226+Y3eut ri/B8gVKQOGBp4WOgWOppyLuBR3KbMDp4Kp9vB9Pwu59x2ZkZ5LFdhUmWLlzwhWP2USG u7u/LeHjC8e/tImuSHHYHdnW+u34sv5dt90uvPiSzC0UmGcIieXXqeyzXADAFUoKlrTx aCdm8E0Ozm9sQB+57UDBdJXAuBVoKiERntHi305qNA6YX77eqRUynFkxewiwbkrEASFp pg7+P9hrSu6BYFzqKLZLofbxVxKrQoMlGNv1cZiunlokLbd1BqWdYyuVAfUzwMr9utrI TptQ== X-Gm-Message-State: AOAM532q2/KAaKe9PhXQPK/TyDt6m2E9KiYXJc+Uh9P0IiqlRGW8DI+e OflJ3lTGAj/bclDwNUs+iRwUNA== X-Received: by 2002:a02:c9c4:: with SMTP id c4mr4735367jap.67.1628611336887; Tue, 10 Aug 2021 09:02:16 -0700 (PDT) Received: from presto.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id p8sm12765248iol.49.2021.08.10.09.02.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 09:02:16 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: bjorn.andersson@linaro.org, evgreen@chromium.org, cpratapa@codeaurora.org, subashab@codeaurora.org, lkp@intel.com, elder@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next] net: ipa: always inline ipa_aggr_granularity_val() Date: Tue, 10 Aug 2021 11:02:13 -0500 Message-Id: <20210810160213.2257424-1-elder@linaro.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org It isn't required, but all callers of ipa_aggr_granularity_val() pass a constant value (IPA_AGGR_GRANULARITY) as the usec argument. Two of those callers are in ipa_validate_build(), with the result being passed to BUILD_BUG_ON(). Evidently the "sparc64-linux-gcc" compiler (at least) doesn't always inline ipa_aggr_granularity_val(), so the result of the function is not constant at compile time, and that leads to build errors. Define the function with the __always_inline attribute to avoid the errors. And given that the function is inline, we can switch the WARN_ON() there to be BUILD_BUG_ON(). Fixes: 5bc5588466a1f ("net: ipa: use WARN_ON() rather than assertions") Reported-by: kernel test robot Signed-off-by: Alex Elder --- David/Jakub, this fixes a bug in a commit in net-next/master. -Alex drivers/net/ipa/ipa_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index 25bbb456e0078..f90b3521e266b 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -255,9 +255,9 @@ ipa_hardware_config_qsb(struct ipa *ipa, const struct ipa_data *data) * less than the number of timer ticks in the requested period. 0 is not * a valid granularity value. */ -static u32 ipa_aggr_granularity_val(u32 usec) +static __always_inline u32 ipa_aggr_granularity_val(u32 usec) { - WARN_ON(!usec); + BUILD_BUG_ON(!usec); return DIV_ROUND_CLOSEST(usec * TIMER_FREQUENCY, USEC_PER_SEC) - 1; }