summaryrefslogtreecommitdiff
path: root/extras/scsi_id/scsi_serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'extras/scsi_id/scsi_serial.c')
-rw-r--r--extras/scsi_id/scsi_serial.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/extras/scsi_id/scsi_serial.c b/extras/scsi_id/scsi_serial.c
index c84f41e043..28e82db3ca 100644
--- a/extras/scsi_id/scsi_serial.c
+++ b/extras/scsi_id/scsi_serial.c
@@ -179,7 +179,7 @@ static int scsi_dump_sense(struct sysfs_device *dev_scsi, struct sg_io_hdr *io)
sb_len = io->sb_len_wr;
if (sb_len < 1) {
- info("%s: sense buffer empty", dev_scsi->kernel);
+ info("%s: sense buffer empty\n", dev_scsi->kernel);
return -1;
}
@@ -193,7 +193,7 @@ static int scsi_dump_sense(struct sysfs_device *dev_scsi, struct sg_io_hdr *io)
*/
s = sense_buffer[7] + 8;
if (sb_len < s) {
- info("%s: sense buffer too small %d bytes, %d bytes too short",
+ info("%s: sense buffer too small %d bytes, %d bytes too short\n",
dev_scsi->kernel, sb_len, s - sb_len);
return -1;
}
@@ -204,7 +204,7 @@ static int scsi_dump_sense(struct sysfs_device *dev_scsi, struct sg_io_hdr *io)
/*
* Possible?
*/
- info("%s: sense result too" " small %d bytes",
+ info("%s: sense result too" " small %d bytes\n",
dev_scsi->kernel, s);
return -1;
}
@@ -216,25 +216,25 @@ static int scsi_dump_sense(struct sysfs_device *dev_scsi, struct sg_io_hdr *io)
asc = sense_buffer[2];
ascq = sense_buffer[3];
} else {
- info("%s: invalid sense code 0x%x",
+ info("%s: invalid sense code 0x%x\n",
dev_scsi->kernel, code);
return -1;
}
- info("%s: sense key 0x%x ASC 0x%x ASCQ 0x%x",
+ info("%s: sense key 0x%x ASC 0x%x ASCQ 0x%x\n",
dev_scsi->kernel, sense_key, asc, ascq);
} else {
if (sb_len < 4) {
- info("%s: sense buffer too small %d bytes, %d bytes too short",
+ info("%s: sense buffer too small %d bytes, %d bytes too short\n",
dev_scsi->kernel, sb_len, 4 - sb_len);
return -1;
}
if (sense_buffer[0] < 15)
- info("%s: old sense key: 0x%x", dev_scsi->kernel, sense_buffer[0] & 0x0f);
+ info("%s: old sense key: 0x%x\n", dev_scsi->kernel, sense_buffer[0] & 0x0f);
else
- info("%s: sense = %2x %2x",
+ info("%s: sense = %2x %2x\n",
dev_scsi->kernel, sense_buffer[0], sense_buffer[2]);
- info("%s: non-extended sense class %d code 0x%0x",
+ info("%s: non-extended sense class %d code 0x%0x\n",
dev_scsi->kernel, sense_class, code);
}
@@ -247,8 +247,8 @@ static int scsi_dump_sense(struct sysfs_device *dev_scsi, struct sg_io_hdr *io)
out_buffer[j++] = ' ';
}
out_buffer[j] = '\0';
- info("%s: sense dump:", dev_scsi->kernel);
- info("%s: %s", dev_scsi->kernel, out_buffer);
+ info("%s: sense dump:\n", dev_scsi->kernel);
+ info("%s: %s\n", dev_scsi->kernel, out_buffer);
#endif
return -1;
@@ -261,11 +261,11 @@ static int scsi_dump(struct sysfs_device *dev_scsi, struct sg_io_hdr *io)
/*
* Impossible, should not be called.
*/
- info("%s: called with no error", __FUNCTION__);
+ info("%s: called with no error\n", __FUNCTION__);
return -1;
}
- info("%s: sg_io failed status 0x%x 0x%x 0x%x 0x%x",
+ info("%s: sg_io failed status 0x%x 0x%x 0x%x 0x%x\n",
dev_scsi->kernel, io->driver_status, io->host_status, io->msg_status, io->status);
if (io->status == SCSI_CHECK_CONDITION)
return scsi_dump_sense(dev_scsi, io);
@@ -285,7 +285,7 @@ static int scsi_inquiry(struct sysfs_device *dev_scsi, int fd,
int retry = 3; /* rather random */
if (buflen > SCSI_INQ_BUFF_LEN) {
- info("buflen %d too long", buflen);
+ info("buflen %d too long\n", buflen);
return -1;
}
@@ -304,7 +304,7 @@ resend:
io_hdr.timeout = DEF_TIMEOUT;
if (ioctl(fd, SG_IO, &io_hdr) < 0) {
- info("%s: ioctl failed: %s", dev_scsi->kernel, strerror(errno));
+ info("%s: ioctl failed: %s\n", dev_scsi->kernel, strerror(errno));
retval = -1;
goto error;
}
@@ -336,7 +336,7 @@ resend:
error:
if (retval < 0)
- info("%s: Unable to get INQUIRY vpd %d page 0x%x.",
+ info("%s: Unable to get INQUIRY vpd %d page 0x%x.\n",
dev_scsi->kernel, evpd, page);
return retval;
@@ -355,11 +355,11 @@ static int do_scsi_page0_inquiry(struct sysfs_device *dev_scsi, int fd,
return 1;
if (buffer[1] != 0) {
- info("%s: page 0 not available.", dev_scsi->kernel);
+ info("%s: page 0 not available.\n", dev_scsi->kernel);
return 1;
}
if (buffer[3] > len) {
- info("%s: page 0 buffer too long %d", dev_scsi->kernel, buffer[3]);
+ info("%s: page 0 buffer too long %d\n", dev_scsi->kernel, buffer[3]);
return 1;
}
@@ -377,11 +377,11 @@ static int do_scsi_page0_inquiry(struct sysfs_device *dev_scsi, int fd,
*/
vendor = sysfs_attr_get_value(dev_scsi->devpath, "vendor");
if (!vendor) {
- info("%s: cannot get model attribute", dev_scsi->kernel);
+ info("%s: cannot get model attribute\n", dev_scsi->kernel);
return 1;
}
if (!strncmp((char *)&buffer[VENDOR_LENGTH], vendor, VENDOR_LENGTH)) {
- info("%s: invalid page0 data", dev_scsi->kernel);
+ info("%s: invalid page0 data\n", dev_scsi->kernel);
return 1;
}
}
@@ -399,7 +399,7 @@ static int prepend_vendor_model(struct sysfs_device *dev_scsi, char *serial)
attr = sysfs_attr_get_value(dev_scsi->devpath, "vendor");
if (!attr) {
- info("%s: cannot get vendor attribute", dev_scsi->kernel);
+ info("%s: cannot get vendor attribute\n", dev_scsi->kernel);
return 1;
}
strncpy(serial, attr, VENDOR_LENGTH);
@@ -407,7 +407,7 @@ static int prepend_vendor_model(struct sysfs_device *dev_scsi, char *serial)
attr = sysfs_attr_get_value(dev_scsi->devpath, "model");
if (!attr) {
- info("%s: cannot get model attribute", dev_scsi->kernel);
+ info("%s: cannot get model attribute\n", dev_scsi->kernel);
return 1;
}
strncat(serial, attr, MODEL_LENGTH);
@@ -419,7 +419,7 @@ static int prepend_vendor_model(struct sysfs_device *dev_scsi, char *serial)
* above, ind will never be too large.
*/
if (ind != (VENDOR_LENGTH + MODEL_LENGTH)) {
- info("%s: expected length %d, got length %d",
+ info("%s: expected length %d, got length %d\n",
dev_scsi->kernel, (VENDOR_LENGTH + MODEL_LENGTH), ind);
return 1;
}
@@ -477,7 +477,7 @@ static int check_fill_0x83_id(struct sysfs_device *dev_scsi,
len += VENDOR_LENGTH + MODEL_LENGTH;
if (max_len < len) {
- info("%s: length %d too short - need %d",
+ info("%s: length %d too short - need %d\n",
dev_scsi->kernel, max_len, len);
return 1;
}
@@ -528,7 +528,7 @@ static int check_fill_0x83_prespc3(struct sysfs_device *dev_scsi,
{
int i, j;
- dbg("using pre-spc3-83 for %s.\n", dev_scsi->kernel);
+ dbg("using pre-spc3-83 for %s\n", dev_scsi->kernel);
serial[0] = hex_str[id_search->id_type];
/* serial has been memset to zero before */
j = strlen(serial); /* j = 1; */
@@ -557,7 +557,7 @@ static int do_scsi_page83_inquiry(struct sysfs_device *dev_scsi, int fd,
return 1;
if (page_83[1] != PAGE_83) {
- info("%s: Invalid page 0x83", dev_scsi->kernel);
+ info("%s: Invalid page 0x83\n", dev_scsi->kernel);
return 1;
}
@@ -613,13 +613,13 @@ static int do_scsi_page83_inquiry(struct sysfs_device *dev_scsi, int fd,
id_search_list[id_ind].naa_type,
id_search_list[id_ind].code_set);
if (!retval) {
- dbg(" used\n");
+ dbg(" used\n");
return retval;
} else if (retval < 0) {
- dbg(" failed\n");
+ dbg(" failed\n");
return retval;
} else {
- dbg(" not used\n");
+ dbg(" not used\n");
}
}
}
@@ -646,7 +646,7 @@ static int do_scsi_page83_prespc3_inquiry(struct sysfs_device *dev_scsi, int fd,
return 1;
if (page_83[1] != PAGE_83) {
- info("%s: Invalid page 0x83", dev_scsi->kernel);
+ info("%s: Invalid page 0x83\n", dev_scsi->kernel);
return 1;
}
/*
@@ -690,7 +690,7 @@ static int do_scsi_page83_prespc3_inquiry(struct sysfs_device *dev_scsi, int fd,
serial[j++] = hex_str[page_83[i] & 0x0f];
i++;
}
- dbg("using pre-spc3-83 for %s.\n", dev_scsi->kernel);
+ dbg("using pre-spc3-83 for %s\n", dev_scsi->kernel);
return 0;
}
@@ -710,13 +710,13 @@ static int do_scsi_page80_inquiry(struct sysfs_device *dev_scsi, int fd,
return retval;
if (buf[1] != PAGE_80) {
- info("%s: Invalid page 0x80", dev_scsi->kernel);
+ info("%s: Invalid page 0x80\n", dev_scsi->kernel);
return 1;
}
len = 1 + VENDOR_LENGTH + MODEL_LENGTH + buf[3];
if (max_len < len) {
- info("%s: length %d too short - need %d",
+ info("%s: length %d too short - need %d\n",
dev_scsi->kernel, max_len, len);
return 1;
}
@@ -746,7 +746,7 @@ int scsi_std_inquiry(struct sysfs_device *dev_scsi, const char *devname,
dbg("opening %s\n", devname);
fd = open(devname, O_RDONLY | O_NONBLOCK);
if (fd < 0) {
- info("%s: cannot open %s: %s",
+ info("%s: cannot open %s: %s\n",
dev_scsi->kernel, devname, strerror(errno));
return 1;
}
@@ -762,7 +762,7 @@ int scsi_std_inquiry(struct sysfs_device *dev_scsi, const char *devname,
sprintf(type,"%x", buf[0] & 0x1f);
if (close(fd) < 0)
- info("%s: close failed: %s", dev_scsi->kernel, strerror(errno));
+ info("%s: close failed: %s\n", dev_scsi->kernel, strerror(errno));
return 0;
}
@@ -779,7 +779,7 @@ int scsi_get_serial (struct sysfs_device *dev_scsi, const char *devname,
dbg("opening %s\n", devname);
fd = open(devname, O_RDONLY | O_NONBLOCK);
if (fd < 0) {
- info("%s: cannot open %s: %s",
+ info("%s: cannot open %s: %s\n",
dev_scsi->kernel, devname, strerror(errno));
return 1;
}
@@ -826,7 +826,7 @@ int scsi_get_serial (struct sysfs_device *dev_scsi, const char *devname,
goto completed;
}
} else if (page_code != 0x00) {
- info("%s: unsupported page code 0x%d", dev_scsi->kernel, page_code);
+ info("%s: unsupported page code 0x%d\n", dev_scsi->kernel, page_code);
return 1;
}
@@ -870,6 +870,6 @@ int scsi_get_serial (struct sysfs_device *dev_scsi, const char *devname,
retval = 1;
completed:
if (close(fd) < 0)
- info("%s: close failed: %s", dev_scsi->kernel, strerror(errno));
+ info("%s: close failed: %s\n", dev_scsi->kernel, strerror(errno));
return retval;
}