[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210200540.DZY7mjSx-lkp@intel.com>
Date: Thu, 20 Oct 2022 09:15:01 +0800
From: kernel test robot <lkp@...el.com>
To: Hector Martin <marcan@...can.st>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [asahilinux:bits/110-smc 15/29]
drivers/platform/apple/smc_core.c:210:26: sparse: sparse: cast to restricted
__be32
tree: https://github.com/AsahiLinux/linux bits/110-smc
head: d23e12d136f86676385f41e5e612afe735ba8152
commit: 772d47a257030e78353295cd64321e5cf42d13b0 [15/29] platform/apple: Add new Apple Mac SMC driver
config: arm64-randconfig-s042-20221019
compiler: aarch64-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/AsahiLinux/linux/commit/772d47a257030e78353295cd64321e5cf42d13b0
git remote add asahilinux https://github.com/AsahiLinux/linux
git fetch --no-tags asahilinux bits/110-smc
git checkout 772d47a257030e78353295cd64321e5cf42d13b0
# 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=arm64 SHELL=/bin/bash drivers/platform/apple/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/platform/apple/smc_core.c:210:26: sparse: sparse: cast to restricted __be32
>> drivers/platform/apple/smc_core.c:210:26: sparse: sparse: cast to restricted __be32
>> drivers/platform/apple/smc_core.c:210:26: sparse: sparse: cast to restricted __be32
>> drivers/platform/apple/smc_core.c:210:26: sparse: sparse: cast to restricted __be32
>> drivers/platform/apple/smc_core.c:210:26: sparse: sparse: cast to restricted __be32
>> drivers/platform/apple/smc_core.c:210:26: sparse: sparse: cast to restricted __be32
vim +210 drivers/platform/apple/smc_core.c
190
191 struct apple_smc *apple_smc_probe(struct device *dev, const struct apple_smc_backend_ops *ops, void *cookie)
192 {
193 struct apple_smc *smc;
194 u32 count;
195 int ret;
196
197 smc = devm_kzalloc(dev, sizeof(*smc), GFP_KERNEL);
198 if (!smc)
199 return ERR_PTR(-ENOMEM);
200
201 smc->dev = dev;
202 smc->be_cookie = cookie;
203 smc->be = ops;
204 mutex_init(&smc->mutex);
205 BLOCKING_INIT_NOTIFIER_HEAD(&smc->event_handlers);
206
207 ret = apple_smc_read_u32(smc, SMC_KEY(#KEY), &count);
208 if (ret)
209 return ERR_PTR(dev_err_probe(dev, ret, "Failed to get key count"));
> 210 smc->key_count = be32_to_cpu(count);
211
212 ret = apple_smc_get_key_by_index(smc, 0, &smc->first_key);
213 if (ret)
214 return ERR_PTR(dev_err_probe(dev, ret, "Failed to get first key"));
215
216 ret = apple_smc_get_key_by_index(smc, smc->key_count - 1, &smc->last_key);
217 if (ret)
218 return ERR_PTR(dev_err_probe(dev, ret, "Failed to get last key"));
219
220 /* Enable notifications */
221 apple_smc_write_flag(smc, SMC_KEY(NTAP), 1);
222
223 dev_info(dev, "Initialized (%d keys %p4ch..%p4ch)\n",
224 smc->key_count, &smc->first_key, &smc->last_key);
225
226 dev_set_drvdata(dev, smc);
227
228 ret = mfd_add_devices(dev, -1, apple_smc_devs, ARRAY_SIZE(apple_smc_devs), NULL, 0, NULL);
229 if (ret)
230 return ERR_PTR(dev_err_probe(dev, ret, "Subdevice initialization failed"));
231
232 return smc;
233 }
234 EXPORT_SYMBOL(apple_smc_probe);
235
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (180760 bytes)
Powered by blists - more mailing lists