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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Andy Shevchenko 2019-07-25 23:07:51 +03:00 committed by Martin K. Petersen
parent 56cc8fae5f
commit 1623835507
1 changed files with 2 additions and 3 deletions

View File

@ -1,4 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/bitops.h>
#include <linux/seq_file.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_dbg.h>
@ -18,9 +19,7 @@ static int scsi_flags_show(struct seq_file *m, const unsigned long flags,
bool sep = false;
int i;
for (i = 0; i < sizeof(flags) * BITS_PER_BYTE; i++) {
if (!(flags & BIT(i)))
continue;
for_each_set_bit(i, &flags, BITS_PER_LONG) {
if (sep)
seq_puts(m, "|");
sep = true;