From patchwork Tue Sep 1 15:11:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 310487 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AAC28C433E7 for ; Tue, 1 Sep 2020 15:35:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 700CD2168B for ; Tue, 1 Sep 2020 15:35:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974539; bh=kJroAU+bPWmuBWwjyzwkJDmAEwa1hWHKBm6/zt7PGJo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=N4X4lYYe0xVS83+ABZYgJ7ig/aBQUG2G1rr+gTwWEQ/TlIimVRtgVTqIML7NtL0t+ latvEmvAGAlqSGoElM2opSXAUR7xu7oAcbBOJXoI8a9nI7g0k1Rs/xWGj8LDRZhe9K FKLjCrREA+fhpscsrvFlYcRIPH09UvPweqz8f9K4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728663AbgIAPfi (ORCPT ); Tue, 1 Sep 2020 11:35:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:41470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727903AbgIAPff (ORCPT ); Tue, 1 Sep 2020 11:35:35 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 39D2C20866; Tue, 1 Sep 2020 15:35:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974534; bh=kJroAU+bPWmuBWwjyzwkJDmAEwa1hWHKBm6/zt7PGJo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c2uDSOYMntUbW67lLDKrvSaBEvRWMxjKlzrGLQjSxwltBDugcXwAqbtbFPuzolq53 n/9gDUMmQItaFoNnpPK8/RhVnq8mProO++NviXE/U2Z/qesheoPL9nCs9Pb//zP5tW m+NAighaVziHWmxUDoJDuFZtK82zOVoEHcYDTOnU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrii Nakryiko , Alexei Starovoitov Subject: [PATCH 5.4 213/214] libbpf: Fix build on ppc64le architecture Date: Tue, 1 Sep 2020 17:11:33 +0200 Message-Id: <20200901151003.130906588@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200901150952.963606936@linuxfoundation.org> References: <20200901150952.963606936@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Andrii Nakryiko commit 3fb1a96a91120877488071a167d26d76be4be977 upstream. On ppc64le we get the following warning: In file included from btf_dump.c:16:0: btf_dump.c: In function ‘btf_dump_emit_struct_def’: ../include/linux/kernel.h:20:17: error: comparison of distinct pointer types lacks a cast [-Werror] (void) (&_max1 == &_max2); \ ^ btf_dump.c:882:11: note: in expansion of macro ‘max’ m_sz = max(0LL, btf__resolve_size(d->btf, m->type)); ^~~ Fix by explicitly casting to __s64, which is a return type from btf__resolve_size(). Fixes: 702eddc77a90 ("libbpf: Handle GCC built-in types for Arm NEON") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200818164456.1181661-1-andriin@fb.com Signed-off-by: Greg Kroah-Hartman --- tools/lib/bpf/btf_dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/lib/bpf/btf_dump.c +++ b/tools/lib/bpf/btf_dump.c @@ -906,7 +906,7 @@ static void btf_dump_emit_struct_def(str btf_dump_printf(d, ": %d", m_sz); off = m_off + m_sz; } else { - m_sz = max(0LL, btf__resolve_size(d->btf, m->type)); + m_sz = max((__s64)0, btf__resolve_size(d->btf, m->type)); off = m_off + m_sz * 8; } btf_dump_printf(d, ";");