Commit 16238355 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Martin K. Petersen

scsi: scsi_debugfs: Use for_each_set_bit to simplify code

We can use for_each_set_bit() to slightly simplify the code.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 56cc8fae
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include <linux/bitops.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <scsi/scsi_cmnd.h> #include <scsi/scsi_cmnd.h>
#include <scsi/scsi_dbg.h> #include <scsi/scsi_dbg.h>
...@@ -18,9 +19,7 @@ static int scsi_flags_show(struct seq_file *m, const unsigned long flags, ...@@ -18,9 +19,7 @@ static int scsi_flags_show(struct seq_file *m, const unsigned long flags,
bool sep = false; bool sep = false;
int i; int i;
for (i = 0; i < sizeof(flags) * BITS_PER_BYTE; i++) { for_each_set_bit(i, &flags, BITS_PER_LONG) {
if (!(flags & BIT(i)))
continue;
if (sep) if (sep)
seq_puts(m, "|"); seq_puts(m, "|");
sep = true; sep = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment