Skip to content

Commit

Permalink
fs/dlm/debug_fs.c: replace seq_printf by seq_puts
Browse files Browse the repository at this point in the history
Replace seq_printf where possible.  This patch also fixes the following
checkpatch warning "unnecessary whitespace before a quoted newline"

Signed-off-by: Fabian Frederick <[email protected]>
Cc: Christine Caulfield <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Fabian Frederick authored and torvalds committed Jun 6, 2014
1 parent 6edb568 commit c1d4518
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions fs/dlm/debug_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static int print_format1_lock(struct seq_file *s, struct dlm_lkb *lkb,
if (lkb->lkb_wait_type)
seq_printf(s, " wait_type: %d", lkb->lkb_wait_type);

return seq_printf(s, "\n");
return seq_puts(s, "\n");
}

static int print_format1(struct dlm_rsb *res, struct seq_file *s)
Expand All @@ -92,31 +92,31 @@ static int print_format1(struct dlm_rsb *res, struct seq_file *s)
}

if (res->res_nodeid > 0)
rv = seq_printf(s, "\" \nLocal Copy, Master is node %d\n",
rv = seq_printf(s, "\"\nLocal Copy, Master is node %d\n",
res->res_nodeid);
else if (res->res_nodeid == 0)
rv = seq_printf(s, "\" \nMaster Copy\n");
rv = seq_puts(s, "\"\nMaster Copy\n");
else if (res->res_nodeid == -1)
rv = seq_printf(s, "\" \nLooking up master (lkid %x)\n",
rv = seq_printf(s, "\"\nLooking up master (lkid %x)\n",
res->res_first_lkid);
else
rv = seq_printf(s, "\" \nInvalid master %d\n",
rv = seq_printf(s, "\"\nInvalid master %d\n",
res->res_nodeid);
if (rv)
goto out;

/* Print the LVB: */
if (res->res_lvbptr) {
seq_printf(s, "LVB: ");
seq_puts(s, "LVB: ");
for (i = 0; i < lvblen; i++) {
if (i == lvblen / 2)
seq_printf(s, "\n ");
seq_puts(s, "\n ");
seq_printf(s, "%02x ",
(unsigned char) res->res_lvbptr[i]);
}
if (rsb_flag(res, RSB_VALNOTVALID))
seq_printf(s, " (INVALID)");
rv = seq_printf(s, "\n");
seq_puts(s, " (INVALID)");
rv = seq_puts(s, "\n");
if (rv)
goto out;
}
Expand All @@ -133,21 +133,21 @@ static int print_format1(struct dlm_rsb *res, struct seq_file *s)
}

/* Print the locks attached to this resource */
seq_printf(s, "Granted Queue\n");
seq_puts(s, "Granted Queue\n");
list_for_each_entry(lkb, &res->res_grantqueue, lkb_statequeue) {
rv = print_format1_lock(s, lkb, res);
if (rv)
goto out;
}

seq_printf(s, "Conversion Queue\n");
seq_puts(s, "Conversion Queue\n");
list_for_each_entry(lkb, &res->res_convertqueue, lkb_statequeue) {
rv = print_format1_lock(s, lkb, res);
if (rv)
goto out;
}

seq_printf(s, "Waiting Queue\n");
seq_puts(s, "Waiting Queue\n");
list_for_each_entry(lkb, &res->res_waitqueue, lkb_statequeue) {
rv = print_format1_lock(s, lkb, res);
if (rv)
Expand All @@ -157,13 +157,13 @@ static int print_format1(struct dlm_rsb *res, struct seq_file *s)
if (list_empty(&res->res_lookup))
goto out;

seq_printf(s, "Lookup Queue\n");
seq_puts(s, "Lookup Queue\n");
list_for_each_entry(lkb, &res->res_lookup, lkb_rsb_lookup) {
rv = seq_printf(s, "%08x %s", lkb->lkb_id,
print_lockmode(lkb->lkb_rqmode));
if (lkb->lkb_wait_type)
seq_printf(s, " wait_type: %d", lkb->lkb_wait_type);
rv = seq_printf(s, "\n");
rv = seq_puts(s, "\n");
}
out:
unlock_rsb(res);
Expand Down Expand Up @@ -300,7 +300,7 @@ static int print_format3(struct dlm_rsb *r, struct seq_file *s)
else
seq_printf(s, " %02x", (unsigned char)r->res_name[i]);
}
rv = seq_printf(s, "\n");
rv = seq_puts(s, "\n");
if (rv)
goto out;

Expand All @@ -311,7 +311,7 @@ static int print_format3(struct dlm_rsb *r, struct seq_file *s)

for (i = 0; i < lvblen; i++)
seq_printf(s, " %02x", (unsigned char)r->res_lvbptr[i]);
rv = seq_printf(s, "\n");
rv = seq_puts(s, "\n");
if (rv)
goto out;

Expand Down Expand Up @@ -377,7 +377,7 @@ static int print_format4(struct dlm_rsb *r, struct seq_file *s)
else
seq_printf(s, " %02x", (unsigned char)r->res_name[i]);
}
rv = seq_printf(s, "\n");
rv = seq_puts(s, "\n");
out:
unlock_rsb(r);
return rv;
Expand Down

0 comments on commit c1d4518

Please sign in to comment.