All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] rtc: ab-eoz9: constify pointers to hwmon_channel_info
@ 2023-04-07 15:03 Krzysztof Kozlowski
  2023-04-07 15:03 ` [PATCH 2/4] rtc: ds3232: " Krzysztof Kozlowski
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-04-07 15:03 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, linux-rtc, linux-kernel
  Cc: Krzysztof Kozlowski, Jean Delvare, Guenter Roeck, linux-hwmon

Statically allocated array of pointed to hwmon_channel_info can be made
const for safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

This depends on hwmon core patch:
https://lore.kernel.org/all/20230406203103.3011503-2-krzysztof.kozlowski@linaro.org/

Therefore I propose this should also go via hwmon tree.

Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
---
 drivers/rtc/rtc-ab-eoz9.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-ab-eoz9.c b/drivers/rtc/rtc-ab-eoz9.c
index 34611f6dedcb..143650cb7822 100644
--- a/drivers/rtc/rtc-ab-eoz9.c
+++ b/drivers/rtc/rtc-ab-eoz9.c
@@ -455,7 +455,7 @@ static const struct hwmon_channel_info abeoz9_temp = {
 	.config = abeoz9_temp_config,
 };
 
-static const struct hwmon_channel_info *abeoz9_info[] = {
+static const struct hwmon_channel_info * const abeoz9_info[] = {
 	&abeoz9_chip,
 	&abeoz9_temp,
 	NULL
-- 
2.34.1


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

* [PATCH 2/4] rtc: ds3232: constify pointers to hwmon_channel_info
  2023-04-07 15:03 [PATCH 1/4] rtc: ab-eoz9: constify pointers to hwmon_channel_info Krzysztof Kozlowski
@ 2023-04-07 15:03 ` Krzysztof Kozlowski
  2023-04-07 18:54   ` kernel test robot
  2023-04-07 15:03 ` [PATCH 3/4] rtc: isl12022: " Krzysztof Kozlowski
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-04-07 15:03 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, linux-rtc, linux-kernel
  Cc: Krzysztof Kozlowski, Jean Delvare, Guenter Roeck, linux-hwmon

Statically allocated array of pointed to hwmon_channel_info can be made
const for safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

This depends on hwmon core patch:
https://lore.kernel.org/all/20230406203103.3011503-2-krzysztof.kozlowski@linaro.org/

Therefore I propose this should also go via hwmon tree.

Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
---
 drivers/rtc/rtc-ds3232.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-ds3232.c b/drivers/rtc/rtc-ds3232.c
index dd31a60c1fc6..ce46016c9fd8 100644
--- a/drivers/rtc/rtc-ds3232.c
+++ b/drivers/rtc/rtc-ds3232.c
@@ -359,7 +359,7 @@ static const struct hwmon_channel_info ds3232_hwmon_temp = {
 	.config = ds3232_hwmon_temp_config,
 };
 
-static const struct hwmon_channel_info *ds3232_hwmon_info[] = {
+static const struct hwmon_channel_info * const ds3232_hwmon_info[] = {
 	&ds3232_hwmon_chip,
 	&ds3232_hwmon_temp,
 	NULL
-- 
2.34.1


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

* [PATCH 3/4] rtc: isl12022: constify pointers to hwmon_channel_info
  2023-04-07 15:03 [PATCH 1/4] rtc: ab-eoz9: constify pointers to hwmon_channel_info Krzysztof Kozlowski
  2023-04-07 15:03 ` [PATCH 2/4] rtc: ds3232: " Krzysztof Kozlowski
@ 2023-04-07 15:03 ` Krzysztof Kozlowski
  2023-04-07 20:06   ` kernel test robot
  2023-04-07 15:03 ` [PATCH 4/4] rtc: rv3032: " Krzysztof Kozlowski
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-04-07 15:03 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, linux-rtc, linux-kernel
  Cc: Krzysztof Kozlowski, Jean Delvare, Guenter Roeck, linux-hwmon

Statically allocated array of pointed to hwmon_channel_info can be made
const for safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

This depends on hwmon core patch:
https://lore.kernel.org/all/20230406203103.3011503-2-krzysztof.kozlowski@linaro.org/

Therefore I propose this should also go via hwmon tree.

Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
---
 drivers/rtc/rtc-isl12022.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-isl12022.c b/drivers/rtc/rtc-isl12022.c
index e68a79b5e00e..eef66453841f 100644
--- a/drivers/rtc/rtc-isl12022.c
+++ b/drivers/rtc/rtc-isl12022.c
@@ -89,7 +89,7 @@ static int isl12022_hwmon_read(struct device *dev,
 	return -EOPNOTSUPP;
 }
 
-static const struct hwmon_channel_info *isl12022_hwmon_info[] = {
+static const struct hwmon_channel_info * const isl12022_hwmon_info[] = {
 	HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
 	NULL
 };
-- 
2.34.1


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

* [PATCH 4/4] rtc: rv3032: constify pointers to hwmon_channel_info
  2023-04-07 15:03 [PATCH 1/4] rtc: ab-eoz9: constify pointers to hwmon_channel_info Krzysztof Kozlowski
  2023-04-07 15:03 ` [PATCH 2/4] rtc: ds3232: " Krzysztof Kozlowski
  2023-04-07 15:03 ` [PATCH 3/4] rtc: isl12022: " Krzysztof Kozlowski
@ 2023-04-07 15:03 ` Krzysztof Kozlowski
  2023-04-07 17:50 ` [PATCH 1/4] rtc: ab-eoz9: " kernel test robot
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-04-07 15:03 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, linux-rtc, linux-kernel
  Cc: Krzysztof Kozlowski, Jean Delvare, Guenter Roeck, linux-hwmon

Statically allocated array of pointed to hwmon_channel_info can be made
const for safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

This depends on hwmon core patch:
https://lore.kernel.org/all/20230406203103.3011503-2-krzysztof.kozlowski@linaro.org/

Therefore I propose this should also go via hwmon tree.

Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
---
 drivers/rtc/rtc-rv3032.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-rv3032.c b/drivers/rtc/rtc-rv3032.c
index 1ff4f2e6fa77..7b36e7f125f7 100644
--- a/drivers/rtc/rtc-rv3032.c
+++ b/drivers/rtc/rtc-rv3032.c
@@ -842,7 +842,7 @@ static int rv3032_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
 	return err;
 }
 
-static const struct hwmon_channel_info *rv3032_hwmon_info[] = {
+static const struct hwmon_channel_info * const rv3032_hwmon_info[] = {
 	HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ),
 	HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST),
 	NULL
-- 
2.34.1


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

* Re: [PATCH 1/4] rtc: ab-eoz9: constify pointers to hwmon_channel_info
  2023-04-07 15:03 [PATCH 1/4] rtc: ab-eoz9: constify pointers to hwmon_channel_info Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2023-04-07 15:03 ` [PATCH 4/4] rtc: rv3032: " Krzysztof Kozlowski
@ 2023-04-07 17:50 ` kernel test robot
  2023-04-07 18:22 ` kernel test robot
  2023-04-27 22:42 ` Alexandre Belloni
  5 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2023-04-07 17:50 UTC (permalink / raw)
  To: Krzysztof Kozlowski; +Cc: llvm, oe-kbuild-all

Hi Krzysztof,

kernel test robot noticed the following build errors:

[auto build test ERROR on abelloni/rtc-next]
[also build test ERROR on linus/master v6.3-rc5 next-20230406]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Krzysztof-Kozlowski/rtc-ds3232-constify-pointers-to-hwmon_channel_info/20230407-231346
base:   https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git rtc-next
patch link:    https://lore.kernel.org/r/20230407150306.80141-1-krzysztof.kozlowski%40linaro.org
patch subject: [PATCH 1/4] rtc: ab-eoz9: constify pointers to hwmon_channel_info
config: hexagon-buildonly-randconfig-r001-20230403 (https://download.01.org/0day-ci/archive/20230408/202304080110.v5LLFwT4-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 2c57868e2e877f73c339796c3374ae660bb77f0d)
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/2b39e4ff9f9bbc04c31fa2819e09754ca5001669
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Krzysztof-Kozlowski/rtc-ds3232-constify-pointers-to-hwmon_channel_info/20230407-231346
        git checkout 2b39e4ff9f9bbc04c31fa2819e09754ca5001669
        # 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=hexagon olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/rtc/

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/202304080110.v5LLFwT4-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/rtc/rtc-ab-eoz9.c:9:
   In file included from include/linux/rtc.h:17:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __raw_readb(PCI_IOBASE + addr);
                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                                                     ^
   In file included from drivers/rtc/rtc-ab-eoz9.c:9:
   In file included from include/linux/rtc.h:17:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                                                     ^
   In file included from drivers/rtc/rtc-ab-eoz9.c:9:
   In file included from include/linux/rtc.h:17:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
>> drivers/rtc/rtc-ab-eoz9.c:471:10: error: initializing 'const struct hwmon_channel_info **' with an expression of type 'const struct hwmon_channel_info *const[3]' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
           .info = abeoz9_info,
                   ^~~~~~~~~~~
   6 warnings and 1 error generated.


vim +471 drivers/rtc/rtc-ab-eoz9.c

67075b63cce26c Artem Panfilov 2019-02-17  468  
67075b63cce26c Artem Panfilov 2019-02-17  469  static const struct hwmon_chip_info abeoz9_chip_info = {
67075b63cce26c Artem Panfilov 2019-02-17  470  	.ops = &abeoz9_hwmon_ops,
67075b63cce26c Artem Panfilov 2019-02-17 @471  	.info = abeoz9_info,
67075b63cce26c Artem Panfilov 2019-02-17  472  };
67075b63cce26c Artem Panfilov 2019-02-17  473  

-- 
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] rtc: ab-eoz9: constify pointers to hwmon_channel_info
  2023-04-07 15:03 [PATCH 1/4] rtc: ab-eoz9: constify pointers to hwmon_channel_info Krzysztof Kozlowski
                   ` (3 preceding siblings ...)
  2023-04-07 17:50 ` [PATCH 1/4] rtc: ab-eoz9: " kernel test robot
@ 2023-04-07 18:22 ` kernel test robot
  2023-04-27 22:42 ` Alexandre Belloni
  5 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2023-04-07 18:22 UTC (permalink / raw)
  To: Krzysztof Kozlowski; +Cc: oe-kbuild-all

Hi Krzysztof,

kernel test robot noticed the following build warnings:

[auto build test WARNING on abelloni/rtc-next]
[also build test WARNING on linus/master v6.3-rc5 next-20230406]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Krzysztof-Kozlowski/rtc-ds3232-constify-pointers-to-hwmon_channel_info/20230407-231346
base:   https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git rtc-next
patch link:    https://lore.kernel.org/r/20230407150306.80141-1-krzysztof.kozlowski%40linaro.org
patch subject: [PATCH 1/4] rtc: ab-eoz9: constify pointers to hwmon_channel_info
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20230408/202304080217.jll816za-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/2b39e4ff9f9bbc04c31fa2819e09754ca5001669
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Krzysztof-Kozlowski/rtc-ds3232-constify-pointers-to-hwmon_channel_info/20230407-231346
        git checkout 2b39e4ff9f9bbc04c31fa2819e09754ca5001669
        # 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 drivers/rtc/

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/202304080217.jll816za-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/rtc/rtc-ab-eoz9.c:471:17: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     471 |         .info = abeoz9_info,
         |                 ^~~~~~~~~~~


vim +/const +471 drivers/rtc/rtc-ab-eoz9.c

67075b63cce26c Artem Panfilov 2019-02-17  468  
67075b63cce26c Artem Panfilov 2019-02-17  469  static const struct hwmon_chip_info abeoz9_chip_info = {
67075b63cce26c Artem Panfilov 2019-02-17  470  	.ops = &abeoz9_hwmon_ops,
67075b63cce26c Artem Panfilov 2019-02-17 @471  	.info = abeoz9_info,
67075b63cce26c Artem Panfilov 2019-02-17  472  };
67075b63cce26c Artem Panfilov 2019-02-17  473  

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

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

* Re: [PATCH 2/4] rtc: ds3232: constify pointers to hwmon_channel_info
  2023-04-07 15:03 ` [PATCH 2/4] rtc: ds3232: " Krzysztof Kozlowski
@ 2023-04-07 18:54   ` kernel test robot
  0 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2023-04-07 18:54 UTC (permalink / raw)
  To: Krzysztof Kozlowski; +Cc: llvm, oe-kbuild-all

Hi Krzysztof,

kernel test robot noticed the following build errors:

[auto build test ERROR on abelloni/rtc-next]
[also build test ERROR on linus/master v6.3-rc5 next-20230406]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Krzysztof-Kozlowski/rtc-ds3232-constify-pointers-to-hwmon_channel_info/20230407-231346
base:   https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git rtc-next
patch link:    https://lore.kernel.org/r/20230407150306.80141-2-krzysztof.kozlowski%40linaro.org
patch subject: [PATCH 2/4] rtc: ds3232: constify pointers to hwmon_channel_info
config: hexagon-buildonly-randconfig-r001-20230403 (https://download.01.org/0day-ci/archive/20230408/202304080221.QFDtWIL3-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 2c57868e2e877f73c339796c3374ae660bb77f0d)
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/7c7bc663edb897df5d42a8e592d15312959d2fae
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Krzysztof-Kozlowski/rtc-ds3232-constify-pointers-to-hwmon_channel_info/20230407-231346
        git checkout 7c7bc663edb897df5d42a8e592d15312959d2fae
        # 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=hexagon olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/rtc/

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/202304080221.QFDtWIL3-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/rtc/rtc-ds3232.c:14:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __raw_readb(PCI_IOBASE + addr);
                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                                                     ^
   In file included from drivers/rtc/rtc-ds3232.c:14:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                                                     ^
   In file included from drivers/rtc/rtc-ds3232.c:14:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
>> drivers/rtc/rtc-ds3232.c:375:10: error: initializing 'const struct hwmon_channel_info **' with an expression of type 'const struct hwmon_channel_info *const[3]' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
           .info = ds3232_hwmon_info,
                   ^~~~~~~~~~~~~~~~~
   6 warnings and 1 error generated.


vim +375 drivers/rtc/rtc-ds3232.c

c35c4195f919a0 Kirill Esipov 2017-06-28  372  
c35c4195f919a0 Kirill Esipov 2017-06-28  373  static const struct hwmon_chip_info ds3232_hwmon_chip_info = {
c35c4195f919a0 Kirill Esipov 2017-06-28  374  	.ops = &ds3232_hwmon_hwmon_ops,
c35c4195f919a0 Kirill Esipov 2017-06-28 @375  	.info = ds3232_hwmon_info,
c35c4195f919a0 Kirill Esipov 2017-06-28  376  };
c35c4195f919a0 Kirill Esipov 2017-06-28  377  

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

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

* Re: [PATCH 3/4] rtc: isl12022: constify pointers to hwmon_channel_info
  2023-04-07 15:03 ` [PATCH 3/4] rtc: isl12022: " Krzysztof Kozlowski
@ 2023-04-07 20:06   ` kernel test robot
  0 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2023-04-07 20:06 UTC (permalink / raw)
  To: Krzysztof Kozlowski; +Cc: llvm, oe-kbuild-all

Hi Krzysztof,

kernel test robot noticed the following build errors:

[auto build test ERROR on abelloni/rtc-next]
[also build test ERROR on linus/master v6.3-rc5 next-20230406]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Krzysztof-Kozlowski/rtc-ds3232-constify-pointers-to-hwmon_channel_info/20230407-231346
base:   https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git rtc-next
patch link:    https://lore.kernel.org/r/20230407150306.80141-3-krzysztof.kozlowski%40linaro.org
patch subject: [PATCH 3/4] rtc: isl12022: constify pointers to hwmon_channel_info
config: hexagon-buildonly-randconfig-r001-20230403 (https://download.01.org/0day-ci/archive/20230408/202304080345.wtksgffl-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 2c57868e2e877f73c339796c3374ae660bb77f0d)
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/06644d5f5c3ff3ed4bbd7a34c68421f80095e616
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Krzysztof-Kozlowski/rtc-ds3232-constify-pointers-to-hwmon_channel_info/20230407-231346
        git checkout 06644d5f5c3ff3ed4bbd7a34c68421f80095e616
        # 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=hexagon olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/rtc/

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/202304080345.wtksgffl-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/rtc/rtc-isl12022.c:14:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __raw_readb(PCI_IOBASE + addr);
                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                                                     ^
   In file included from drivers/rtc/rtc-isl12022.c:14:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                                                     ^
   In file included from drivers/rtc/rtc-isl12022.c:14:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
>> drivers/rtc/rtc-isl12022.c:104:10: error: initializing 'const struct hwmon_channel_info **' with an expression of type 'const struct hwmon_channel_info *const[2]' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
           .info = isl12022_hwmon_info,
                   ^~~~~~~~~~~~~~~~~~~
   6 warnings and 1 error generated.


vim +104 drivers/rtc/rtc-isl12022.c

8d816c1eaa7525 Rasmus Villemoes 2022-11-04  101  
8d816c1eaa7525 Rasmus Villemoes 2022-11-04  102  static const struct hwmon_chip_info isl12022_hwmon_chip_info = {
8d816c1eaa7525 Rasmus Villemoes 2022-11-04  103  	.ops = &isl12022_hwmon_ops,
8d816c1eaa7525 Rasmus Villemoes 2022-11-04 @104  	.info = isl12022_hwmon_info,
8d816c1eaa7525 Rasmus Villemoes 2022-11-04  105  };
8d816c1eaa7525 Rasmus Villemoes 2022-11-04  106  

-- 
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] rtc: ab-eoz9: constify pointers to hwmon_channel_info
  2023-04-07 15:03 [PATCH 1/4] rtc: ab-eoz9: constify pointers to hwmon_channel_info Krzysztof Kozlowski
                   ` (4 preceding siblings ...)
  2023-04-07 18:22 ` kernel test robot
@ 2023-04-27 22:42 ` Alexandre Belloni
  5 siblings, 0 replies; 9+ messages in thread
From: Alexandre Belloni @ 2023-04-27 22:42 UTC (permalink / raw)
  To: Alessandro Zummo, linux-rtc, linux-kernel, Krzysztof Kozlowski
  Cc: Jean Delvare, Guenter Roeck, linux-hwmon


On Fri, 07 Apr 2023 17:03:03 +0200, Krzysztof Kozlowski wrote:
> Statically allocated array of pointed to hwmon_channel_info can be made
> const for safety.
> 
> 

Applied, thanks!

[1/4] rtc: ab-eoz9: constify pointers to hwmon_channel_info
      commit: 4c3f19ce70d7a008953a8d2e9584a20c328699c6
[2/4] rtc: ds3232: constify pointers to hwmon_channel_info
      commit: e4133995fe80251ad2abb0261745ea27ab97c2e7
[3/4] rtc: isl12022: constify pointers to hwmon_channel_info
      commit: a176de9fffcb97ee885b2ade3dbb23dc9be33b29
[4/4] rtc: rv3032: constify pointers to hwmon_channel_info
      commit: eaa9cec95de9405ee7400e8888e6d3d42173df28

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2023-04-27 22:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-07 15:03 [PATCH 1/4] rtc: ab-eoz9: constify pointers to hwmon_channel_info Krzysztof Kozlowski
2023-04-07 15:03 ` [PATCH 2/4] rtc: ds3232: " Krzysztof Kozlowski
2023-04-07 18:54   ` kernel test robot
2023-04-07 15:03 ` [PATCH 3/4] rtc: isl12022: " Krzysztof Kozlowski
2023-04-07 20:06   ` kernel test robot
2023-04-07 15:03 ` [PATCH 4/4] rtc: rv3032: " Krzysztof Kozlowski
2023-04-07 17:50 ` [PATCH 1/4] rtc: ab-eoz9: " kernel test robot
2023-04-07 18:22 ` kernel test robot
2023-04-27 22:42 ` Alexandre Belloni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.