Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3622154pxb; Mon, 24 Jan 2022 13:43:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrTc8dJZKjiKpyrXddSA6++ZC6HyN9NuTURbuRdJDOBGd+BC3G+EguK/bjWS/2eoSdoY+x X-Received: by 2002:a17:902:a3c7:b0:14a:d8bf:4e09 with SMTP id q7-20020a170902a3c700b0014ad8bf4e09mr16451328plb.62.1643060624970; Mon, 24 Jan 2022 13:43:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643060624; cv=none; d=google.com; s=arc-20160816; b=HxATOt3tirOE+5uQUX83Yo2ABvUQ8KmmHrl+ZGeyQimk9e86zrb3jL7xq7vmlOHnDP TX7kDoMSshau7EaAEJPcPVrvbJnY44iBiaX1fI/XnU6tPYC5SCGB843XkgH6lR6olqSc bO/1AAyKwF/tdLPf5YQalYgLxN9GtHwBaycHFTQw01fSjUB7YNnx0ip0+76WmHcW3U30 9/MqsBSSMmSekodLcQjRn2epl2XhbLPh/QioO5GNuXViULQSMSEuckOO3GOYbjOeuqDy 2GjeOnzJH34hjZTQdn/XIQUynxuPEe4rMB/oBwFuqTN5qpY7xBWxIu0IV9UqmUS2q44T SCWw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ss1kt7yegBJi76rZkquEi0nSRzxJ6i2QXAhsq0RElXs=; b=op3bNLT0m3mpQ25qhLmcoPX2B4Djg6QCd/bbhHW4an6QJwykGPPIA8+AAMT8CmgKRK ewPXu0b5fpiZUbs7PJOBJ64E7Q5Jnq5i4usXpYhaCNRTC0uCNOtQwaQXZ4ksdtQMquRv 9KZga21NPE9STvwLLLW+5+9qHH/UU6ttlr+ldABLUqdD+ZRl7sX9B32bgQYZwVWI+p6a +ZyEb8CX72RzLZr1ZzOtGaWACZnQ2cxnkgHEYaZciqY+4gkIYOd4nqfvEyxURdfOMldh kQ94ts+Bh4QBZQkXaL+8b7WJyY2JS33woek3D/Zx/dPUeXyABAhnH7LVkDx0xJMh71Jv oC+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Q0icwx5U; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mu17si525283pjb.123.2022.01.24.13.43.26; Mon, 24 Jan 2022 13:43:44 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=Q0icwx5U; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1452257AbiAXVY0 (ORCPT + 99 others); Mon, 24 Jan 2022 16:24:26 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:53064 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234558AbiAXU6E (ORCPT ); Mon, 24 Jan 2022 15:58:04 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 53E93B80FA1; Mon, 24 Jan 2022 20:58:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80242C340E5; Mon, 24 Jan 2022 20:58:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057881; bh=ar9ht5AP9dAkNJ725Y7CCDGfnkeI2slBT93cSTlvyOk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q0icwx5UClFFqNtz9hZdmZD15jPKYJD4tz3/EwnOP7F9RbbvRjhc7H7RyA6xpR8RN Cksf4fqDdcgiJqRnPMfNCOoLrsRFYlaYGDTlMWouBDvVwF4r+p+4d5ipMTVTSqR9oX isQ6HKZmHNxtcKCSesythzbN4YRy3qW+QM3mHkOE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrii Nakryiko , Alexei Starovoitov , Kumar Kartikeya Dwivedi , Sasha Levin Subject: [PATCH 5.16 0109/1039] libbpf: Fix non-C89 loop variable declaration in gen_loader.c Date: Mon, 24 Jan 2022 19:31:38 +0100 Message-Id: <20220124184128.805775372@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrii Nakryiko [ Upstream commit b8b5cb55f5d3f03cc1479a3768d68173a10359ad ] Fix the `int i` declaration inside the for statement. This is non-C89 compliant. See [0] for user report breaking BCC build. [0] https://github.com/libbpf/libbpf/issues/403 Fixes: 18f4fccbf314 ("libbpf: Update gen_loader to emit BTF_KIND_FUNC relocations") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/bpf/20211105191055.3324874-1-andrii@kernel.org Signed-off-by: Sasha Levin --- tools/lib/bpf/gen_loader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/lib/bpf/gen_loader.c b/tools/lib/bpf/gen_loader.c index 9934851ccde76..5aad39e92a7a5 100644 --- a/tools/lib/bpf/gen_loader.c +++ b/tools/lib/bpf/gen_loader.c @@ -597,8 +597,9 @@ void bpf_gen__record_extern(struct bpf_gen *gen, const char *name, bool is_weak, static struct ksym_desc *get_ksym_desc(struct bpf_gen *gen, struct ksym_relo_desc *relo) { struct ksym_desc *kdesc; + int i; - for (int i = 0; i < gen->nr_ksyms; i++) { + for (i = 0; i < gen->nr_ksyms; i++) { if (!strcmp(gen->ksyms[i].name, relo->name)) { gen->ksyms[i].ref++; return &gen->ksyms[i]; -- 2.34.1