Message ID | 20230309082841.400118-1-jani.nikula@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp176293wrd; Thu, 9 Mar 2023 00:52:30 -0800 (PST) X-Google-Smtp-Source: AK7set+DQ7PgEgl+G2M0csi+4DHpbMpwCQEQxYeqw0Q3/Yx6DrETU+zAGRGEMJkLGRMvvFaUtnK4 X-Received: by 2002:a05:6a20:4924:b0:cd:ed5c:4ac with SMTP id ft36-20020a056a20492400b000cded5c04acmr16713369pzb.17.1678351949783; Thu, 09 Mar 2023 00:52:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678351949; cv=none; d=google.com; s=arc-20160816; b=hf9s5lDbtarLCaVNm6FBTJ7ZNLYEETYQSDDrMjjtoIRrH9IUMp6onjc1vLUs3SsJkU In5K1PyZ9m1L+NXX5D9EBksuDzoVNgGXceM/IUEtkyzjA8A/rifZvU5rykz0LLVZ47ge ZTJ0GHEYI1/Lam/7xlOfVAmnUlNFVyFeqwczuxmSU2zTwD2MZ1ALnnT9c8idbrHNbeiC RTC5fp/+hQ04GjgdkMMkifS1jGfIU1xjWxPDa7dK7xoYkOdgUnLFZeDXMuJzSEjMsMg7 18y6oRWq4W96r4nil8YEHvhomAMKKvsJ9X6/Sf3F2wTEb5DmZbFiyKHhZdv9mN8IWDgv 84AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=JR7P5zResTEHqvu6zixd4me28AygZpHy1U3I3CeB5OY=; b=RMKq5dxqT+pnnhesY5Hn/N2RdGrjjWczAuF2B1eAcTy9xia6Z3U2mnKDespPevisQ2 /a10tu9FAR6rySZo9+0nD771/oggErqFa7qvPtbNwJ6OsEktKEhTuFpWQaFKISLVne7p 2TLoSNtyk9fhbHcUjTie0Qd1aoTGfi7s3VD1wde7AHQ8w4jObLgVa09lGeEMcCgONmxZ 1URDToU63lsoPlagM1eLVdkyQYA7zoATjhmGVrhHFxIBIoH7brK1lQlbBofIrTJJ/63S +3cq3cH7RUG3D9jJZQRj6b8umH+4Fl0pEpNAmgG5KX0qAHknf3ORW5kvu8PXd7X2Rj/m YvxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hfxLBceD; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f16-20020a63f110000000b00502d6998a4asi5711106pgi.458.2023.03.09.00.52.14; Thu, 09 Mar 2023 00:52:29 -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=@intel.com header.s=Intel header.b=hfxLBceD; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229943AbjCIIbM (ORCPT <rfc822;carlos.wei.hk@gmail.com> + 99 others); Thu, 9 Mar 2023 03:31:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229717AbjCIIau (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Mar 2023 03:30:50 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40013DE1D0; Thu, 9 Mar 2023 00:29:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678350544; x=1709886544; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=iL2MAYQRyw6sIBcex3hfg5K8mlbgbGU+jM45YnmCajs=; b=hfxLBceDTCK2vA9przOVw4LIrvCJNxOyo17uIpeFAMPDQ2rWPsMtWUoX NPxohEPsE/NvNhTgAt7ZqERoaK3GMlX+Jk63ymfdKdHczDn+E7DLFnl4n 3NUB9ph3X70MuSgIjlS/dQXQRJP/VmJ7D/XAHi0+Mp+oWORnVDtrxDHgv JWZ7qBYB2nWDAi6dUX/Ivx/C7jBB194BgvIiTlfszG92X0NSNd9kJWzwf nxmAaoXI5Kxmp+oT1owfDAU94cvWUlH8+DUY7qafwMZ9+lLpOE3Ba0baJ 0w8u4tBDYjJhio2YpYcErZmjs06OOskzRlMRClH4V+J7IgzkXyEafuHGv w==; X-IronPort-AV: E=McAfee;i="6500,9779,10643"; a="316046816" X-IronPort-AV: E=Sophos;i="5.98,245,1673942400"; d="scan'208";a="316046816" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2023 00:28:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10643"; a="741467479" X-IronPort-AV: E=Sophos;i="5.98,245,1673942400"; d="scan'208";a="741467479" Received: from jnikula-mobl4.fi.intel.com (HELO localhost) ([10.237.66.145]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2023 00:28:49 -0800 From: Jani Nikula <jani.nikula@intel.com> To: linux-kernel@vger.kernel.org Cc: Jani Nikula <jani.nikula@intel.com>, Jean Delvare <jdelvare@suse.com>, Guenter Roeck <linux@roeck-us.net>, linux-hwmon@vger.kernel.org Subject: [PATCH] hwmon: constify struct hwmon_chip_info info member harder Date: Thu, 9 Mar 2023 10:28:41 +0200 Message-Id: <20230309082841.400118-1-jani.nikula@intel.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759879573657303476?= X-GMAIL-MSGID: =?utf-8?q?1759879573657303476?= |
Series |
hwmon: constify struct hwmon_chip_info info member harder
|
|
Commit Message
Jani Nikula
March 9, 2023, 8:28 a.m. UTC
Let the struct hwmon_chip_info info member be a pointer to a const array
of const pointers, rather than mutable array of const pointers.
Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
include/linux/hwmon.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi Jani,
I love your patch! Yet something to improve:
[auto build test ERROR on groeck-staging/hwmon-next]
[also build test ERROR on linus/master v6.3-rc1 next-20230309]
[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/Jani-Nikula/hwmon-constify-struct-hwmon_chip_info-info-member-harder/20230309-163328
base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
patch link: https://lore.kernel.org/r/20230309082841.400118-1-jani.nikula%40intel.com
patch subject: [PATCH] hwmon: constify struct hwmon_chip_info info member harder
config: x86_64-randconfig-a003 (https://download.01.org/0day-ci/archive/20230309/202303091814.jyOAXX4n-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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/1ec9eaf0281f0a40044492700b7cdfe99d35d35e
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Jani-Nikula/hwmon-constify-struct-hwmon_chip_info-info-member-harder/20230309-163328
git checkout 1ec9eaf0281f0a40044492700b7cdfe99d35d35e
# 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=x86_64 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/hwmon/
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/202303091814.jyOAXX4n-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/hwmon/hwmon.c:177:36: error: initializing 'const struct hwmon_channel_info **' with an expression of type 'const struct hwmon_channel_info *const *const' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
const struct hwmon_channel_info **info = chip->info;
^ ~~~~~~~~~~
drivers/hwmon/hwmon.c:256:36: error: initializing 'const struct hwmon_channel_info **' with an expression of type 'const struct hwmon_channel_info *const *const' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
const struct hwmon_channel_info **info = chip->info;
^ ~~~~~~~~~~
2 errors generated.
vim +177 drivers/hwmon/hwmon.c
d560168b5d0fb4 Guenter Roeck 2015-08-26 171
e5181331359d93 Daniel Lezcano 2022-08-05 172 static int hwmon_thermal_set_trips(struct thermal_zone_device *tz, int low, int high)
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 173 {
e5181331359d93 Daniel Lezcano 2022-08-05 174 struct hwmon_thermal_data *tdata = tz->devdata;
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 175 struct hwmon_device *hwdev = to_hwmon_device(tdata->dev);
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 176 const struct hwmon_chip_info *chip = hwdev->chip;
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 @177 const struct hwmon_channel_info **info = chip->info;
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 178 unsigned int i;
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 179 int err;
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 180
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 181 if (!chip->ops->write)
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 182 return 0;
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 183
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 184 for (i = 0; info[i] && info[i]->type != hwmon_temp; i++)
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 185 continue;
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 186
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 187 if (!info[i])
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 188 return 0;
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 189
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 190 if (info[i]->config[tdata->index] & HWMON_T_MIN) {
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 191 err = chip->ops->write(tdata->dev, hwmon_temp,
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 192 hwmon_temp_min, tdata->index, low);
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 193 if (err && err != -EOPNOTSUPP)
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 194 return err;
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 195 }
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 196
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 197 if (info[i]->config[tdata->index] & HWMON_T_MAX) {
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 198 err = chip->ops->write(tdata->dev, hwmon_temp,
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 199 hwmon_temp_max, tdata->index, high);
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 200 if (err && err != -EOPNOTSUPP)
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 201 return err;
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 202 }
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 203
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 204 return 0;
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 205 }
a5f6c0f85a09f4 Dmitry Osipenko 2021-06-23 206
On Thu, Mar 09, 2023 at 10:28:41AM +0200, Jani Nikula wrote: > Let the struct hwmon_chip_info info member be a pointer to a const array > of const pointers, rather than mutable array of const pointers. > > Cc: Jean Delvare <jdelvare@suse.com> > Cc: Guenter Roeck <linux@roeck-us.net> > Cc: linux-hwmon@vger.kernel.org > Signed-off-by: Jani Nikula <jani.nikula@intel.com> > --- > include/linux/hwmon.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h > index c1b62384b6ee..492dd27a5dd8 100644 > --- a/include/linux/hwmon.h > +++ b/include/linux/hwmon.h > @@ -430,7 +430,7 @@ struct hwmon_channel_info { > */ > struct hwmon_chip_info { > const struct hwmon_ops *ops; > - const struct hwmon_channel_info **info; > + const struct hwmon_channel_info * const *info; As pointed out by 0-day, you's also have to change each instance where this is is assigned to another variable. Guenter > }; > > /* hwmon_device_register() is deprecated */ > -- > 2.39.1 >
On Thu, 09 Mar 2023, Guenter Roeck <linux@roeck-us.net> wrote: > On Thu, Mar 09, 2023 at 10:28:41AM +0200, Jani Nikula wrote: >> Let the struct hwmon_chip_info info member be a pointer to a const array >> of const pointers, rather than mutable array of const pointers. >> >> Cc: Jean Delvare <jdelvare@suse.com> >> Cc: Guenter Roeck <linux@roeck-us.net> >> Cc: linux-hwmon@vger.kernel.org >> Signed-off-by: Jani Nikula <jani.nikula@intel.com> >> --- >> include/linux/hwmon.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h >> index c1b62384b6ee..492dd27a5dd8 100644 >> --- a/include/linux/hwmon.h >> +++ b/include/linux/hwmon.h >> @@ -430,7 +430,7 @@ struct hwmon_channel_info { >> */ >> struct hwmon_chip_info { >> const struct hwmon_ops *ops; >> - const struct hwmon_channel_info **info; >> + const struct hwmon_channel_info * const *info; > > As pointed out by 0-day, you's also have to change each > instance where this is is assigned to another variable. Ah, sorry, I had THERMAL_OF=n. BR, Jani. > > Guenter > >> }; >> >> /* hwmon_device_register() is deprecated */ >> -- >> 2.39.1 >>
Hi Jani,
I love your patch! Perhaps something to improve:
[auto build test WARNING on groeck-staging/hwmon-next]
[also build test WARNING on linus/master v6.3-rc1 next-20230309]
[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/Jani-Nikula/hwmon-constify-struct-hwmon_chip_info-info-member-harder/20230309-163328
base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
patch link: https://lore.kernel.org/r/20230309082841.400118-1-jani.nikula%40intel.com
patch subject: [PATCH] hwmon: constify struct hwmon_chip_info info member harder
config: x86_64-randconfig-a011 (https://download.01.org/0day-ci/archive/20230309/202303091901.0BoQeZI2-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/1ec9eaf0281f0a40044492700b7cdfe99d35d35e
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Jani-Nikula/hwmon-constify-struct-hwmon_chip_info-info-member-harder/20230309-163328
git checkout 1ec9eaf0281f0a40044492700b7cdfe99d35d35e
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/hwmon/
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/202303091901.0BoQeZI2-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/hwmon/hwmon.c: In function 'hwmon_thermal_set_trips':
>> drivers/hwmon/hwmon.c:177:50: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
177 | const struct hwmon_channel_info **info = chip->info;
| ^~~~
drivers/hwmon/hwmon.c: In function 'hwmon_thermal_register_sensors':
drivers/hwmon/hwmon.c:256:50: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
256 | const struct hwmon_channel_info **info = chip->info;
| ^~~~
vim +/const +177 drivers/hwmon/hwmon.c
d560168b5d0fb4a Guenter Roeck 2015-08-26 171
e5181331359d931 Daniel Lezcano 2022-08-05 172 static int hwmon_thermal_set_trips(struct thermal_zone_device *tz, int low, int high)
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 173 {
e5181331359d931 Daniel Lezcano 2022-08-05 174 struct hwmon_thermal_data *tdata = tz->devdata;
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 175 struct hwmon_device *hwdev = to_hwmon_device(tdata->dev);
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 176 const struct hwmon_chip_info *chip = hwdev->chip;
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 @177 const struct hwmon_channel_info **info = chip->info;
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 178 unsigned int i;
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 179 int err;
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 180
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 181 if (!chip->ops->write)
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 182 return 0;
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 183
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 184 for (i = 0; info[i] && info[i]->type != hwmon_temp; i++)
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 185 continue;
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 186
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 187 if (!info[i])
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 188 return 0;
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 189
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 190 if (info[i]->config[tdata->index] & HWMON_T_MIN) {
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 191 err = chip->ops->write(tdata->dev, hwmon_temp,
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 192 hwmon_temp_min, tdata->index, low);
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 193 if (err && err != -EOPNOTSUPP)
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 194 return err;
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 195 }
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 196
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 197 if (info[i]->config[tdata->index] & HWMON_T_MAX) {
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 198 err = chip->ops->write(tdata->dev, hwmon_temp,
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 199 hwmon_temp_max, tdata->index, high);
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 200 if (err && err != -EOPNOTSUPP)
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 201 return err;
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 202 }
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 203
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 204 return 0;
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 205 }
a5f6c0f85a09f46 Dmitry Osipenko 2021-06-23 206
On Thu, Mar 09, 2023 at 01:14:28PM +0200, Jani Nikula wrote: > On Thu, 09 Mar 2023, Guenter Roeck <linux@roeck-us.net> wrote: > > On Thu, Mar 09, 2023 at 10:28:41AM +0200, Jani Nikula wrote: > >> Let the struct hwmon_chip_info info member be a pointer to a const array > >> of const pointers, rather than mutable array of const pointers. > >> > >> Cc: Jean Delvare <jdelvare@suse.com> > >> Cc: Guenter Roeck <linux@roeck-us.net> > >> Cc: linux-hwmon@vger.kernel.org > >> Signed-off-by: Jani Nikula <jani.nikula@intel.com> > >> --- > >> include/linux/hwmon.h | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h > >> index c1b62384b6ee..492dd27a5dd8 100644 > >> --- a/include/linux/hwmon.h > >> +++ b/include/linux/hwmon.h > >> @@ -430,7 +430,7 @@ struct hwmon_channel_info { > >> */ > >> struct hwmon_chip_info { > >> const struct hwmon_ops *ops; > >> - const struct hwmon_channel_info **info; > >> + const struct hwmon_channel_info * const *info; > > > > As pointed out by 0-day, you's also have to change each > > instance where this is is assigned to another variable. > > Ah, sorry, I had THERMAL_OF=n. > You also didn't test compile drivers/hwmon/hwmon.c. I had wondered about that, and 0-day now confirmed it. Guenter > BR, > Jani. > > > > > > Guenter > > > >> }; > >> > >> /* hwmon_device_register() is deprecated */ > >> -- > >> 2.39.1 > >> > > -- > Jani Nikula, Intel Open Source Graphics Center
On Thu, 09 Mar 2023, Guenter Roeck <linux@roeck-us.net> wrote: > On Thu, Mar 09, 2023 at 01:14:28PM +0200, Jani Nikula wrote: >> On Thu, 09 Mar 2023, Guenter Roeck <linux@roeck-us.net> wrote: >> > On Thu, Mar 09, 2023 at 10:28:41AM +0200, Jani Nikula wrote: >> >> Let the struct hwmon_chip_info info member be a pointer to a const array >> >> of const pointers, rather than mutable array of const pointers. >> >> >> >> Cc: Jean Delvare <jdelvare@suse.com> >> >> Cc: Guenter Roeck <linux@roeck-us.net> >> >> Cc: linux-hwmon@vger.kernel.org >> >> Signed-off-by: Jani Nikula <jani.nikula@intel.com> >> >> --- >> >> include/linux/hwmon.h | 2 +- >> >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> >> >> diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h >> >> index c1b62384b6ee..492dd27a5dd8 100644 >> >> --- a/include/linux/hwmon.h >> >> +++ b/include/linux/hwmon.h >> >> @@ -430,7 +430,7 @@ struct hwmon_channel_info { >> >> */ >> >> struct hwmon_chip_info { >> >> const struct hwmon_ops *ops; >> >> - const struct hwmon_channel_info **info; >> >> + const struct hwmon_channel_info * const *info; >> > >> > As pointed out by 0-day, you's also have to change each >> > instance where this is is assigned to another variable. >> >> Ah, sorry, I had THERMAL_OF=n. >> > > You also didn't test compile drivers/hwmon/hwmon.c. > I had wondered about that, and 0-day now confirmed it. I most certainly did. And as I looked into why I didn't see the failure 0-day hits I noticed THERMAL_OF=n like I said. BR, Jani. > > Guenter > >> BR, >> Jani. >> >> >> > >> > Guenter >> > >> >> }; >> >> >> >> /* hwmon_device_register() is deprecated */ >> >> -- >> >> 2.39.1 >> >> >> >> -- >> Jani Nikula, Intel Open Source Graphics Center
diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h index c1b62384b6ee..492dd27a5dd8 100644 --- a/include/linux/hwmon.h +++ b/include/linux/hwmon.h @@ -430,7 +430,7 @@ struct hwmon_channel_info { */ struct hwmon_chip_info { const struct hwmon_ops *ops; - const struct hwmon_channel_info **info; + const struct hwmon_channel_info * const *info; }; /* hwmon_device_register() is deprecated */