]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: mpi3mr: Clean up mpi3mr_print_ioc_info()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 16 Sep 2021 13:26:05 +0000 (16:26 +0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 5 Oct 2021 03:51:14 +0000 (23:51 -0400)
commit79ef0b9c5dde143d2a52ef0dfaac9b79d947d7d2
tree663384aadb2b0f34ec1ca5131f99e1334a017498
parent05e7d8757da6ef16745f6b63277ee9f3191b9ad3
scsi: mpi3mr: Clean up mpi3mr_print_ioc_info()

This function is more complicated than necessary.

If we change from scnprintf() to snprintf() that lets us remove the if
bytes_wrote < sizeof(protocol) checks.  Also, we can use bytes_wrote ? ","
: "" to print the comma and remove the separate if statement and the
"is_string_nonempty" variable.

[mkp: a few formatting cleanups and s/wrote/written/]

Link: https://lore.kernel.org/r/20210916132605.GF25094@kili
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpi3mr/mpi3mr_fw.c