Ref: drivers/scsi/scsi_scan.c scsi_add_lun()
Ie, fixed-width 16 bytes, assumed to be filled with spaces -- NOT
null-terminated; comments suggest that in some cases this field can be
truncated and filled with nulls but printf is fine with that.
The old code did read up to 64 characters, which produced garbage for
at least some USB-attached card readers. It also special-cased '`'
character which the kernel does not.
Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
io_hdr.timeout = 1000;
if (!ioctl(fd, SG_IO, &io_hdr)) {
- int i = 16;
-
- MSG(0, "Info: [%s] Disk Model: ",
- dev->path);
- while (reply_buffer[i] != '`' && i < 80)
- printf("%c", reply_buffer[i++]);
- printf("\n");
+ MSG(0, "Info: [%s] Disk Model: %.16s\n",
+ dev->path, reply_buffer+16);
}
#endif
} else {