Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8284365rwb; Tue, 13 Dec 2022 04:41:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf4L18VAeINepe1NScjHgMAx2u83vFXo1Y/X1fGiAORkU5FNUO2agY5vgFKWqWIbhaMRbvat X-Received: by 2002:a05:6402:e06:b0:461:9764:15f0 with SMTP id h6-20020a0564020e0600b00461976415f0mr17881571edh.38.1670935319646; Tue, 13 Dec 2022 04:41:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670935319; cv=none; d=google.com; s=arc-20160816; b=F3mhzlAXOcudv39HGrzGLVXRZQFrarmXQGEcIDanwuVAGU4pAARTmwsbRx5whttgfl iyk/2p/50B5XnmAbwXXRFnxK8Q6wvvesPGGfySC7Wtas4s2CMBfY5T0LYsjXzYiMeh87 1giqKiJCX+hoam8pxRlkgtvUldM2+UVej49xu5SKXCk3Fa5qiyVWpl/6h26zxS4YV2w+ gznQjIHhEMMupAKVmHtpmoxMyas9p3csKpYqdIwdHFRNm3obBS9pglqa1XEuV9ABmhER J2eUANhxHN87PjqMSvykL9si17PqQQhAnnBV4cGGYeZlMTDnO+gu3WjNKz17QYVuviuk tU+Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=sgR0+bq2s364JYVS6+5cj1eSMdQVWstJIgBOrpafT58=; b=hu21vjZKSmudHnyppO/37nAyxoPlUlbJNdP5/D7DW4yC0aUk22pesB3UBc0PdOuvzb L+ONCbiTPgdK/fiAw1GJwk/3e4j05bgYOG+lX7iS40tvU7/GPX7aLBpKej2RRH4oVVCY CzMhZynrVhSoyu+plnsSJsQVqDMJBe57j+S+TMSYSylgLPsc8SCo0HVb5JNZFK4kvwuD WBbu2ny6QKbOVX5qLIKepct5Y/LXh+TubRocB7H52aCUDNAv0RdSlzTrXM4GVHsodxj+ IYRi0KiNvy1GKrGb2ZZoOl2ZnPhGGv6fO+se34FEYdYuHR9nXclMRAdsR7uf0PeB66mf UQ6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rFY4pyCH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o18-20020a509b12000000b0046cfe42c12csi8669111edi.629.2022.12.13.04.41.42; Tue, 13 Dec 2022 04:41:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rFY4pyCH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235411AbiLMMIf (ORCPT + 73 others); Tue, 13 Dec 2022 07:08:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234987AbiLMMIe (ORCPT ); Tue, 13 Dec 2022 07:08:34 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2714314D19; Tue, 13 Dec 2022 04:08:33 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CAF41B81184; Tue, 13 Dec 2022 12:08:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6CCAC433D2; Tue, 13 Dec 2022 12:08:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670933310; bh=1tNxadmfkO3wj3an2rLdn3PtureG9sBU9F7brxxdtrU=; h=From:To:Cc:Subject:Date:From; b=rFY4pyCHiVD7KgWofs2wsmFjqM4rL08Dplh3GbhT9v7DJqVBDyvjDzATa8bB6cib3 S3+6iIZgeD1l684fNA0IHiBdi1TiF2dNj+prfU+U9kdA9nwWyZksd38HhAfwi7pJd/ VP+paDps1N+Ojb/Q00qQPFRgGYNuNvbl5ilUwZtRZmc9T58WWMU3JEKoZYXADkMKKM 9QW7KHZe4k34GlxbCG/Do/pExBrOJGlck9Cpmk5EkAYO3U3FPWNtcRJZoMQk2ciJ55 iBKv69j6Ra/XaMe2t5KQiKS/Nx5p9iVksp2zkaPBlqaBJlRGHupKNUe8wqAjYb6Kmv dIiOkw7waa/Dw== From: "Jiri Slaby (SUSE)" To: Tejun Heo Cc: linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Martin Liska , Josef Bacik , Jens Axboe , cgroups@vger.kernel.org, linux-block@vger.kernel.org Subject: [PATCH v3] block/blk-iocost (gcc13): keep large values in a new enum Date: Tue, 13 Dec 2022 13:08:26 +0100 Message-Id: <20221213120826.17446-1-jirislaby@kernel.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Since gcc13, each member of an enum has the same type as the enum [1]. And that is inherited from its members. Provided: VTIME_PER_SEC_SHIFT = 37, VTIME_PER_SEC = 1LLU << VTIME_PER_SEC_SHIFT, ... AUTOP_CYCLE_NSEC = 10LLU * NSEC_PER_SEC, the named type is unsigned long. This generates warnings with gcc-13: block/blk-iocost.c: In function 'ioc_weight_prfill': block/blk-iocost.c:3037:37: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' block/blk-iocost.c: In function 'ioc_weight_show': block/blk-iocost.c:3047:34: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' So split the anonumois enum with large values to a separate enum, so that they don't affect other members. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36113 Cc: Martin Liska Cc: Tejun Heo Cc: Josef Bacik Cc: Jens Axboe Cc: cgroups@vger.kernel.org Cc: linux-block@vger.kernel.org Signed-off-by: Jiri Slaby (SUSE) --- Notes: [v3] move more to a new enum (effectively split the enums) [v2] move to a new enum block/blk-iocost.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/blk-iocost.c b/block/blk-iocost.c index d1bdc12deaa7..549ddc9e0c6f 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -232,7 +232,9 @@ enum { /* 1/64k is granular enough and can easily be handled w/ u32 */ WEIGHT_ONE = 1 << 16, +}; +enum { /* * As vtime is used to calculate the cost of each IO, it needs to * be fairly high precision. For example, it should be able to -- 2.39.0