linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] block: constify some structures of partitions/core.c
@ 2023-04-19  7:50 Thomas Weißschuh
  2023-04-19  7:50 ` [PATCH 1/4] block: constify partition prober array Thomas Weißschuh
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Thomas Weißschuh @ 2023-04-19  7:50 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, linux-kernel, Thomas Weißschuh

A few structures containing function pointers that could and should be
const are not. Change that.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Thomas Weißschuh (4):
      block: constify partition prober array
      block: constify struct part_type part_type
      block: constify struct part_attr_group
      block: constify the whole_disk device_attribute

 block/partitions/core.c | 8 ++++----
 include/linux/blkdev.h  | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
---
base-commit: af67688dca57999fd848f051eeea1d375ba546b2
change-id: 20230419-const-partition-a06b9f76b2f3

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/4] block: constify partition prober array
  2023-04-19  7:50 [PATCH 0/4] block: constify some structures of partitions/core.c Thomas Weißschuh
@ 2023-04-19  7:50 ` Thomas Weißschuh
  2023-04-19  9:11   ` kernel test robot
                     ` (3 more replies)
  2023-04-19  7:50 ` [PATCH 2/4] block: constify struct part_type part_type Thomas Weißschuh
                   ` (2 subsequent siblings)
  3 siblings, 4 replies; 9+ messages in thread
From: Thomas Weißschuh @ 2023-04-19  7:50 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, linux-kernel, Thomas Weißschuh

The array is never modified so it can be const.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 block/partitions/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/partitions/core.c b/block/partitions/core.c
index 7b8ef6296abd..667f3dcebd59 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -12,7 +12,7 @@
 #include <linux/raid/detect.h>
 #include "check.h"
 
-static int (*check_part[])(struct parsed_partitions *) = {
+static const int (*check_part[])(struct parsed_partitions *) = {
 	/*
 	 * Probe partition formats with tables at disk address 0
 	 * that also have an ADFS boot block at 0xdc0.

-- 
2.40.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/4] block: constify struct part_type part_type
  2023-04-19  7:50 [PATCH 0/4] block: constify some structures of partitions/core.c Thomas Weißschuh
  2023-04-19  7:50 ` [PATCH 1/4] block: constify partition prober array Thomas Weißschuh
@ 2023-04-19  7:50 ` Thomas Weißschuh
  2023-04-19  7:50 ` [PATCH 3/4] block: constify struct part_attr_group Thomas Weißschuh
  2023-04-19  7:50 ` [PATCH 4/4] block: constify the whole_disk device_attribute Thomas Weißschuh
  3 siblings, 0 replies; 9+ messages in thread
From: Thomas Weißschuh @ 2023-04-19  7:50 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, linux-kernel, Thomas Weißschuh

The struct is never modified so it can be const.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 block/partitions/core.c | 2 +-
 include/linux/blkdev.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/partitions/core.c b/block/partitions/core.c
index 667f3dcebd59..812407ea38e9 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -264,7 +264,7 @@ static int part_uevent(const struct device *dev, struct kobj_uevent_env *env)
 	return 0;
 }
 
-struct device_type part_type = {
+const struct device_type part_type = {
 	.name		= "partition",
 	.groups		= part_attr_groups,
 	.release	= part_release,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 941304f17492..de783481ec71 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -41,7 +41,7 @@ struct blk_stat_callback;
 struct blk_crypto_profile;
 
 extern const struct device_type disk_type;
-extern struct device_type part_type;
+extern const struct device_type part_type;
 extern struct class block_class;
 
 /* Must be consistent with blk_mq_poll_stats_bkt() */

-- 
2.40.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/4] block: constify struct part_attr_group
  2023-04-19  7:50 [PATCH 0/4] block: constify some structures of partitions/core.c Thomas Weißschuh
  2023-04-19  7:50 ` [PATCH 1/4] block: constify partition prober array Thomas Weißschuh
  2023-04-19  7:50 ` [PATCH 2/4] block: constify struct part_type part_type Thomas Weißschuh
@ 2023-04-19  7:50 ` Thomas Weißschuh
  2023-04-19  7:50 ` [PATCH 4/4] block: constify the whole_disk device_attribute Thomas Weißschuh
  3 siblings, 0 replies; 9+ messages in thread
From: Thomas Weißschuh @ 2023-04-19  7:50 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, linux-kernel, Thomas Weißschuh

The struct is never modified so it can be const.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 block/partitions/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/partitions/core.c b/block/partitions/core.c
index 812407ea38e9..032e415618cb 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -236,7 +236,7 @@ static struct attribute *part_attrs[] = {
 	NULL
 };
 
-static struct attribute_group part_attr_group = {
+static const struct attribute_group part_attr_group = {
 	.attrs = part_attrs,
 };
 

-- 
2.40.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/4] block: constify the whole_disk device_attribute
  2023-04-19  7:50 [PATCH 0/4] block: constify some structures of partitions/core.c Thomas Weißschuh
                   ` (2 preceding siblings ...)
  2023-04-19  7:50 ` [PATCH 3/4] block: constify struct part_attr_group Thomas Weißschuh
@ 2023-04-19  7:50 ` Thomas Weißschuh
  3 siblings, 0 replies; 9+ messages in thread
From: Thomas Weißschuh @ 2023-04-19  7:50 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, linux-kernel, Thomas Weißschuh

The struct is never modified so it can be const.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 block/partitions/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/partitions/core.c b/block/partitions/core.c
index 032e415618cb..8efadc694e41 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -296,7 +296,7 @@ static ssize_t whole_disk_show(struct device *dev,
 {
 	return 0;
 }
-static DEVICE_ATTR(whole_disk, 0444, whole_disk_show, NULL);
+static const DEVICE_ATTR(whole_disk, 0444, whole_disk_show, NULL);
 
 /*
  * Must be called either with open_mutex held, before a disk can be opened or

-- 
2.40.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/4] block: constify partition prober array
  2023-04-19  7:50 ` [PATCH 1/4] block: constify partition prober array Thomas Weißschuh
@ 2023-04-19  9:11   ` kernel test robot
  2023-04-19 13:29   ` kernel test robot
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2023-04-19  9:11 UTC (permalink / raw)
  To: Thomas Weißschuh, Jens Axboe
  Cc: oe-kbuild-all, linux-block, linux-kernel, Thomas Weißschuh

Hi Thomas,

kernel test robot noticed the following build warnings:

[auto build test WARNING on af67688dca57999fd848f051eeea1d375ba546b2]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Wei-schuh/block-constify-partition-prober-array/20230419-155356
base:   af67688dca57999fd848f051eeea1d375ba546b2
patch link:    https://lore.kernel.org/r/20230419-const-partition-v1-1-2d66f2d83873%40weissschuh.net
patch subject: [PATCH 1/4] block: constify partition prober array
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20230419/202304191640.SkNk7kVN-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/9bc1f4308c10322c327c9e86ede6bb9e862440aa
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Thomas-Wei-schuh/block-constify-partition-prober-array/20230419-155356
        git checkout 9bc1f4308c10322c327c9e86ede6bb9e862440aa
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash block/partitions/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304191640.SkNk7kVN-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> block/partitions/core.c:15:8: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
      15 | static const int (*check_part[])(struct parsed_partitions *) = {
         |        ^~~~~


vim +15 block/partitions/core.c

    14	
  > 15	static const int (*check_part[])(struct parsed_partitions *) = {
    16		/*
    17		 * Probe partition formats with tables at disk address 0
    18		 * that also have an ADFS boot block at 0xdc0.
    19		 */
    20	#ifdef CONFIG_ACORN_PARTITION_ICS
    21		adfspart_check_ICS,
    22	#endif
    23	#ifdef CONFIG_ACORN_PARTITION_POWERTEC
    24		adfspart_check_POWERTEC,
    25	#endif
    26	#ifdef CONFIG_ACORN_PARTITION_EESOX
    27		adfspart_check_EESOX,
    28	#endif
    29	
    30		/*
    31		 * Now move on to formats that only have partition info at
    32		 * disk address 0xdc0.  Since these may also have stale
    33		 * PC/BIOS partition tables, they need to come before
    34		 * the msdos entry.
    35		 */
    36	#ifdef CONFIG_ACORN_PARTITION_CUMANA
    37		adfspart_check_CUMANA,
    38	#endif
    39	#ifdef CONFIG_ACORN_PARTITION_ADFS
    40		adfspart_check_ADFS,
    41	#endif
    42	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/4] block: constify partition prober array
  2023-04-19  7:50 ` [PATCH 1/4] block: constify partition prober array Thomas Weißschuh
  2023-04-19  9:11   ` kernel test robot
@ 2023-04-19 13:29   ` kernel test robot
  2023-04-19 16:32   ` kernel test robot
  2023-04-19 20:18   ` kernel test robot
  3 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2023-04-19 13:29 UTC (permalink / raw)
  To: Thomas Weißschuh, Jens Axboe
  Cc: llvm, oe-kbuild-all, linux-block, linux-kernel, Thomas Weißschuh

Hi Thomas,

kernel test robot noticed the following build warnings:

[auto build test WARNING on af67688dca57999fd848f051eeea1d375ba546b2]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Wei-schuh/block-constify-partition-prober-array/20230419-155356
base:   af67688dca57999fd848f051eeea1d375ba546b2
patch link:    https://lore.kernel.org/r/20230419-const-partition-v1-1-2d66f2d83873%40weissschuh.net
patch subject: [PATCH 1/4] block: constify partition prober array
config: arm64-randconfig-r001-20230416 (https://download.01.org/0day-ci/archive/20230419/202304192132.a6MR0cFR-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 437b7602e4a998220871de78afcb020b9c14a661)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://github.com/intel-lab-lkp/linux/commit/9bc1f4308c10322c327c9e86ede6bb9e862440aa
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Thomas-Wei-schuh/block-constify-partition-prober-array/20230419-155356
        git checkout 9bc1f4308c10322c327c9e86ede6bb9e862440aa
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash block/partitions/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304192132.a6MR0cFR-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> block/partitions/core.c:15:8: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
   static const int (*check_part[])(struct parsed_partitions *) = {
          ^~~~~~
   block/partitions/core.c:47:2: error: incompatible function pointer types initializing 'const int (*)(struct parsed_partitions *)' with an expression of type 'int (struct parsed_partitions *)' [-Wincompatible-function-pointer-types]
           efi_partition,          /* this must come before msdos */
           ^~~~~~~~~~~~~
   block/partitions/core.c:50:2: error: incompatible function pointer types initializing 'const int (*)(struct parsed_partitions *)' with an expression of type 'int (struct parsed_partitions *)' [-Wincompatible-function-pointer-types]
           sgi_partition,
           ^~~~~~~~~~~~~
   block/partitions/core.c:56:2: error: incompatible function pointer types initializing 'const int (*)(struct parsed_partitions *)' with an expression of type 'int (struct parsed_partitions *)' [-Wincompatible-function-pointer-types]
           msdos_partition,
           ^~~~~~~~~~~~~~~
   block/partitions/core.c:59:2: error: incompatible function pointer types initializing 'const int (*)(struct parsed_partitions *)' with an expression of type 'int (struct parsed_partitions *)' [-Wincompatible-function-pointer-types]
           osf_partition,
           ^~~~~~~~~~~~~
   block/partitions/core.c:62:2: error: incompatible function pointer types initializing 'const int (*)(struct parsed_partitions *)' with an expression of type 'int (struct parsed_partitions *)' [-Wincompatible-function-pointer-types]
           sun_partition,
           ^~~~~~~~~~~~~
   block/partitions/core.c:65:2: error: incompatible function pointer types initializing 'const int (*)(struct parsed_partitions *)' with an expression of type 'int (struct parsed_partitions *)' [-Wincompatible-function-pointer-types]
           amiga_partition,
           ^~~~~~~~~~~~~~~
   block/partitions/core.c:71:2: error: incompatible function pointer types initializing 'const int (*)(struct parsed_partitions *)' with an expression of type 'int (struct parsed_partitions *)' [-Wincompatible-function-pointer-types]
           mac_partition,
           ^~~~~~~~~~~~~
   1 warning and 7 errors generated.


vim +/const +15 block/partitions/core.c

    14	
  > 15	static const int (*check_part[])(struct parsed_partitions *) = {
    16		/*
    17		 * Probe partition formats with tables at disk address 0
    18		 * that also have an ADFS boot block at 0xdc0.
    19		 */
    20	#ifdef CONFIG_ACORN_PARTITION_ICS
    21		adfspart_check_ICS,
    22	#endif
    23	#ifdef CONFIG_ACORN_PARTITION_POWERTEC
    24		adfspart_check_POWERTEC,
    25	#endif
    26	#ifdef CONFIG_ACORN_PARTITION_EESOX
    27		adfspart_check_EESOX,
    28	#endif
    29	
    30		/*
    31		 * Now move on to formats that only have partition info at
    32		 * disk address 0xdc0.  Since these may also have stale
    33		 * PC/BIOS partition tables, they need to come before
    34		 * the msdos entry.
    35		 */
    36	#ifdef CONFIG_ACORN_PARTITION_CUMANA
    37		adfspart_check_CUMANA,
    38	#endif
    39	#ifdef CONFIG_ACORN_PARTITION_ADFS
    40		adfspart_check_ADFS,
    41	#endif
    42	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/4] block: constify partition prober array
  2023-04-19  7:50 ` [PATCH 1/4] block: constify partition prober array Thomas Weißschuh
  2023-04-19  9:11   ` kernel test robot
  2023-04-19 13:29   ` kernel test robot
@ 2023-04-19 16:32   ` kernel test robot
  2023-04-19 20:18   ` kernel test robot
  3 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2023-04-19 16:32 UTC (permalink / raw)
  To: Thomas Weißschuh, Jens Axboe
  Cc: llvm, oe-kbuild-all, linux-block, linux-kernel, Thomas Weißschuh

Hi Thomas,

kernel test robot noticed the following build errors:

[auto build test ERROR on af67688dca57999fd848f051eeea1d375ba546b2]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Wei-schuh/block-constify-partition-prober-array/20230419-155356
base:   af67688dca57999fd848f051eeea1d375ba546b2
patch link:    https://lore.kernel.org/r/20230419-const-partition-v1-1-2d66f2d83873%40weissschuh.net
patch subject: [PATCH 1/4] block: constify partition prober array
config: arm64-randconfig-r001-20230416 (https://download.01.org/0day-ci/archive/20230420/202304200014.y79VnmJo-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 437b7602e4a998220871de78afcb020b9c14a661)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://github.com/intel-lab-lkp/linux/commit/9bc1f4308c10322c327c9e86ede6bb9e862440aa
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Thomas-Wei-schuh/block-constify-partition-prober-array/20230419-155356
        git checkout 9bc1f4308c10322c327c9e86ede6bb9e862440aa
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash block/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304200014.y79VnmJo-lkp@intel.com/

All errors (new ones prefixed by >>):

   block/partitions/core.c:15:8: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
   static const int (*check_part[])(struct parsed_partitions *) = {
          ^~~~~~
>> block/partitions/core.c:47:2: error: incompatible function pointer types initializing 'const int (*)(struct parsed_partitions *)' with an expression of type 'int (struct parsed_partitions *)' [-Wincompatible-function-pointer-types]
           efi_partition,          /* this must come before msdos */
           ^~~~~~~~~~~~~
   block/partitions/core.c:50:2: error: incompatible function pointer types initializing 'const int (*)(struct parsed_partitions *)' with an expression of type 'int (struct parsed_partitions *)' [-Wincompatible-function-pointer-types]
           sgi_partition,
           ^~~~~~~~~~~~~
   block/partitions/core.c:56:2: error: incompatible function pointer types initializing 'const int (*)(struct parsed_partitions *)' with an expression of type 'int (struct parsed_partitions *)' [-Wincompatible-function-pointer-types]
           msdos_partition,
           ^~~~~~~~~~~~~~~
   block/partitions/core.c:59:2: error: incompatible function pointer types initializing 'const int (*)(struct parsed_partitions *)' with an expression of type 'int (struct parsed_partitions *)' [-Wincompatible-function-pointer-types]
           osf_partition,
           ^~~~~~~~~~~~~
   block/partitions/core.c:62:2: error: incompatible function pointer types initializing 'const int (*)(struct parsed_partitions *)' with an expression of type 'int (struct parsed_partitions *)' [-Wincompatible-function-pointer-types]
           sun_partition,
           ^~~~~~~~~~~~~
   block/partitions/core.c:65:2: error: incompatible function pointer types initializing 'const int (*)(struct parsed_partitions *)' with an expression of type 'int (struct parsed_partitions *)' [-Wincompatible-function-pointer-types]
           amiga_partition,
           ^~~~~~~~~~~~~~~
   block/partitions/core.c:71:2: error: incompatible function pointer types initializing 'const int (*)(struct parsed_partitions *)' with an expression of type 'int (struct parsed_partitions *)' [-Wincompatible-function-pointer-types]
           mac_partition,
           ^~~~~~~~~~~~~
   1 warning and 7 errors generated.


vim +47 block/partitions/core.c

387048bf67eeff Christoph Hellwig 2020-03-24  42  
387048bf67eeff Christoph Hellwig 2020-03-24  43  #ifdef CONFIG_CMDLINE_PARTITION
387048bf67eeff Christoph Hellwig 2020-03-24  44  	cmdline_partition,
387048bf67eeff Christoph Hellwig 2020-03-24  45  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  46  #ifdef CONFIG_EFI_PARTITION
387048bf67eeff Christoph Hellwig 2020-03-24 @47  	efi_partition,		/* this must come before msdos */
387048bf67eeff Christoph Hellwig 2020-03-24  48  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  49  #ifdef CONFIG_SGI_PARTITION
387048bf67eeff Christoph Hellwig 2020-03-24  50  	sgi_partition,
387048bf67eeff Christoph Hellwig 2020-03-24  51  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  52  #ifdef CONFIG_LDM_PARTITION
387048bf67eeff Christoph Hellwig 2020-03-24  53  	ldm_partition,		/* this must come before msdos */
387048bf67eeff Christoph Hellwig 2020-03-24  54  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  55  #ifdef CONFIG_MSDOS_PARTITION
387048bf67eeff Christoph Hellwig 2020-03-24  56  	msdos_partition,
387048bf67eeff Christoph Hellwig 2020-03-24  57  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  58  #ifdef CONFIG_OSF_PARTITION
387048bf67eeff Christoph Hellwig 2020-03-24  59  	osf_partition,
387048bf67eeff Christoph Hellwig 2020-03-24  60  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  61  #ifdef CONFIG_SUN_PARTITION
387048bf67eeff Christoph Hellwig 2020-03-24  62  	sun_partition,
387048bf67eeff Christoph Hellwig 2020-03-24  63  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  64  #ifdef CONFIG_AMIGA_PARTITION
387048bf67eeff Christoph Hellwig 2020-03-24  65  	amiga_partition,
387048bf67eeff Christoph Hellwig 2020-03-24  66  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  67  #ifdef CONFIG_ATARI_PARTITION
387048bf67eeff Christoph Hellwig 2020-03-24  68  	atari_partition,
387048bf67eeff Christoph Hellwig 2020-03-24  69  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  70  #ifdef CONFIG_MAC_PARTITION
387048bf67eeff Christoph Hellwig 2020-03-24  71  	mac_partition,
387048bf67eeff Christoph Hellwig 2020-03-24  72  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  73  #ifdef CONFIG_ULTRIX_PARTITION
387048bf67eeff Christoph Hellwig 2020-03-24  74  	ultrix_partition,
387048bf67eeff Christoph Hellwig 2020-03-24  75  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  76  #ifdef CONFIG_IBM_PARTITION
387048bf67eeff Christoph Hellwig 2020-03-24  77  	ibm_partition,
387048bf67eeff Christoph Hellwig 2020-03-24  78  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  79  #ifdef CONFIG_KARMA_PARTITION
387048bf67eeff Christoph Hellwig 2020-03-24  80  	karma_partition,
387048bf67eeff Christoph Hellwig 2020-03-24  81  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  82  #ifdef CONFIG_SYSV68_PARTITION
387048bf67eeff Christoph Hellwig 2020-03-24  83  	sysv68_partition,
387048bf67eeff Christoph Hellwig 2020-03-24  84  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  85  	NULL
387048bf67eeff Christoph Hellwig 2020-03-24  86  };
387048bf67eeff Christoph Hellwig 2020-03-24  87  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/4] block: constify partition prober array
  2023-04-19  7:50 ` [PATCH 1/4] block: constify partition prober array Thomas Weißschuh
                     ` (2 preceding siblings ...)
  2023-04-19 16:32   ` kernel test robot
@ 2023-04-19 20:18   ` kernel test robot
  3 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2023-04-19 20:18 UTC (permalink / raw)
  To: Thomas Weißschuh, Jens Axboe
  Cc: oe-kbuild-all, linux-block, linux-kernel, Thomas Weißschuh

Hi Thomas,

kernel test robot noticed the following build warnings:

[auto build test WARNING on af67688dca57999fd848f051eeea1d375ba546b2]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Wei-schuh/block-constify-partition-prober-array/20230419-155356
base:   af67688dca57999fd848f051eeea1d375ba546b2
patch link:    https://lore.kernel.org/r/20230419-const-partition-v1-1-2d66f2d83873%40weissschuh.net
patch subject: [PATCH 1/4] block: constify partition prober array
config: x86_64-randconfig-s023 (https://download.01.org/0day-ci/archive/20230420/202304200454.r3d73iaw-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://github.com/intel-lab-lkp/linux/commit/9bc1f4308c10322c327c9e86ede6bb9e862440aa
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Thomas-Wei-schuh/block-constify-partition-prober-array/20230419-155356
        git checkout 9bc1f4308c10322c327c9e86ede6bb9e862440aa
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 olddefconfig
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304200454.r3d73iaw-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> block/partitions/core.c:24:9: sparse: sparse: incorrect type in initializer (different modifiers) @@     expected int ( const * )( ... ) @@     got int ( * )( ... ) @@
   block/partitions/core.c:24:9: sparse:     expected int ( const * )( ... )
   block/partitions/core.c:24:9: sparse:     got int ( * )( ... )
   block/partitions/core.c:47:9: sparse: sparse: incorrect type in initializer (different modifiers) @@     expected int ( const * )( ... ) @@     got int ( * )( ... ) @@
   block/partitions/core.c:47:9: sparse:     expected int ( const * )( ... )
   block/partitions/core.c:47:9: sparse:     got int ( * )( ... )
   block/partitions/core.c:53:9: sparse: sparse: incorrect type in initializer (different modifiers) @@     expected int ( const * )( ... ) @@     got int ( * )( ... ) @@
   block/partitions/core.c:53:9: sparse:     expected int ( const * )( ... )
   block/partitions/core.c:53:9: sparse:     got int ( * )( ... )
   block/partitions/core.c:56:9: sparse: sparse: incorrect type in initializer (different modifiers) @@     expected int ( const * )( ... ) @@     got int ( * )( ... ) @@
   block/partitions/core.c:56:9: sparse:     expected int ( const * )( ... )
   block/partitions/core.c:56:9: sparse:     got int ( * )( ... )
   block/partitions/core.c:68:9: sparse: sparse: incorrect type in initializer (different modifiers) @@     expected int ( const * )( ... ) @@     got int ( * )( ... ) @@
   block/partitions/core.c:68:9: sparse:     expected int ( const * )( ... )
   block/partitions/core.c:68:9: sparse:     got int ( * )( ... )
   block/partitions/core.c:71:9: sparse: sparse: incorrect type in initializer (different modifiers) @@     expected int ( const * )( ... ) @@     got int ( * )( ... ) @@
   block/partitions/core.c:71:9: sparse:     expected int ( const * )( ... )
   block/partitions/core.c:71:9: sparse:     got int ( * )( ... )

vim +24 block/partitions/core.c

387048bf67eeff Christoph Hellwig 2020-03-24  14  
9bc1f4308c1032 Thomas Weißschuh  2023-04-19  15  static const int (*check_part[])(struct parsed_partitions *) = {
387048bf67eeff Christoph Hellwig 2020-03-24  16  	/*
387048bf67eeff Christoph Hellwig 2020-03-24  17  	 * Probe partition formats with tables at disk address 0
387048bf67eeff Christoph Hellwig 2020-03-24  18  	 * that also have an ADFS boot block at 0xdc0.
387048bf67eeff Christoph Hellwig 2020-03-24  19  	 */
387048bf67eeff Christoph Hellwig 2020-03-24  20  #ifdef CONFIG_ACORN_PARTITION_ICS
387048bf67eeff Christoph Hellwig 2020-03-24  21  	adfspart_check_ICS,
387048bf67eeff Christoph Hellwig 2020-03-24  22  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  23  #ifdef CONFIG_ACORN_PARTITION_POWERTEC
387048bf67eeff Christoph Hellwig 2020-03-24 @24  	adfspart_check_POWERTEC,
387048bf67eeff Christoph Hellwig 2020-03-24  25  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  26  #ifdef CONFIG_ACORN_PARTITION_EESOX
387048bf67eeff Christoph Hellwig 2020-03-24  27  	adfspart_check_EESOX,
387048bf67eeff Christoph Hellwig 2020-03-24  28  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  29  
387048bf67eeff Christoph Hellwig 2020-03-24  30  	/*
387048bf67eeff Christoph Hellwig 2020-03-24  31  	 * Now move on to formats that only have partition info at
387048bf67eeff Christoph Hellwig 2020-03-24  32  	 * disk address 0xdc0.  Since these may also have stale
387048bf67eeff Christoph Hellwig 2020-03-24  33  	 * PC/BIOS partition tables, they need to come before
387048bf67eeff Christoph Hellwig 2020-03-24  34  	 * the msdos entry.
387048bf67eeff Christoph Hellwig 2020-03-24  35  	 */
387048bf67eeff Christoph Hellwig 2020-03-24  36  #ifdef CONFIG_ACORN_PARTITION_CUMANA
387048bf67eeff Christoph Hellwig 2020-03-24  37  	adfspart_check_CUMANA,
387048bf67eeff Christoph Hellwig 2020-03-24  38  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  39  #ifdef CONFIG_ACORN_PARTITION_ADFS
387048bf67eeff Christoph Hellwig 2020-03-24  40  	adfspart_check_ADFS,
387048bf67eeff Christoph Hellwig 2020-03-24  41  #endif
387048bf67eeff Christoph Hellwig 2020-03-24  42  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-04-19 20:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-19  7:50 [PATCH 0/4] block: constify some structures of partitions/core.c Thomas Weißschuh
2023-04-19  7:50 ` [PATCH 1/4] block: constify partition prober array Thomas Weißschuh
2023-04-19  9:11   ` kernel test robot
2023-04-19 13:29   ` kernel test robot
2023-04-19 16:32   ` kernel test robot
2023-04-19 20:18   ` kernel test robot
2023-04-19  7:50 ` [PATCH 2/4] block: constify struct part_type part_type Thomas Weißschuh
2023-04-19  7:50 ` [PATCH 3/4] block: constify struct part_attr_group Thomas Weißschuh
2023-04-19  7:50 ` [PATCH 4/4] block: constify the whole_disk device_attribute Thomas Weißschuh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).