drivers/scsi/mpi3mr/mpi3mr_app.c:3277:8-16: WARNING: please use sysfs_emit or sysfs_emit_at

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild
Message-ID <[email protected]>
BCC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Ranjan Kumar <[email protected]>
CC: "Martin K. Petersen" <[email protected]>
CC: Salomon Dushimirimana <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   af5e34a41cd607c00ef752e00331736570992354
commit: ec54b348f274fdd2bd32bbe74de6d62ae1a10a18 scsi: mpi3mr: Record and report controller firmware faults
date:   6 months ago
:::::: branch date: 4 hours ago
:::::: commit date: 6 months ago
config: powerpc64-randconfig-r064-20260716 (https://download.01.org/0day-ci/archive/20260718/[email protected]/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project b3e6e6dabdc02153552a64fc74ff5c7532447eed)

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
| Fixes: ec54b348f274 ("scsi: mpi3mr: Record and report controller firmware faults")
| Reported-by: kernel test robot <[email protected]>
| Reported-by: Julia Lawall <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

cocci warnings: (new ones prefixed by >>)
>> drivers/scsi/mpi3mr/mpi3mr_app.c:3277:8-16: WARNING: please use sysfs_emit or sysfs_emit_at

vim +3277 drivers/scsi/mpi3mr/mpi3mr_app.c

986d6bad2103fb Sumit Saxena 2022-04-29  3257  
ec54b348f274fd Ranjan Kumar 2026-01-16  3258  /**
ec54b348f274fd Ranjan Kumar 2026-01-16  3259   * fwfault_count_show() - SysFS callback to show firmware fault count
ec54b348f274fd Ranjan Kumar 2026-01-16  3260   * @dev: class device
ec54b348f274fd Ranjan Kumar 2026-01-16  3261   * @attr: Device attribute
ec54b348f274fd Ranjan Kumar 2026-01-16  3262   * @buf: Buffer to copy data into
ec54b348f274fd Ranjan Kumar 2026-01-16  3263   *
ec54b348f274fd Ranjan Kumar 2026-01-16  3264   * Displays the total number of firmware faults detected by the driver
ec54b348f274fd Ranjan Kumar 2026-01-16  3265   * since the controller was initialized.
ec54b348f274fd Ranjan Kumar 2026-01-16  3266   *
ec54b348f274fd Ranjan Kumar 2026-01-16  3267   * Return: Number of bytes written to @buf
ec54b348f274fd Ranjan Kumar 2026-01-16  3268   */
ec54b348f274fd Ranjan Kumar 2026-01-16  3269  
ec54b348f274fd Ranjan Kumar 2026-01-16  3270  static ssize_t
ec54b348f274fd Ranjan Kumar 2026-01-16  3271  fwfault_count_show(struct device *dev, struct device_attribute *attr,
ec54b348f274fd Ranjan Kumar 2026-01-16  3272  	char *buf)
ec54b348f274fd Ranjan Kumar 2026-01-16  3273  {
ec54b348f274fd Ranjan Kumar 2026-01-16  3274  	struct Scsi_Host *shost = class_to_shost(dev);
ec54b348f274fd Ranjan Kumar 2026-01-16  3275  	struct mpi3mr_ioc *mrioc = shost_priv(shost);
ec54b348f274fd Ranjan Kumar 2026-01-16  3276  
ec54b348f274fd Ranjan Kumar 2026-01-16 @3277  	return snprintf(buf, PAGE_SIZE, "%llu\n", mrioc->fwfault_counter);
ec54b348f274fd Ranjan Kumar 2026-01-16  3278  }
ec54b348f274fd Ranjan Kumar 2026-01-16  3279  static DEVICE_ATTR_RO(fwfault_count);
ec54b348f274fd Ranjan Kumar 2026-01-16  3280  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.