From nobody Mon Feb 9 17:35:52 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF562EB64DC for ; Fri, 14 Jul 2023 14:20:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235631AbjGNOUX (ORCPT ); Fri, 14 Jul 2023 10:20:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235515AbjGNOUM (ORCPT ); Fri, 14 Jul 2023 10:20:12 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0539035BC for ; Fri, 14 Jul 2023 07:20:00 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-9741caaf9d4so252596866b.0 for ; Fri, 14 Jul 2023 07:19:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=isovalent.com; s=google; t=1689344398; x=1691936398; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=O4zgnqP7ASsB+eUpBj68dhMcY1VzfTyfkf9nUd4K0Yg=; b=TH0mhba8d76c7Ka/TPMFwg664iBScu0zUMrviGBOrnld29U0ezZQ12/r0PR+0/oaHW wxHfKcWtJqqGt0rT8Nh87BExLDIHT4FWrefDnQeTelmuyC+fjSPcVA41NhUb9PLFAaHC 7h+LaS2nyFQFpSFVQDhT/gKp7ShQGXW/08e0nEBaa/IqWeg1OtAFin07xJ3q+c9Wu6VM SGkgBWb1XxwTXtjThxfgKB609GRd8BTw38kPue5yvOJX3O0/fFSZZSd3QJmhqUWczuPe bk96qig+pVvkXD6uMmXXfdwPtsrGDbdKoFLzTi8nHsn8iZStYk7AfRVlxZ1MYZCAK1w/ RpbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689344398; x=1691936398; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O4zgnqP7ASsB+eUpBj68dhMcY1VzfTyfkf9nUd4K0Yg=; b=AOET0YJvCnwMZGRyVz3gLiej2SI2xezhyIyXbHz/0vpqIyHx0bXeH7p/gX7zccOo8o ergAjdVPNDgMJm1BVAiAAxq6gzsSiZ/6dHbMslKGqZS43WUg6MGr57mjluARmBF33rM8 ChRFvIOkyH5Hh5E+KChUnajMXdOYYUeVxryx4zq/38LqAzNpDuY1goo6dqjZmth1Cjb/ H5sfePvZ3PNGryT4gVjB+N/cwe3oZAAK/ARpndlT2lpknXXL+Ek++5xvVWAXQqIVAM2U 8WzEnjo8XBSdnqb1bfqfz2uJf5mkWg9G42q2VAYFrKlMXt6OJyarcG27IFndef1QCL3h smAQ== X-Gm-Message-State: ABy/qLaZYIXEJrJFQ+fnCvIESD+/hUJ2hN3Pz1iCUhYOYeCdMIaKd7Uu aVdHOW9HL8ioh9m7aj/P/YPBgA== X-Google-Smtp-Source: APBJJlG6aTI+UM8YICICq6ZGR8uS5qkOUtVH5/T1tGNddtCWDEE72Dhzu9qW4+p9Nb3eFzEA2rgCXw== X-Received: by 2002:a17:906:248:b0:994:569b:61b6 with SMTP id 8-20020a170906024800b00994569b61b6mr484575ejl.40.1689344398399; Fri, 14 Jul 2023 07:19:58 -0700 (PDT) Received: from zh-lab-node-5.home ([2a02:168:f656:0:1ac0:4dff:fe0f:3782]) by smtp.gmail.com with ESMTPSA id n11-20020a1709061d0b00b00982cfe1fe5dsm5469294ejh.65.2023.07.14.07.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jul 2023 07:19:58 -0700 (PDT) From: Anton Protopopov To: Martin KaFai Lau , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan , Hou Tao , Joe Stringer , Anton Protopopov , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH bpf-next 2/3] bpf: make an argument const in the bpf_map_sum_elem_count kfunc Date: Fri, 14 Jul 2023 14:20:59 +0000 Message-Id: <20230714142100.42265-3-aspsk@isovalent.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230714142100.42265-1-aspsk@isovalent.com> References: <20230714141747.41560-1-aspsk@isovalent.com> <20230714142100.42265-1-aspsk@isovalent.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" We use the map pointer only to read the counter values, no locking involved, so mark the argument as const. Signed-off-by: Anton Protopopov --- kernel/bpf/map_iter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/bpf/map_iter.c b/kernel/bpf/map_iter.c index b67996147895..011adb41858e 100644 --- a/kernel/bpf/map_iter.c +++ b/kernel/bpf/map_iter.c @@ -197,7 +197,7 @@ __diag_push(); __diag_ignore_all("-Wmissing-prototypes", "Global functions as their definitions will be in vmlinux BTF"); =20 -__bpf_kfunc s64 bpf_map_sum_elem_count(struct bpf_map *map) +__bpf_kfunc s64 bpf_map_sum_elem_count(const struct bpf_map *map) { s64 *pcount; s64 ret =3D 0; --=20 2.34.1