lkml.org 
[lkml]   [2021]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 3/4] drivers/acpi: Introduce Platform Firmware Runtime Update Telemetry
Hi Chen,

I love your patch! Perhaps something to improve:

[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on efi/next linus/master v5.15-rc6 next-20211020]
[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]

url: https://github.com/0day-ci/linux/commits/Chen-Yu/Introduce-Platform-Firmware-Runtime-Update-and-Telemetry-drivers/20211016-184349
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: x86_64-randconfig-c007-20211021 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 3cea2505fd8d99a9ba0cb625aecfe28a47c4e3f8)
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/0day-ci/linux/commit/93acf331ef196b860f6b34a5e9f8b3a249f1a0ce
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Chen-Yu/Introduce-Platform-Firmware-Runtime-Update-and-Telemetry-drivers/20211016-184349
git checkout 93acf331ef196b860f6b34a5e9f8b3a249f1a0ce
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/acpi/pfru/pfru_update.c:280:6: warning: no previous prototype for function 'pfru_log_ioctl' [-Wmissing-prototypes]
long pfru_log_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
^
drivers/acpi/pfru/pfru_update.c:280:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
long pfru_log_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
^
static
>> drivers/acpi/pfru/pfru_update.c:338:9: warning: no previous prototype for function 'pfru_log_read' [-Wmissing-prototypes]
ssize_t pfru_log_read(struct file *filp, char __user *ubuf,
^
drivers/acpi/pfru/pfru_update.c:338:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
ssize_t pfru_log_read(struct file *filp, char __user *ubuf,
^
static
2 warnings generated.


vim +/pfru_log_ioctl +280 drivers/acpi/pfru/pfru_update.c

279
> 280 long pfru_log_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
281 {
282 struct pfru_log_data_info data_info;
283 struct pfru_log_info info;
284 void __user *p;
285 int ret = 0;
286
287 if (!pfru_log_dev)
288 return -ENODEV;
289
290 p = (void __user *)arg;
291
292 switch (cmd) {
293 case PFRU_LOG_IOC_SET_INFO:
294 if (copy_from_user(&info, p, sizeof(info)))
295 return -EFAULT;
296
297 if (pfru_valid_revid(info.log_revid))
298 pfru_log_dev->info.log_revid = info.log_revid;
299
300 if (valid_log_level(info.log_level)) {
301 ret = set_pfru_log_level(info.log_level);
302 if (ret)
303 return ret;
304 pfru_log_dev->info.log_level = info.log_level;
305 }
306
307 if (valid_log_type(info.log_type))
308 pfru_log_dev->info.log_type = info.log_type;
309
310 break;
311 case PFRU_LOG_IOC_GET_INFO:
312 ret = get_pfru_log_level(&info.log_level);
313 if (ret)
314 return ret;
315
316 info.log_type = pfru_log_dev->info.log_type;
317 info.log_revid = pfru_log_dev->info.log_revid;
318 if (copy_to_user(p, &info, sizeof(info)))
319 ret = -EFAULT;
320
321 break;
322 case PFRU_LOG_IOC_GET_DATA_INFO:
323 ret = get_pfru_log_data_info(&data_info, pfru_log_dev->info.log_type);
324 if (ret)
325 return ret;
326
327 if (copy_to_user(p, &data_info, sizeof(struct pfru_log_data_info)))
328 ret = -EFAULT;
329
330 break;
331 default:
332 ret = -ENOTTY;
333 break;
334 }
335 return ret;
336 }
337
> 338 ssize_t pfru_log_read(struct file *filp, char __user *ubuf,
339 size_t size, loff_t *off)
340 {
341 struct pfru_log_data_info info;
342 phys_addr_t base_addr;
343 int buf_size, ret;
344 char *buf_ptr;
345
346 if (!pfru_log_dev)
347 return -ENODEV;
348
349 if (*off < 0)
350 return -EINVAL;
351
352 ret = get_pfru_log_data_info(&info, pfru_log_dev->info.log_type);
353 if (ret)
354 return ret;
355
356 base_addr = (phys_addr_t)(info.chunk2_addr_lo | (info.chunk2_addr_hi << 32));
357 /* pfru update has not been launched yet.*/
358 if (!base_addr)
359 return -EBUSY;
360
361 buf_size = info.max_data_size;
362 if (*off >= buf_size)
363 return 0;
364
365 buf_ptr = memremap(base_addr, buf_size, MEMREMAP_WB);
366 if (IS_ERR(buf_ptr))
367 return PTR_ERR(buf_ptr);
368
369 size = min_t(size_t, size, buf_size - *off);
370 if (copy_to_user(ubuf, buf_ptr + *off, size))
371 ret = -EFAULT;
372 else
373 ret = 0;
374
375 memunmap(buf_ptr);
376
377 return ret ? ret : size;
378 }
379

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2021-10-21 08:39    [W:0.091 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site