Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751883AbcDREES (ORCPT ); Mon, 18 Apr 2016 00:04:18 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:47948 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751588AbcDREEO (ORCPT ); Mon, 18 Apr 2016 00:04:14 -0400 Date: Mon, 18 Apr 2016 00:04:09 -0400 (EDT) Message-Id: <20160418.000409.811805682656661992.davem@davemloft.net> To: arnd@arndb.de Cc: netdev@vger.kernel.org, rostedt@goodmis.org, mingo@redhat.com, ast@fb.com, daniel@iogearbox.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] bpf: avoid warning for wrong pointer cast From: David Miller In-Reply-To: <1460838585-1248139-1-git-send-email-arnd@arndb.de> References: <1460838585-1248139-1-git-send-email-arnd@arndb.de> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sun, 17 Apr 2016 21:04:13 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 753 Lines: 18 From: Arnd Bergmann Date: Sat, 16 Apr 2016 22:29:33 +0200 > Two new functions in bpf contain a cast from a 'u64' to a > pointer. This works on 64-bit architectures but causes a warning > on all 32-bit architectures: > > kernel/trace/bpf_trace.c: In function 'bpf_perf_event_output_tp': > kernel/trace/bpf_trace.c:350:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] > u64 ctx = *(long *)r1; > > This changes the cast to first convert the u64 argument into a uintptr_t, > which is guaranteed to be the same size as a pointer. > > Signed-off-by: Arnd Bergmann > Fixes: 9940d67c93b5 ("bpf: support bpf_get_stackid() and bpf_perf_event_output() in tracepoint programs") Applied.