Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1950956rdb; Tue, 3 Oct 2023 06:16:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkG1lnrbgHQ76tXjymlnrzreViUV5+LiwuJbuB/hIpIguNb8ztYMic/CdvRxG41xGfi6n3 X-Received: by 2002:a17:902:f814:b0:1c7:4ac4:8f46 with SMTP id ix20-20020a170902f81400b001c74ac48f46mr11567076plb.14.1696338960648; Tue, 03 Oct 2023 06:16:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696338960; cv=none; d=google.com; s=arc-20160816; b=Wo32h9OmMyfUOKuIGzsQi8pBvZUuCA6V2s7/9+v/Mjsn/LxXEJnZ88O9v1WFuiKO7p IQjQmw6ciJzsZ0mXYigsPIQhW3T72e7okbGjf7jRK3G7xSHJjdFVNtGJtIbnbboCf9cZ N4ryFsfiKEoXZH2lJec0RXx/1l1gecAcVO2BX0dXPZKH6nmkx6TGOCJI077zJlLLQuNA Z02zuwJLIH8khhUP4mauB2Suzc7l/ASP3hshhX641TVNzX9qZvE9lZIVRP2foVs4cNRy 2zTQnaM9jvXDyihTBi/TU9oRCSwz3Zl5qo9BItlXpOlCuxbr1ppZ8aAkCT/Sl1Jd1Csl xUZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=U15ZLLNTITW4ykIdt0NT6HPskp6DqhMFh03Owm2vHKk=; fh=4MbyDezWsupPFwrjlLHLQVq/3bp/iyvR9UnBJz9P4ck=; b=IJ4DxNKzSkFN+rfl7Yc+dg9ABespAhXL8FLN/JGLiGSwIAT6ZNSqORPtXmgqgduLNX Vwg5pMztgGgt2TEIUxRobWSaPd8r4n1Eh7YlHF9eL6sWgtRCZe1VbVxs3TjHGKhnOSwJ Lf30ch76663ed+MxnHlaPd8dT7i4kt/eW7UtwpN1l/cKREXzuuxFYddLJUFOKicqc616 Zi8wFQhimTKa/Sb+Hu69qdLqJFE3xyL8PbtXP9JDeT3DGS0X6C4MwHChxMmK+wKtqGF9 a0N7ELFd2P7mlRFB4L2MjtA7bYBZwSKN9Gh0wIp/XsHMyDTStg2Yqq7y5gohCFqbsu9G Jurw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=bjXA7XOX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id jx5-20020a170903138500b001b9e9b21249si1215806plb.649.2023.10.03.06.15.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 06:16:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=bjXA7XOX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 04B7880DF274; Tue, 3 Oct 2023 06:15:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232517AbjJCNPo (ORCPT + 99 others); Tue, 3 Oct 2023 09:15:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235376AbjJCNPi (ORCPT ); Tue, 3 Oct 2023 09:15:38 -0400 Received: from smtp-bc08.mail.infomaniak.ch (smtp-bc08.mail.infomaniak.ch [IPv6:2001:1600:4:17::bc08]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E01B100 for ; Tue, 3 Oct 2023 06:15:31 -0700 (PDT) Received: from smtp-3-0001.mail.infomaniak.ch (unknown [10.4.36.108]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4S0JGN1SdlzMqN0Q; Tue, 3 Oct 2023 13:15:24 +0000 (UTC) Received: from unknown by smtp-3-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4S0JGM1Ml8zMppBN; Tue, 3 Oct 2023 15:15:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1696338924; bh=mYXOJz9gAA/llGqc8uja06Dbq61EdeXQL0OOvglJWBw=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=bjXA7XOX13EKX+vc5LCkJetsHYHgzPULA+1gAEpaqNFZ9FusLSnpTbijlBTmaUUrY Go4PIClN/Mzu3FvFYrxZIN7aLTMZqF6EU334UiM+U2PomHPmP2IXgtbzKlNz6XS/Kn AgLUGGTixs44NQIt7DiNAxfZnYs+Px6a+AQNKhpI= Date: Tue, 3 Oct 2023 15:15:22 +0200 From: =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= To: Stephen Rothwell Cc: Konstantin Meskhidze , Linux Kernel Mailing List , Linux Next Mailing List , willemdebruijn.kernel@gmail.com, gnoack3000@gmail.com, linux-security-module@vger.kernel.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, yusongping@huawei.com, artem.kuzin@huawei.com, Geert Uytterhoeven , Arnd Bergmann , Randy Dunlap Subject: Re: linux-next: build warning after merge of the landlock tree Message-ID: <20231003.ahPha5bengee@digikod.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231003142737.381e7dcb@canb.auug.org.au> <20230920092641.832134-12-konstantin.meskhidze@huawei.com> X-Infomaniak-Routing: alpha X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 03 Oct 2023 06:15:54 -0700 (PDT) PowerPC-64 follows the LP64 data model and then uses int-l64.h (instead of int-ll64.h like most architectures) for user space code. Here is the same code with the (suggested) "%lu" token on x86_86: samples/landlock/sandboxer.c: In function ‘populate_ruleset_net’: samples/landlock/sandboxer.c:170:77: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘__u64’ {aka ‘long long unsigned int’} [-Werror=format=] 170 | "Failed to update the ruleset with port \"%lu\": %s\n", | ~~^ | | | long unsigned int | %llu 171 | net_port.port, strerror(errno)); | ~~~~~~~~~~~~~ | | | __u64 {aka long long unsigned int} We would then need to cast __u64 to unsigned long long to avoid this warning, which may look useless, of even buggy, for people taking a look at this sample. Anyway, it makes more sense to cast it to __u16 because it is the expected type for a TCP port. I'm updating the patch with that. Konstantin, please take this fix for the next series: https://git.kernel.org/mic/c/fc9de206a61a On Tue, Oct 03, 2023 at 02:27:37PM +1100, Stephen Rothwell wrote: > Hi all, > > After merging the landlock tree, today's linux-next build (powerpc > allyesconfig) produced this warning: > > samples/landlock/sandboxer.c: In function 'populate_ruleset_net': > samples/landlock/sandboxer.c:170:78: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type '__u64' {aka 'long unsigned int'} [-Wformat=] > 170 | "Failed to update the ruleset with port \"%llu\": %s\n", > | ~~~^ > | | > | long long unsigned int > | %lu > 171 | net_port.port, strerror(errno)); > | ~~~~~~~~~~~~~ > | | > | __u64 {aka long unsigned int} > > Introduced by commit > > 24889e7a2079 ("samples/landlock: Add network demo") > > -- > Cheers, > Stephen Rothwell