On Fri, 2018-04-20 at 14:57 +0800, Ming Lei wrote:
>  show_host_busy(struct device *dev, struct device_attribute *attr, char *buf)
>  {
>       struct Scsi_Host *shost = class_to_shost(dev);
> -     return snprintf(buf, 20, "%d\n", atomic_read(&shost->host_busy));
> +     return snprintf(buf, 20, "%d\n", scsi_host_busy(shost));
>  }
>  static DEVICE_ATTR(host_busy, S_IRUGO, show_host_busy, NULL);

The ", 20" part is cargo-cult programming. Since you have to touch this code,
please either use "sprintf(buf, ...)" or use "scnprintf(buf, PAGE_SIZE, ...)".

Thanks,

Bart.



Reply via email to