From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [soc:board-remove-7.3 182/295] drivers/hwmon/ads7828.c:121 ads7828_probe() warn: if statement not indented
Date: Fri, 11 Sep 2026 10:52:40 +0200 [thread overview]
Message-ID: <202609111050.oiut4oST-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-arm-kernel@lists.infradead.org
CC: arm@kernel.org
TO: Arnd Bergmann <arnd@arndb.de>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git board-remove-7.3
head: cf983087c51a9c74c3d4d3b353eb811ae5030823
commit: 4df92b98525f08e1eab92a25f5da2045c78403e8 [182/295] hwmon: asd7828: remove pdata based probing
:::::: branch date: 15 hours ago
:::::: commit date: 15 hours ago
config: arm-randconfig-r071-20260911 (https://download.01.org/0day-ci/archive/20260911/202609111050.oiut4oST-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
smatch: v0.5.0-9187-g5189e3fb
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202609111050.oiut4oST-lkp@intel.com/
smatch warnings:
drivers/hwmon/ads7828.c:121 ads7828_probe() warn: if statement not indented
vim +121 drivers/hwmon/ads7828.c
bea0bab0fcf5a0 Guenter Roeck 2015-01-16 100
673afe466166cd Stephen Kitt 2020-08-21 101 static int ads7828_probe(struct i2c_client *client)
7347cb388e5aec Jean Delvare 2008-07-16 102 {
f82b2c344994f2 Axel Lin 2014-06-17 103 struct device *dev = &client->dev;
7347cb388e5aec Jean Delvare 2008-07-16 104 struct ads7828_data *data;
f82b2c344994f2 Axel Lin 2014-06-17 105 struct device *hwmon_dev;
7f444bf0a28c03 Guenter Roeck 2015-01-16 106 unsigned int vref_mv = ADS7828_INT_VREF_MV;
fddb5ceaf901b0 Qingshuang Fu 2026-08-05 107 int vref_uv;
7f444bf0a28c03 Guenter Roeck 2015-01-16 108 bool diff_input = false;
7f444bf0a28c03 Guenter Roeck 2015-01-16 109 bool ext_vref = false;
7a18afe8097731 Akshay Bhat 2016-04-18 110 unsigned int regval;
2d688f1413aba3 Javier Martinez Canillas 2017-02-24 111 enum ads7828_chips chip;
5812f9283e6213 Steve Hardy 2008-01-22 112
f82b2c344994f2 Axel Lin 2014-06-17 113 data = devm_kzalloc(dev, sizeof(struct ads7828_data), GFP_KERNEL);
34e3f7f5a283c5 Guenter Roeck 2012-06-02 114 if (!data)
34e3f7f5a283c5 Guenter Roeck 2012-06-02 115 return -ENOMEM;
5812f9283e6213 Steve Hardy 2008-01-22 116
a8ddfea09566c3 Sam Povilus 2017-03-29 117 diff_input = of_property_read_bool(dev->of_node,
a8ddfea09566c3 Sam Povilus 2017-03-29 118 "ti,differential-input");
fddb5ceaf901b0 Qingshuang Fu 2026-08-05 119 vref_uv = devm_regulator_get_enable_read_voltage(dev, "vref");
fddb5ceaf901b0 Qingshuang Fu 2026-08-05 120 if (vref_uv < 0) {
fddb5ceaf901b0 Qingshuang Fu 2026-08-05 @121 if (vref_uv != -ENODEV)
fddb5ceaf901b0 Qingshuang Fu 2026-08-05 122 return vref_uv;
fddb5ceaf901b0 Qingshuang Fu 2026-08-05 123 } else {
a8ddfea09566c3 Sam Povilus 2017-03-29 124 vref_mv = DIV_ROUND_CLOSEST(vref_uv, 1000);
a8ddfea09566c3 Sam Povilus 2017-03-29 125 if (vref_mv < ADS7828_EXT_VREF_MV_MIN ||
a8ddfea09566c3 Sam Povilus 2017-03-29 126 vref_mv > ADS7828_EXT_VREF_MV_MAX)
a8ddfea09566c3 Sam Povilus 2017-03-29 127 return -EINVAL;
a8ddfea09566c3 Sam Povilus 2017-03-29 128 ext_vref = true;
a8ddfea09566c3 Sam Povilus 2017-03-29 129 }
46d784629202c5 Vivien Didelot 2012-10-03 130
ec6755630773bb Andrew Davis 2024-04-03 131 chip = (uintptr_t)i2c_get_match_data(client);
2d688f1413aba3 Javier Martinez Canillas 2017-02-24 132
7f444bf0a28c03 Guenter Roeck 2015-01-16 133 /* Bound Vref with min/max values */
7f444bf0a28c03 Guenter Roeck 2015-01-16 134 vref_mv = clamp_val(vref_mv, ADS7828_EXT_VREF_MV_MIN,
46d784629202c5 Vivien Didelot 2012-10-03 135 ADS7828_EXT_VREF_MV_MAX);
46d784629202c5 Vivien Didelot 2012-10-03 136
0962e0f1a5634b Guillaume Roguez 2012-10-03 137 /* ADS7828 uses 12-bit samples, while ADS7830 is 8-bit */
2d688f1413aba3 Javier Martinez Canillas 2017-02-24 138 if (chip == ads7828) {
7f444bf0a28c03 Guenter Roeck 2015-01-16 139 data->lsb_resol = DIV_ROUND_CLOSEST(vref_mv * 1000, 4096);
bea0bab0fcf5a0 Guenter Roeck 2015-01-16 140 data->regmap = devm_regmap_init_i2c(client,
bea0bab0fcf5a0 Guenter Roeck 2015-01-16 141 &ads2828_regmap_config);
0962e0f1a5634b Guillaume Roguez 2012-10-03 142 } else {
7f444bf0a28c03 Guenter Roeck 2015-01-16 143 data->lsb_resol = DIV_ROUND_CLOSEST(vref_mv * 1000, 256);
bea0bab0fcf5a0 Guenter Roeck 2015-01-16 144 data->regmap = devm_regmap_init_i2c(client,
bea0bab0fcf5a0 Guenter Roeck 2015-01-16 145 &ads2830_regmap_config);
0962e0f1a5634b Guillaume Roguez 2012-10-03 146 }
46d784629202c5 Vivien Didelot 2012-10-03 147
d9ef72cd1c15c2 Axel Lin 2015-02-10 148 if (IS_ERR(data->regmap))
d9ef72cd1c15c2 Axel Lin 2015-02-10 149 return PTR_ERR(data->regmap);
d9ef72cd1c15c2 Axel Lin 2015-02-10 150
7f444bf0a28c03 Guenter Roeck 2015-01-16 151 data->cmd_byte = ext_vref ? ADS7828_CMD_PD1 : ADS7828_CMD_PD3;
7f444bf0a28c03 Guenter Roeck 2015-01-16 152 if (!diff_input)
46d784629202c5 Vivien Didelot 2012-10-03 153 data->cmd_byte |= ADS7828_CMD_SD_SE;
46d784629202c5 Vivien Didelot 2012-10-03 154
7a18afe8097731 Akshay Bhat 2016-04-18 155 /*
7a18afe8097731 Akshay Bhat 2016-04-18 156 * Datasheet specifies internal reference voltage is disabled by
7a18afe8097731 Akshay Bhat 2016-04-18 157 * default. The internal reference voltage needs to be enabled and
7a18afe8097731 Akshay Bhat 2016-04-18 158 * voltage needs to settle before getting valid ADC data. So perform a
7a18afe8097731 Akshay Bhat 2016-04-18 159 * dummy read to enable the internal reference voltage.
7a18afe8097731 Akshay Bhat 2016-04-18 160 */
7a18afe8097731 Akshay Bhat 2016-04-18 161 if (!ext_vref)
7a18afe8097731 Akshay Bhat 2016-04-18 162 regmap_read(data->regmap, data->cmd_byte, ®val);
7a18afe8097731 Akshay Bhat 2016-04-18 163
f82b2c344994f2 Axel Lin 2014-06-17 164 hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name,
f82b2c344994f2 Axel Lin 2014-06-17 165 data,
f82b2c344994f2 Axel Lin 2014-06-17 166 ads7828_groups);
f82b2c344994f2 Axel Lin 2014-06-17 167 return PTR_ERR_OR_ZERO(hwmon_dev);
5812f9283e6213 Steve Hardy 2008-01-22 168 }
5812f9283e6213 Steve Hardy 2008-01-22 169
:::::: The code at line 121 was first introduced by commit
:::::: fddb5ceaf901b050ed2a1a7deeecbf97e003435a hwmon: (ads7828) Fix external VREF regulator handling
:::::: TO: Qingshuang Fu <fuqingshuang@kylinos.cn>
:::::: CC: Guenter Roeck <linux@roeck-us.net>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <error27@gmail.com>
To: oe-kbuild@lists.linux.dev, Arnd Bergmann <arnd@arndb.de>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
linux-arm-kernel@lists.infradead.org, arm@kernel.org
Subject: [soc:board-remove-7.3 182/295] drivers/hwmon/ads7828.c:121 ads7828_probe() warn: if statement not indented
Date: Fri, 11 Sep 2026 15:23:28 +0300 [thread overview]
Message-ID: <202609111050.oiut4oST-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git board-remove-7.3
head: cf983087c51a9c74c3d4d3b353eb811ae5030823
commit: 4df92b98525f08e1eab92a25f5da2045c78403e8 [182/295] hwmon: asd7828: remove pdata based probing
config: arm-randconfig-r071-20260911 (https://download.01.org/0day-ci/archive/20260911/202609111050.oiut4oST-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
smatch: v0.5.0-9187-g5189e3fb
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202609111050.oiut4oST-lkp@intel.com/
smatch warnings:
drivers/hwmon/ads7828.c:121 ads7828_probe() warn: if statement not indented
vim +121 drivers/hwmon/ads7828.c
5812f9283e6213 Steve Hardy 2008-01-22 116
a8ddfea09566c3 Sam Povilus 2017-03-29 117 diff_input = of_property_read_bool(dev->of_node,
a8ddfea09566c3 Sam Povilus 2017-03-29 118 "ti,differential-input");
fddb5ceaf901b0 Qingshuang Fu 2026-08-05 119 vref_uv = devm_regulator_get_enable_read_voltage(dev, "vref");
fddb5ceaf901b0 Qingshuang Fu 2026-08-05 120 if (vref_uv < 0) {
fddb5ceaf901b0 Qingshuang Fu 2026-08-05 @121 if (vref_uv != -ENODEV)
fddb5ceaf901b0 Qingshuang Fu 2026-08-05 122 return vref_uv;
Add another tab before the return.
fddb5ceaf901b0 Qingshuang Fu 2026-08-05 123 } else {
a8ddfea09566c3 Sam Povilus 2017-03-29 124 vref_mv = DIV_ROUND_CLOSEST(vref_uv, 1000);
a8ddfea09566c3 Sam Povilus 2017-03-29 125 if (vref_mv < ADS7828_EXT_VREF_MV_MIN ||
a8ddfea09566c3 Sam Povilus 2017-03-29 126 vref_mv > ADS7828_EXT_VREF_MV_MAX)
a8ddfea09566c3 Sam Povilus 2017-03-29 127 return -EINVAL;
a8ddfea09566c3 Sam Povilus 2017-03-29 128 ext_vref = true;
a8ddfea09566c3 Sam Povilus 2017-03-29 129 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2026-09-11 8:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-11 8:52 kernel test robot [this message]
2026-09-11 12:23 ` [soc:board-remove-7.3 182/295] drivers/hwmon/ads7828.c:121 ads7828_probe() warn: if statement not indented Dan Carpenter
2026-09-11 15:48 ` Arnd Bergmann
-- strict thread matches above, loose matches on Subject: below --
2026-09-11 14:33 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202609111050.oiut4oST-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.