Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp83154pxf; Tue, 30 Mar 2021 20:17:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAtHL8xVJY2jK0DnSPz99hH94i+r/nQgrgYAPVPOdaLFHy2ecgSEZ3n3eNVRU6cNMFIQhd X-Received: by 2002:a05:6402:8d7:: with SMTP id d23mr1113310edz.256.1617160634173; Tue, 30 Mar 2021 20:17:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617160634; cv=none; d=google.com; s=arc-20160816; b=KITgsd3qx1EWuFP5nQBnXYG3jYji1pooKl5+Fb0cRCZngNw9gygC3nHnzeWyIN7qUe GC/FY8pJIfz07TdC9vVHUFExGh4D9GzBDwAZaDaE06AYJoCPPZrV8pq0FJodHWf1OQ+I Ygusbx4Hc05Swb2mA+SSM1vEJ4UsYk2chAG4940L+avzVshc4whuY0r7uC7FL81Aq9m3 rrxgkccet0QSFFsKDwzW+9Sm03ar+Df06HsdtYTONPKIOz7ZNt9h51Uge4TijFthpk5N ozWq8qPbdVF9OlZZDwEX4eR8d+F185rFL0i5tlDdpexcnvH3b8E9vtgInoMsnM1P+CQW 6MwA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pWzx7a4yEEmhkNqim1nF5/sbXLCId4RBCZFnVJCglEI=; b=tjwo5juo0SfY+0TJ2eq+hmGBMTpR5JvqpAC5KAZnH+suFR6K7KB3V9Xhf6WToGU3NP qLhvrlE7RA9Y/vLGeAakO6BoGSm+8pmlfP7brr+9SWpD/wgud5Pz0FRyF4BcM07j1KIQ U2bvKj4gZIpcoLXHu16ubraYEpmpWuoBvggAYzOLyY4Xp0AxXErmebgm6b5UC6Ts9Shs KmrLY45j+cfbGD01Kdj7o8KLmUzA+xpdOYe8WrnVFtW7YNCIA/MR8q9IyUfhTOL8dyxX 8hG3tIzcG5lwHfRX1SO1yEiQFZOVFWO8fTdFz+yaxMGuUr/XK2oqlLOsrEFh1Ci1/uth ipyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=P2OhPPci; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c20si704372edw.141.2021.03.30.20.16.51; Tue, 30 Mar 2021 20:17:14 -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=@chromium.org header.s=google header.b=P2OhPPci; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233593AbhCaDFu (ORCPT + 99 others); Tue, 30 Mar 2021 23:05:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233482AbhCaDFg (ORCPT ); Tue, 30 Mar 2021 23:05:36 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23A21C061574 for ; Tue, 30 Mar 2021 20:05:36 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id v8so7181825plz.10 for ; Tue, 30 Mar 2021 20:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pWzx7a4yEEmhkNqim1nF5/sbXLCId4RBCZFnVJCglEI=; b=P2OhPPciQb6hE6N+KG/SrmQe8072khFFaPOMQKgmkRY1TmJCIRrvC2Hw8hh4EzpqKw QG5W3Vqx4SezW2u1O3WoP49okxD/VFfG3UuVkXO6rqLmbHjdWosjqA7Tli1Do99o0e7P XHijkCp3AXyHvcuQlUV5prvltQ6jBs7u3c6as= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=pWzx7a4yEEmhkNqim1nF5/sbXLCId4RBCZFnVJCglEI=; b=Ou9vPPam9u6RU0GZJsjQ6JLUXlwzMbNw5GOZsDSI1YIGx08tlDQys7ynbczLyoMYra T9+Sfl6LPGdNHev7MFicjwGiKkZLZdxwLzJ6E2a9NvOmW0cuytZsoJOdxeYO3xduelCc 4+aODt3k8hMhdxgDEgwHGCfsf52qiTgNTmakDVdxtn+dCEBtZ5fYVRTCBEqLp9CIOnJl ROVlrCStH8W9P+f/jCeb7I8wxIAI4FevzPCH9nqvTKYoSsw5fA5zZ02FAMiDBr+3MbdQ ueYiTSbdAf7TGRVMCHA3CoPg+ElF7Gnilhzh9rJ/DiRTrWsa+TUHtRpAq3yuemezhnt5 V4Qw== X-Gm-Message-State: AOAM532mGvhRPpcSGCeTjSNgbe2i+UoYMhoAEzCXA0tzhapeVfvzq4b1 rq/YenfzCvMeDH2CFysEsFlc5Q== X-Received: by 2002:a17:902:8498:b029:e6:f010:a6fa with SMTP id c24-20020a1709028498b02900e6f010a6famr1292084plo.30.1617159935730; Tue, 30 Mar 2021 20:05:35 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:201:c8c2:b814:df0f:253f]) by smtp.gmail.com with ESMTPSA id c6sm389024pfj.99.2021.03.30.20.05.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 20:05:35 -0700 (PDT) From: Stephen Boyd To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Jiri Olsa , Alexei Starovoitov , Jessica Yu , Evan Green , Hsin-Yi Wang Subject: [PATCH v3 10/12] buildid: Mark some arguments const Date: Tue, 30 Mar 2021 20:05:18 -0700 Message-Id: <20210331030520.3816265-11-swboyd@chromium.org> X-Mailer: git-send-email 2.31.0.291.g576ba9dcdaf-goog In-Reply-To: <20210331030520.3816265-1-swboyd@chromium.org> References: <20210331030520.3816265-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These arguments are never modified so they can be marked const to indicate as such. Cc: Jiri Olsa Cc: Alexei Starovoitov Cc: Jessica Yu Cc: Evan Green Cc: Hsin-Yi Wang Signed-off-by: Stephen Boyd --- lib/buildid.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/buildid.c b/lib/buildid.c index b939bbc59233..e8a473f2b023 100644 --- a/lib/buildid.c +++ b/lib/buildid.c @@ -47,10 +47,10 @@ static int parse_build_id_buf(unsigned char *build_id, return -EINVAL; } -static inline int parse_build_id(void *page_addr, +static inline int parse_build_id(const void *page_addr, unsigned char *build_id, __u32 *size, - void *note_start, + const void *note_start, Elf32_Word note_size) { /* check for overflow */ @@ -65,7 +65,7 @@ static inline int parse_build_id(void *page_addr, } /* Parse build ID from 32-bit ELF */ -static int get_build_id_32(void *page_addr, unsigned char *build_id, +static int get_build_id_32(const void *page_addr, unsigned char *build_id, __u32 *size) { Elf32_Ehdr *ehdr = (Elf32_Ehdr *)page_addr; @@ -90,7 +90,7 @@ static int get_build_id_32(void *page_addr, unsigned char *build_id, } /* Parse build ID from 64-bit ELF */ -static int get_build_id_64(void *page_addr, unsigned char *build_id, +static int get_build_id_64(const void *page_addr, unsigned char *build_id, __u32 *size) { Elf64_Ehdr *ehdr = (Elf64_Ehdr *)page_addr; -- https://chromeos.dev