mirror of https://gitee.com/openkylin/linux.git
scsi_logging: return void for dev_printk() functions
dev_printk() is now a void function, so the related functions scmd_printk() and sdev_prefix_printk() should be made void, too. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Hannes Reinecke <hare@suse.de> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
This commit is contained in:
parent
f50332ff25
commit
9c4a6b1e42
|
@ -93,20 +93,19 @@ static size_t sdev_format_header(char *logbuf, size_t logbuf_len,
|
||||||
return off;
|
return off;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sdev_prefix_printk(const char *level, const struct scsi_device *sdev,
|
void sdev_prefix_printk(const char *level, const struct scsi_device *sdev,
|
||||||
const char *name, const char *fmt, ...)
|
const char *name, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
char *logbuf;
|
char *logbuf;
|
||||||
size_t off = 0, logbuf_len;
|
size_t off = 0, logbuf_len;
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (!sdev)
|
if (!sdev)
|
||||||
return 0;
|
return;
|
||||||
|
|
||||||
logbuf = scsi_log_reserve_buffer(&logbuf_len);
|
logbuf = scsi_log_reserve_buffer(&logbuf_len);
|
||||||
if (!logbuf)
|
if (!logbuf)
|
||||||
return 0;
|
return;
|
||||||
|
|
||||||
if (name)
|
if (name)
|
||||||
off += scnprintf(logbuf + off, logbuf_len - off,
|
off += scnprintf(logbuf + off, logbuf_len - off,
|
||||||
|
@ -116,26 +115,24 @@ int sdev_prefix_printk(const char *level, const struct scsi_device *sdev,
|
||||||
off += vscnprintf(logbuf + off, logbuf_len - off, fmt, args);
|
off += vscnprintf(logbuf + off, logbuf_len - off, fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
ret = dev_printk(level, &sdev->sdev_gendev, "%s", logbuf);
|
dev_printk(level, &sdev->sdev_gendev, "%s", logbuf);
|
||||||
scsi_log_release_buffer(logbuf);
|
scsi_log_release_buffer(logbuf);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(sdev_prefix_printk);
|
EXPORT_SYMBOL(sdev_prefix_printk);
|
||||||
|
|
||||||
int scmd_printk(const char *level, const struct scsi_cmnd *scmd,
|
void scmd_printk(const char *level, const struct scsi_cmnd *scmd,
|
||||||
const char *fmt, ...)
|
const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
char *logbuf;
|
char *logbuf;
|
||||||
size_t off = 0, logbuf_len;
|
size_t off = 0, logbuf_len;
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (!scmd || !scmd->cmnd)
|
if (!scmd || !scmd->cmnd)
|
||||||
return 0;
|
return;
|
||||||
|
|
||||||
logbuf = scsi_log_reserve_buffer(&logbuf_len);
|
logbuf = scsi_log_reserve_buffer(&logbuf_len);
|
||||||
if (!logbuf)
|
if (!logbuf)
|
||||||
return 0;
|
return;
|
||||||
off = sdev_format_header(logbuf, logbuf_len, scmd_name(scmd),
|
off = sdev_format_header(logbuf, logbuf_len, scmd_name(scmd),
|
||||||
scmd->request->tag);
|
scmd->request->tag);
|
||||||
if (off < logbuf_len) {
|
if (off < logbuf_len) {
|
||||||
|
@ -143,9 +140,8 @@ int scmd_printk(const char *level, const struct scsi_cmnd *scmd,
|
||||||
off += vscnprintf(logbuf + off, logbuf_len - off, fmt, args);
|
off += vscnprintf(logbuf + off, logbuf_len - off, fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
ret = dev_printk(level, &scmd->device->sdev_gendev, "%s", logbuf);
|
dev_printk(level, &scmd->device->sdev_gendev, "%s", logbuf);
|
||||||
scsi_log_release_buffer(logbuf);
|
scsi_log_release_buffer(logbuf);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(scmd_printk);
|
EXPORT_SYMBOL(scmd_printk);
|
||||||
|
|
||||||
|
|
|
@ -237,14 +237,14 @@ struct scsi_dh_data {
|
||||||
* like scmd_printk, but the device name is passed in
|
* like scmd_printk, but the device name is passed in
|
||||||
* as a string pointer
|
* as a string pointer
|
||||||
*/
|
*/
|
||||||
__printf(4, 5) int
|
__printf(4, 5) void
|
||||||
sdev_prefix_printk(const char *, const struct scsi_device *, const char *,
|
sdev_prefix_printk(const char *, const struct scsi_device *, const char *,
|
||||||
const char *, ...);
|
const char *, ...);
|
||||||
|
|
||||||
#define sdev_printk(l, sdev, fmt, a...) \
|
#define sdev_printk(l, sdev, fmt, a...) \
|
||||||
sdev_prefix_printk(l, sdev, NULL, fmt, ##a)
|
sdev_prefix_printk(l, sdev, NULL, fmt, ##a)
|
||||||
|
|
||||||
__printf(3, 4) int
|
__printf(3, 4) void
|
||||||
scmd_printk(const char *, const struct scsi_cmnd *, const char *, ...);
|
scmd_printk(const char *, const struct scsi_cmnd *, const char *, ...);
|
||||||
|
|
||||||
#define scmd_dbg(scmd, fmt, a...) \
|
#define scmd_dbg(scmd, fmt, a...) \
|
||||||
|
|
Loading…
Reference in New Issue