Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4479597pxt; Wed, 11 Aug 2021 07:04:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkd8EmjkoETpuuvGa7rQkXxyKYuR8a4aTeC5KxgXZ6ZYYTFJGZs3xD5IWL0sQpony7z8Tv X-Received: by 2002:a05:6402:289b:: with SMTP id eg27mr11701877edb.90.1628690653158; Wed, 11 Aug 2021 07:04:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628690653; cv=none; d=google.com; s=arc-20160816; b=T0ODYnC+1hExti8XsLyvGg88yeTGJvi2fN3nAgUyBZ9qa+sYj0jDTIOgR/aZGn4e1s edAiYusSYVDeIaYbrsnhFEGdIRIho8SlCHbDKu5RUtEDqcO/5QwDBWcxQp5doM2BR8Co FgTE7FCr3b7e8Ehvh6grthdFKoMDUVi+nk10On6B23qYUs6WU8KslqvZ3FFvn/MuK40g R1tytXz82gAT5cjvCJQ1vcEytV3armFdfGAePE24/TQdPYCp7ROSPKKfWcNdTcv69l5e Qd4oE+F8c/yD7YLPOfO+0DQTPOEHExDnc/psmsfx/z2bmPAX37RXpkK4nsxtltqo0+Iw 1qeg== 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=G3+CVK8r94N1sJaYl4cTeuh/cF4j3sRvIlNBySKEKgY=; b=FRdjWpwxZSgqrIgNP6bEKq7GzhlT+UTUwxFNHuxrVWMg6ewce8y//rZwNELXZJcfon mi3m4LES5OM/DUoF4FddYvJ4fIMAfAFlVx0etDxU+y5q9dTKxAcCsHhHU34w9yxmwUeJ f1BfKr7laDmJw0Srv+0AWW/z+1TUClW7OS5FnjFZlChrpR9edoZL8bQs/eAZLAbUL01B 1bmBp5DXCgTwcsRVSV1XDq1vO+6+8tTd2Iq7kxSfWI6ZA/wVb/CCZ1zs4zWj71fgnYVG UXm/m8FyzZ3kWs8ee1Ta8hYXzOKWcd7cYnMRiQbSoTXhmnTQ70b2PMHJpNGdtGasZpnP SVqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UvGovQgQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 si13si9513210ejb.517.2021.08.11.07.03.47; Wed, 11 Aug 2021 07:04:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=UvGovQgQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S232132AbhHKOAR (ORCPT + 99 others); Wed, 11 Aug 2021 10:00:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231897AbhHKOAP (ORCPT ); Wed, 11 Aug 2021 10:00:15 -0400 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40EF7C0613D3 for ; Wed, 11 Aug 2021 06:59:52 -0700 (PDT) Received: by mail-io1-xd36.google.com with SMTP id n17so2225366ioc.7 for ; Wed, 11 Aug 2021 06:59:52 -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=G3+CVK8r94N1sJaYl4cTeuh/cF4j3sRvIlNBySKEKgY=; b=UvGovQgQKWUzbDOXmQsvIcU8ygpRqh4fGDHVh1WZ6N85572t1rBjrInpFRa4khdKY5 3ir4Y1ftdGzTYbi6xgDSa/QYDH7vJgrUqIso09Z1Xd5HvjRusTCEpB8r6zZcHQ61Fxlx OI/+OsJ98gw9mcRYUuqHx0/wxIPnK/jYi0rkw7IyBSEjb9xsOg6YuiYO8GzjHvam9+rQ Wa3r0ft5fUJffGYHi9vc+gmAte/NaKn15PR7K+6Kg6uAT/2qT0veb2Xc7Iui/SYJe0bb CpGov3Sk6IQ0AZWwtg40eAx5oSt0xtyS/fNU4oh5Pg/gr9+VehPfdDOB/Ug9GNvXXwKA +GUw== 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=G3+CVK8r94N1sJaYl4cTeuh/cF4j3sRvIlNBySKEKgY=; b=p4y/NAzqqR4G9Sn6I0D87VYUxIPMUGnTZvTLMu7MTc7COz5bhNuq2yWZ0uSY51EV89 C8RimQkHxbf+4kh0F3vYhzg59FHqBjlznWmUwRL0q4fwGJTu3R1ynK1mP/+nzYvqIdSc 6MWsNtyXXcUap5TLrRdlHQsnvQ7l+gRFEKa6G1O6Tv4tSVlPpxmotzjVSNEyfrvLFZ9R KUq5jJeLEwmcVFVBnT8gvdJ8Q0H9BCgA+WzvNR4OLW6kuK3ligz8jFMOKgw+k/0gy5CP ZRYhZTh9qV/ub2F8tn16YCiWo0ksVQd+c0bM6nkU0yq+Hmst18Lp6R+aTCvQ1WnKdU4g JXEQ== X-Gm-Message-State: AOAM532JZL59JZ3OfANa0bbEybdPDNJYm+EoAH4siEoxAA7umSNYO6KK ZhLb+ElLawCuVLbiPZQOUc7/5w== X-Received: by 2002:a05:6638:2590:: with SMTP id s16mr28628567jat.121.1628690391653; Wed, 11 Aug 2021 06:59:51 -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 i18sm4915165ilk.84.2021.08.11.06.59.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 06:59:51 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: leon@kernel.org, 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 v2] net: ipa: always inline ipa_aggr_granularity_val() Date: Wed, 11 Aug 2021 08:59:48 -0500 Message-Id: <20210811135948.2634264-1-elder@linaro.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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. We can see by inspection that the value passed is never zero, so we can just remove its WARN_ON() call. Fixes: 5bc5588466a1f ("net: ipa: use WARN_ON() rather than assertions") Reported-by: kernel test robot Signed-off-by: Alex Elder --- v2: Drop WARN_ON() call, as suggested by Leon Romanovsky David/Jakub, the bug this fixes is only in net-next/master. drivers/net/ipa/ipa_main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index f332210ce5354..581b75488c6fe 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -253,12 +253,11 @@ ipa_hardware_config_qsb(struct ipa *ipa, const struct ipa_data *data) /* Compute the value to use in the COUNTER_CFG register AGGR_GRANULARITY * field to represent the given number of microseconds. The value is one * less than the number of timer ticks in the requested period. 0 is not - * a valid granularity value. + * a valid granularity value (so for example @usec must be at least 16 for + * a TIMER_FREQUENCY of 32000). */ -static u32 ipa_aggr_granularity_val(u32 usec) +static __always_inline u32 ipa_aggr_granularity_val(u32 usec) { - WARN_ON(!usec); - return DIV_ROUND_CLOSEST(usec * TIMER_FREQUENCY, USEC_PER_SEC) - 1; } -- 2.27.0