Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp546297pxb; Thu, 15 Apr 2021 00:19:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzZvzhaBOYIiKKd2YBXRKxPJDgwPzAzschwFLop4e4AKGQBFYz3zb5HD50l1Vy+GhWtVMp X-Received: by 2002:a63:2e47:: with SMTP id u68mr2294672pgu.6.1618471167506; Thu, 15 Apr 2021 00:19:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618471167; cv=none; d=google.com; s=arc-20160816; b=0kCXEvz1rPXQTIIY/VR1cCTApdeCiAnOl7FCeOxBnM8IHQtJkkb1owamXYtfedJBgx bcUQLD3s+lv/MPAFJCaWJsVeQ5UiGBor2oKGgyGIm9uci1MWY1IcX/MatZcaDCtcsBWY 9vf1UeYO4L8eDAIqqgDEXWx8tcDsVtodIm13i2ASU3qYPS2MBEpY2ko9MjhgJcXyXBSJ szW54tgtRtpVLeqJwE5JRcNSfhgNt+PRwrqGPhwKA72NkZRQK4WP+tblUBpx/6VYdAB/ Ez+kREfzp0XUHuv8enyYeM9nNqV+IlCusxwXiEl2J6KP5UL3hy0vP18sjVUm15JGGLoV BGGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=TYpEFy4TiS8JfXQcnDIWzjJBFSrstXrUZn7dBlSbGg0=; b=JekmCPGXYoJHuHkR/cS4HtmvrOS6xPN6/G+XioCmDv9xnNENxa3EfIWOycNeSC5Pva tdl70I3bUc7AdA5p38jVRkoSIVAxedSVwOmcq7cq9lt718/L15GdDjiaqSCivhTx2BKk cKmTUXfqCxhDHl2QYXSuFlKm/SriCTPh9yQb+6lymv3T44Cmrap9mvk7qS8s/z6ymJH/ XyAAeLF5Vs0mjP48BsLorFevmRZaqW00uwaJ95G+ajisufG6eGG9OJO/bHmZ8LUUzvDY xvY4Cw7xRkYkus7aItoYMK9Ksl3tzjL3p4WWsr9MFXHJ1dI+IXckBcHhYfwawX8RIlD7 VpoA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w132si2414635pfd.78.2021.04.15.00.19.15; Thu, 15 Apr 2021 00:19:27 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231251AbhDOHTA (ORCPT + 99 others); Thu, 15 Apr 2021 03:19:00 -0400 Received: from mail-ua1-f45.google.com ([209.85.222.45]:34567 "EHLO mail-ua1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230090AbhDOHTA (ORCPT ); Thu, 15 Apr 2021 03:19:00 -0400 Received: by mail-ua1-f45.google.com with SMTP id s2so7220196uap.1; Thu, 15 Apr 2021 00:18:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TYpEFy4TiS8JfXQcnDIWzjJBFSrstXrUZn7dBlSbGg0=; b=twCmbuKS/Jjeqc97M5GoqKHZEYetz6QQFR+i5fK7HEu2yUI1vnKx6L+Yidg/kZmndj McmIEZLEYa7U8FJVtgfscbUztCA9GUmtWviyltOfdDFmuQ5RRBDLXdo/jRCJ0O3eOmwp 3ta+CL82FL3W4qAhTleYZG+d3gu0nyKMBzse4j3mxhjjJ4hr5+Igl6CLp923FVplcmvG ci2EBwqVJu60vuoI9c0dw52+dC0gRAsTQMeqz0Eslu8EZfQrVdzBcCf2NPi71bCCoP7y WgT/icfSMgPMT0Htw3LJk4Kj2R+MIcbu0AeUGOfEGAb1ePHZiJvEQkM5MOHehcP+WAUJ KajA== X-Gm-Message-State: AOAM532DNwrNOWpV8pD4IjUmqrxblGuMIjcFyb2T26vTUymlR3Y2l8wx dUz2nmD3pmUhAHe8GImwVaeJzLarp3gp3+KAFuc= X-Received: by 2002:ab0:2c16:: with SMTP id l22mr856492uar.100.1618471117162; Thu, 15 Apr 2021 00:18:37 -0700 (PDT) MIME-Version: 1.0 References: <20210412153754.235500-1-revest@chromium.org> <20210412153754.235500-4-revest@chromium.org> In-Reply-To: From: Geert Uytterhoeven Date: Thu, 15 Apr 2021 09:18:25 +0200 Message-ID: Subject: Re: [PATCH bpf-next v3 3/6] bpf: Add a bpf_snprintf helper To: Andrii Nakryiko Cc: Florent Revest , bpf , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Yonghong Song , KP Singh , Brendan Jackman , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrii, On Thu, Apr 15, 2021 at 12:58 AM Andrii Nakryiko wrote: > On Wed, Apr 14, 2021 at 11:30 AM Florent Revest wrote: > > On Wed, Apr 14, 2021 at 8:02 PM Geert Uytterhoeven wrote: > > > On Wed, Apr 14, 2021 at 9:41 AM Andrii Nakryiko > > > wrote: > > > > On Mon, Apr 12, 2021 at 8:38 AM Florent Revest wrote: > > > > > + fmt = (char *)fmt_addr + fmt_map_off; > > > > > + > > > > > > > > bot complained about lack of (long) cast before fmt_addr, please address > > > > > > (uintptr_t), I assume? > > > > (uintptr_t) seems more correct to me as well. However, I just had a > > look at the rest of verifier.c and (long) casts are already used > > pretty much everywhere whereas uintptr_t isn't used yet. > > I'll send a v4 with a long cast for the sake of consistency with the > > rest of the verifier. > > right, I don't care about long or uintptr_t, both are guaranteed to > work, I just remember seeing a lot of code with (long) cast. I have no > preference. AFAIR, uintptr_t was introduced only in C99. Early Linux code predates that, hence uses long, and this behavior was of course copied to new code. Please use uintptr_t in new code. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds