[packages/kernel/LINUX_5_4] another gcc 13 backport prerequisite for previous one

atler atler at pld-linux.org
Wed May 3 17:42:50 CEST 2023


commit 1316e1b09ccf739e5a1c9253618934179c88716d
Author: Jan Palus <jpalus at fastmail.com>
Date:   Wed May 3 17:42:20 2023 +0200

    another gcc 13 backport prerequisite for previous one

 gcc13.patch | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)
---
diff --git a/gcc13.patch b/gcc13.patch
index 3dccb94b..928c9ea2 100644
--- a/gcc13.patch
+++ b/gcc13.patch
@@ -460,6 +460,63 @@ index b34d11e226366..320afd3cf8e82 100644
 -- 
 cgit 
 
+From ff1cc97b1f4c10db224f276d9615b22835b8c424 Mon Sep 17 00:00:00 2001
+From: "Jiri Slaby (SUSE)" <jirislaby at kernel.org>
+Date: Tue, 13 Dec 2022 13:08:26 +0100
+Subject: block/blk-iocost (gcc13): keep large values in a new enum
+
+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 anonymous 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 <mliska at suse.cz>
+Cc: Tejun Heo <tj at kernel.org>
+Cc: Josef Bacik <josef at toxicpanda.com>
+Cc: Jens Axboe <axboe at kernel.dk>
+Cc: cgroups at vger.kernel.org
+Cc: linux-block at vger.kernel.org
+Signed-off-by: Jiri Slaby (SUSE) <jirislaby at kernel.org>
+Link: https://lore.kernel.org/r/20221213120826.17446-1-jirislaby@kernel.org
+Signed-off-by: Jens Axboe <axboe at kernel.dk>
+---
+ block/blk-iocost.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+(limited to 'block/blk-iocost.c')
+
+diff --git a/block/blk-iocost.c b/block/blk-iocost.c
+index d1bdc12deaa70..549ddc9e0c6f4 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 */
+ 	HWEIGHT_WHOLE		= 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
+-- 
+cgit 
+
 From 5f2779dfa7b8cc7dfd4a1b6586d86e0d193266f3 Mon Sep 17 00:00:00 2001
 From: Arnd Bergmann <arnd at arndb.de>
 Date: Wed, 18 Jan 2023 09:07:01 +0100
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/kernel.git/commitdiff/1316e1b09ccf739e5a1c9253618934179c88716d



More information about the pld-cvs-commit mailing list