Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp833908pxb; Fri, 22 Apr 2022 12:10:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwcNr1zDIaYpP5hml2FFsZKU8BQTp7yRtG4+HRGae3Z+pvDik1X09Vml/LtTBoH/GvEJ90 X-Received: by 2002:a63:6c8a:0:b0:398:5208:220a with SMTP id h132-20020a636c8a000000b003985208220amr5165176pgc.176.1650654626968; Fri, 22 Apr 2022 12:10:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650654626; cv=none; d=google.com; s=arc-20160816; b=BOw8IebEEiyL45B9p/cdqgYLknMi1AjLkNWMWnSPIbP1hi3h5rNeLi8017HvIphjYW NL198Fwhf8l4IzY4Bd7n2hp9KFHGb91SfkaDRA0JMI9QGQNsevd7cPJZ85BH6YYlbgw1 LpbViUBbHBvXlFKImFEL0arHkPQoEN4Qh9IfZdMWN7sJyvdwTSaioxzw9ZONWO+lm9Dc cYdxr/IkH6NbwOZBTci5uRBGQQnIvdgOPh5BaPZKgDvAY7zBp4lLmg5PTMdX6RB+CxHJ Fn1ts9r8ux6m2kFfO86OOzwntgHGMd8w83TWayqbaNCRB1d6W1LRR7Q90ZaoptZWjUfs Ijqg== 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 :feedback-id:references:in-reply-to:message-id:subject:reply-to:cc :from:to:dkim-signature:date; bh=Iim1B9+7pfJQA0zio9onHWmYuVu09gT54/zLmt1I/XM=; b=lFSUmug+NSRuCnj33/bVxVrrUG+lnK4gamkfus0dgi6s0uGLL9Ocia7whAa8ka76KS h/4JNOB+0jz/XN0rcT18EFS7uOPpsyTK666IvBe19rBMQl+7T5txQGTDfaVOg9GvnaoI 2nX+VJfGBooMAOPUwn3B2N4yHkw281gTswgx2w2Nd9Z7z2SL4W8Nn0Bz/nLjDUvCsQP2 7wWyp+g8MiC5tv1f3UCEuXrs8B/a5MvwVEJGIE9b5PWKM2Nf9+S6SqhuSnym2d0YdkF9 NFySZbMWDwIofhsf2FgSEMUtlJoMTjc6QMPtqy47T0BFIreBQMPHn1Z/re/d/puR/2/m yMWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail2 header.b=pW7B4YEg; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id r5-20020a634405000000b0039da27d8d13si8857109pga.245.2022.04.22.12.10.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 12:10:26 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail2 header.b=pW7B4YEg; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 44D7A1A5802; Fri, 22 Apr 2022 11:28:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1392061AbiDUW6K (ORCPT + 99 others); Thu, 21 Apr 2022 18:58:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1391899AbiDUW6I (ORCPT ); Thu, 21 Apr 2022 18:58:08 -0400 Received: from mail-40134.protonmail.ch (mail-40134.protonmail.ch [185.70.40.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9EA113D3E; Thu, 21 Apr 2022 15:55:17 -0700 (PDT) Date: Thu, 21 Apr 2022 22:55:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail2; t=1650581716; bh=Iim1B9+7pfJQA0zio9onHWmYuVu09gT54/zLmt1I/XM=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=pW7B4YEgX0LUsDppRLFacHpDL4ECXl2ix1oo3GvZ/Ya0UWDTO59yZlgM4UDD/1ZMd Fr/i12bP4w8n/w0nuxjxh6jhfSKHc4p0geBvTQfltcOxbwKs7kW9DZHa2cNuNWobnX k8sAZEnnIs/zLGJcGyAcBujwhRdMbQAl9Q7G0KbFQSkWTR3kTelQ3zVhQA3iARfrIE bfY5H8Kr9kZSj8QgQTdb0JL8P3kIurtwfOvVeT95syuWIhiEz0RshbpROD7FZ1X8Of YvBuJFypxO5XrhB+EDYhHmqW0cmMvm+nUml+g+kzlmig90PGbGfPgHI7t52HMTVspY TSx9zWX6QCfNA== To: David Laight From: Alexander Lobakin Cc: Alexander Lobakin , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Maciej Fijalkowski , Song Liu , Kumar Kartikeya Dwivedi , "bpf@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Reply-To: Alexander Lobakin Subject: Re: [PATCH v2 bpf 07/11] samples/bpf: fix uin64_t format literals Message-ID: <20220421224816.332419-1-alobakin@pm.me> In-Reply-To: References: <20220421003152.339542-1-alobakin@pm.me> <20220421003152.339542-8-alobakin@pm.me> Feedback-ID: 22809121:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Laight Date: Thu, 21 Apr 2022 07:46:05 +0000 > From: Alexander Lobakin > > Sent: 21 April 2022 01:40 > > > > There's a couple places where uin64_t is being passed as an %lu > > format argument. That type is defined as unsigned long on 64-bit > > systems and as unsigned long long on 32-bit, so neither %lu nor > > %llu are not universal. > > One of the options is %PRIu64, but since it's always 8-byte long, > > just cast it to the _proper_ __u64 and print as %llu. > > Is __u64 guaranteed to be 'unsigned long long' ? No reason why it should = be. > I think you need to cast to (unsigned long long). __u64 can be unsigned long only if an architecture uses int-l64.h instead of int-ll64.h. This is currently possible for Alpha and PPC64 when __SANE_USERSPACE_TYPES__ is not defined -- I guess you know what that flag does. I messed up a bit and didn't notice that samples/bpf/Makefile defines this flag only for MIPS. IMO it should be defined in here unconditionally, but I guess it's out of bpf-fixes scope, so I'll go with unsigned long long in v3 (got to resend with no PGP crap anyway lol). > > =09David --- 8< --- > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1= 1PT, UK > Registration No: 1397386 (Wales) Thanks, Al