* [PATCH] media: i2c: video: constify pointers to hwmon_channel_info
@ 2023-04-07 15:00 Krzysztof Kozlowski
2023-04-07 16:57 ` kernel test robot
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2023-04-07 15:00 UTC (permalink / raw)
To: Matt Ranostay, Mauro Carvalho Chehab, linux-media, 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/media/i2c/video-i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c
index dddf9827b314..abd472dcd497 100644
--- a/drivers/media/i2c/video-i2c.c
+++ b/drivers/media/i2c/video-i2c.c
@@ -274,7 +274,7 @@ static const struct hwmon_channel_info amg88xx_temp = {
.config = amg88xx_temp_config,
};
-static const struct hwmon_channel_info *amg88xx_info[] = {
+static const struct hwmon_channel_info * const amg88xx_info[] = {
&amg88xx_temp,
NULL
};
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] media: i2c: video: constify pointers to hwmon_channel_info
2023-04-07 15:00 [PATCH] media: i2c: video: constify pointers to hwmon_channel_info Krzysztof Kozlowski
@ 2023-04-07 16:57 ` kernel test robot
2023-04-07 17:16 ` Sakari Ailus
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2023-04-07 16:57 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 media-tree/master]
[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/media-i2c-video-constify-pointers-to-hwmon_channel_info/20230407-230721
base: git://linuxtv.org/media_tree.git master
patch link: https://lore.kernel.org/r/20230407150015.79715-1-krzysztof.kozlowski%40linaro.org
patch subject: [PATCH] media: i2c: video: constify pointers to hwmon_channel_info
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20230408/202304080056.8aAD0WhO-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/a9135e120b356553564ba1046e7752e4f9008666
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Krzysztof-Kozlowski/media-i2c-video-constify-pointers-to-hwmon_channel_info/20230407-230721
git checkout a9135e120b356553564ba1046e7752e4f9008666
# 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/media/
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/202304080056.8aAD0WhO-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/media/i2c/video-i2c.c:328:17: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
328 | .info = amg88xx_info,
| ^~~~~~~~~~~~
vim +/const +328 drivers/media/i2c/video-i2c.c
acbea6798955e9 Matt Ranostay 2018-06-28 325
acbea6798955e9 Matt Ranostay 2018-06-28 326 static const struct hwmon_chip_info amg88xx_chip_info = {
acbea6798955e9 Matt Ranostay 2018-06-28 327 .ops = &amg88xx_hwmon_ops,
acbea6798955e9 Matt Ranostay 2018-06-28 @328 .info = amg88xx_info,
acbea6798955e9 Matt Ranostay 2018-06-28 329 };
acbea6798955e9 Matt Ranostay 2018-06-28 330
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] media: i2c: video: constify pointers to hwmon_channel_info
2023-04-07 15:00 [PATCH] media: i2c: video: constify pointers to hwmon_channel_info Krzysztof Kozlowski
2023-04-07 16:57 ` kernel test robot
@ 2023-04-07 17:16 ` Sakari Ailus
2023-04-07 18:08 ` Guenter Roeck
2023-04-07 23:08 ` Guenter Roeck
` (2 subsequent siblings)
4 siblings, 1 reply; 7+ messages in thread
From: Sakari Ailus @ 2023-04-07 17:16 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Matt Ranostay, Mauro Carvalho Chehab, linux-media, linux-kernel,
Jean Delvare, Guenter Roeck, linux-hwmon
Hi Krzysztof,
On Fri, Apr 07, 2023 at 05:00:15PM +0200, Krzysztof Kozlowski wrote:
> 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.
Works for me. Please add:
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Thanks!
--
Kind regards,
Sakari Ailus
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] media: i2c: video: constify pointers to hwmon_channel_info
2023-04-07 17:16 ` Sakari Ailus
@ 2023-04-07 18:08 ` Guenter Roeck
0 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2023-04-07 18:08 UTC (permalink / raw)
To: Sakari Ailus
Cc: Krzysztof Kozlowski, Matt Ranostay, Mauro Carvalho Chehab,
linux-media, linux-kernel, Jean Delvare, linux-hwmon
On Fri, Apr 07, 2023 at 08:16:30PM +0300, Sakari Ailus wrote:
> Hi Krzysztof,
>
> On Fri, Apr 07, 2023 at 05:00:15PM +0200, Krzysztof Kozlowski wrote:
> > 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.
>
> Works for me. Please add:
>
But not for me. Krzysztof jumped the gun here a bit.
I do not feel comfortable applying patches for 10+ subsystem
branches through hwmon. This is asking for trouble.
I created a stable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-const
which everyone may use to merge the pre-requisite patch, or wait until
after the next merge window.
Guenter
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] media: i2c: video: constify pointers to hwmon_channel_info
2023-04-07 15:00 [PATCH] media: i2c: video: constify pointers to hwmon_channel_info Krzysztof Kozlowski
2023-04-07 16:57 ` kernel test robot
2023-04-07 17:16 ` Sakari Ailus
@ 2023-04-07 23:08 ` Guenter Roeck
2023-04-09 15:45 ` kernel test robot
2023-04-10 3:13 ` Matt Ranostay
4 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2023-04-07 23:08 UTC (permalink / raw)
To: Krzysztof Kozlowski, Matt Ranostay, Mauro Carvalho Chehab,
linux-media, linux-kernel
Cc: Jean Delvare, linux-hwmon
On 4/7/23 08:00, Krzysztof Kozlowski wrote:
> 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.
>
I am not going to apply patches for 10+ subsystems through the hwmon tree.
This can only result in chaos. The dependent patch is available at
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-const
or wait until after the next commit window to apply this patch.
Thanks,
Guenter
> Cc: Jean Delvare <jdelvare@suse.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: linux-hwmon@vger.kernel.org
> ---
> drivers/media/i2c/video-i2c.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c
> index dddf9827b314..abd472dcd497 100644
> --- a/drivers/media/i2c/video-i2c.c
> +++ b/drivers/media/i2c/video-i2c.c
> @@ -274,7 +274,7 @@ static const struct hwmon_channel_info amg88xx_temp = {
> .config = amg88xx_temp_config,
> };
>
> -static const struct hwmon_channel_info *amg88xx_info[] = {
> +static const struct hwmon_channel_info * const amg88xx_info[] = {
> &amg88xx_temp,
> NULL
> };
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] media: i2c: video: constify pointers to hwmon_channel_info
2023-04-07 15:00 [PATCH] media: i2c: video: constify pointers to hwmon_channel_info Krzysztof Kozlowski
` (2 preceding siblings ...)
2023-04-07 23:08 ` Guenter Roeck
@ 2023-04-09 15:45 ` kernel test robot
2023-04-10 3:13 ` Matt Ranostay
4 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2023-04-09 15:45 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 media-tree/master]
[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/media-i2c-video-constify-pointers-to-hwmon_channel_info/20230407-230721
base: git://linuxtv.org/media_tree.git master
patch link: https://lore.kernel.org/r/20230407150015.79715-1-krzysztof.kozlowski%40linaro.org
patch subject: [PATCH] media: i2c: video: constify pointers to hwmon_channel_info
config: s390-randconfig-s051-20230409 (https://download.01.org/0day-ci/archive/20230409/202304092352.T3BmNdHl-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 12.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://github.com/intel-lab-lkp/linux/commit/a9135e120b356553564ba1046e7752e4f9008666
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Krzysztof-Kozlowski/media-i2c-video-constify-pointers-to-hwmon_channel_info/20230407-230721
git checkout a9135e120b356553564ba1046e7752e4f9008666
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=s390 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=s390 SHELL=/bin/bash drivers/media/i2c/
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/202304092352.T3BmNdHl-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/media/i2c/video-i2c.c:328:17: sparse: sparse: incorrect type in initializer (different modifiers) @@ expected struct hwmon_channel_info const **info @@ got struct hwmon_channel_info const *const * @@
drivers/media/i2c/video-i2c.c:328:17: sparse: expected struct hwmon_channel_info const **info
drivers/media/i2c/video-i2c.c:328:17: sparse: got struct hwmon_channel_info const *const *
vim +328 drivers/media/i2c/video-i2c.c
acbea6798955e9 Matt Ranostay 2018-06-28 325
acbea6798955e9 Matt Ranostay 2018-06-28 326 static const struct hwmon_chip_info amg88xx_chip_info = {
acbea6798955e9 Matt Ranostay 2018-06-28 327 .ops = &amg88xx_hwmon_ops,
acbea6798955e9 Matt Ranostay 2018-06-28 @328 .info = amg88xx_info,
acbea6798955e9 Matt Ranostay 2018-06-28 329 };
acbea6798955e9 Matt Ranostay 2018-06-28 330
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] media: i2c: video: constify pointers to hwmon_channel_info
2023-04-07 15:00 [PATCH] media: i2c: video: constify pointers to hwmon_channel_info Krzysztof Kozlowski
` (3 preceding siblings ...)
2023-04-09 15:45 ` kernel test robot
@ 2023-04-10 3:13 ` Matt Ranostay
4 siblings, 0 replies; 7+ messages in thread
From: Matt Ranostay @ 2023-04-10 3:13 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, Jean Delvare,
Guenter Roeck, linux-hwmon
On Fri, Apr 7, 2023 at 8:00 AM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> Statically allocated array of pointed to hwmon_channel_info can be made
> const for safety.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Matt Ranostay <matt.ranostay@konsulko.com>
>
> ---
>
> 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/media/i2c/video-i2c.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c
> index dddf9827b314..abd472dcd497 100644
> --- a/drivers/media/i2c/video-i2c.c
> +++ b/drivers/media/i2c/video-i2c.c
> @@ -274,7 +274,7 @@ static const struct hwmon_channel_info amg88xx_temp = {
> .config = amg88xx_temp_config,
> };
>
> -static const struct hwmon_channel_info *amg88xx_info[] = {
> +static const struct hwmon_channel_info * const amg88xx_info[] = {
> &amg88xx_temp,
> NULL
> };
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-04-10 3:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-07 15:00 [PATCH] media: i2c: video: constify pointers to hwmon_channel_info Krzysztof Kozlowski
2023-04-07 16:57 ` kernel test robot
2023-04-07 17:16 ` Sakari Ailus
2023-04-07 18:08 ` Guenter Roeck
2023-04-07 23:08 ` Guenter Roeck
2023-04-09 15:45 ` kernel test robot
2023-04-10 3:13 ` Matt Ranostay
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.