From patchwork Fri Jul 14 14:20:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Protopopov X-Patchwork-Id: 703457 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 0FDAFC001B0 for ; Fri, 14 Jul 2023 14:20:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235568AbjGNOUO (ORCPT ); Fri, 14 Jul 2023 10:20:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235454AbjGNOUM (ORCPT ); Fri, 14 Jul 2023 10:20:12 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0184235AA for ; Fri, 14 Jul 2023 07:19:59 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-99313a34b2dso251222666b.1 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=guvtJNi23ztxrj+2AFzlYBz912rjLDsNPVpy+JzT7MIlF1hfMl7AkcZkF+tbh6Yu6D vz7/qqF95LSu3VWNaMq2UyLug+TXFYnUAxa8MLErDho9JAdpGu3IK3sVmYj0qKgrdQWB qpzVqk7DiBSaI29q1pXMPDeD1+kHYb3jz/OFglttTkLhxjxso+L7KefUMyJW3H0ZXSbs wvx+Pex6QeQwZ4GF0lwp3NyylhYNa82c7S1VcxyVn9+JlRfK7J4tEu1cp1UoMuvIjHcA CKIVuJOtwrXXVn7ZiZYSoODeh/EalYMIdUkpb9DkWmpUItQaNAcxtbMFh2B0N4SEr/+j 933Q== X-Gm-Message-State: ABy/qLZ0gPAZnzOpjYCLd29ZhdYSHPP8bhBpzZm4rEHx8rsYbVs4UeCq w/ZY1bYAvHCuTXvbvXe3Gv++lA== 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 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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"); -__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 = 0;