diff options
author | Tejun Heo <tj@kernel.org> | 2015-02-13 17:37:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-14 00:21:38 -0500 |
commit | 125918dbd836d19b5dccc2690388b29e575f91a4 (patch) | |
tree | c8f4912388e074a6c37ec64fb74205a584b61acc /drivers/uwb | |
parent | c7badc90178b89c49e3852a002024d26cef5f070 (diff) |
usb: use %*pb[l] to print bitmaps including cpumasks and nodemasks
printk and friends can now format bitmaps using '%*pb[l]'. cpumask
and nodemask also provide cpumask_pr_args() and nodemask_pr_args()
respectively which can be used to generate the two printf arguments
necessary to format the specified cpu/nodemask.
* drivers/uwb/drp.c::uwb_drp_handle_alien_drp() was formatting mas.bm
into a buffer but never used it. Removed.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/uwb')
-rw-r--r-- | drivers/uwb/drp.c | 2 | ||||
-rw-r--r-- | drivers/uwb/uwb-debug.c | 16 |
2 files changed, 5 insertions, 13 deletions
diff --git a/drivers/uwb/drp.c b/drivers/uwb/drp.c index 05b7bd762254..8fc1b787dced 100644 --- a/drivers/uwb/drp.c +++ b/drivers/uwb/drp.c | |||
@@ -619,11 +619,9 @@ static void uwb_drp_handle_alien_drp(struct uwb_rc *rc, struct uwb_ie_drp *drp_i | |||
619 | struct device *dev = &rc->uwb_dev.dev; | 619 | struct device *dev = &rc->uwb_dev.dev; |
620 | struct uwb_mas_bm mas; | 620 | struct uwb_mas_bm mas; |
621 | struct uwb_cnflt_alien *cnflt; | 621 | struct uwb_cnflt_alien *cnflt; |
622 | char buf[72]; | ||
623 | unsigned long delay_us = UWB_MAS_LENGTH_US * UWB_MAS_PER_ZONE; | 622 | unsigned long delay_us = UWB_MAS_LENGTH_US * UWB_MAS_PER_ZONE; |
624 | 623 | ||
625 | uwb_drp_ie_to_bm(&mas, drp_ie); | 624 | uwb_drp_ie_to_bm(&mas, drp_ie); |
626 | bitmap_scnprintf(buf, sizeof(buf), mas.bm, UWB_NUM_MAS); | ||
627 | 625 | ||
628 | list_for_each_entry(cnflt, &rc->cnflt_alien_list, rc_node) { | 626 | list_for_each_entry(cnflt, &rc->cnflt_alien_list, rc_node) { |
629 | if (bitmap_equal(cnflt->mas.bm, mas.bm, UWB_NUM_MAS)) { | 627 | if (bitmap_equal(cnflt->mas.bm, mas.bm, UWB_NUM_MAS)) { |
diff --git a/drivers/uwb/uwb-debug.c b/drivers/uwb/uwb-debug.c index 6ec45beb7af5..0b1e5a9449b5 100644 --- a/drivers/uwb/uwb-debug.c +++ b/drivers/uwb/uwb-debug.c | |||
@@ -217,7 +217,6 @@ static int reservations_print(struct seq_file *s, void *p) | |||
217 | struct uwb_dev_addr devaddr; | 217 | struct uwb_dev_addr devaddr; |
218 | char owner[UWB_ADDR_STRSIZE], target[UWB_ADDR_STRSIZE]; | 218 | char owner[UWB_ADDR_STRSIZE], target[UWB_ADDR_STRSIZE]; |
219 | bool is_owner; | 219 | bool is_owner; |
220 | char buf[72]; | ||
221 | 220 | ||
222 | uwb_dev_addr_print(owner, sizeof(owner), &rsv->owner->dev_addr); | 221 | uwb_dev_addr_print(owner, sizeof(owner), &rsv->owner->dev_addr); |
223 | if (rsv->target.type == UWB_RSV_TARGET_DEV) { | 222 | if (rsv->target.type == UWB_RSV_TARGET_DEV) { |
@@ -234,8 +233,7 @@ static int reservations_print(struct seq_file *s, void *p) | |||
234 | owner, target, uwb_rsv_state_str(rsv->state)); | 233 | owner, target, uwb_rsv_state_str(rsv->state)); |
235 | seq_printf(s, " stream: %d type: %s\n", | 234 | seq_printf(s, " stream: %d type: %s\n", |
236 | rsv->stream, uwb_rsv_type_str(rsv->type)); | 235 | rsv->stream, uwb_rsv_type_str(rsv->type)); |
237 | bitmap_scnprintf(buf, sizeof(buf), rsv->mas.bm, UWB_NUM_MAS); | 236 | seq_printf(s, " %*pb\n", UWB_NUM_MAS, rsv->mas.bm); |
238 | seq_printf(s, " %s\n", buf); | ||
239 | } | 237 | } |
240 | 238 | ||
241 | mutex_unlock(&rc->rsvs_mutex); | 239 | mutex_unlock(&rc->rsvs_mutex); |
@@ -259,14 +257,10 @@ static const struct file_operations reservations_fops = { | |||
259 | static int drp_avail_print(struct seq_file *s, void *p) | 257 | static int drp_avail_print(struct seq_file *s, void *p) |
260 | { | 258 | { |
261 | struct uwb_rc *rc = s->private; | 259 | struct uwb_rc *rc = s->private; |
262 | char buf[72]; | 260 | |
263 | 261 | seq_printf(s, "global: %*pb\n", UWB_NUM_MAS, rc->drp_avail.global); | |
264 | bitmap_scnprintf(buf, sizeof(buf), rc->drp_avail.global, UWB_NUM_MAS); | 262 | seq_printf(s, "local: %*pb\n", UWB_NUM_MAS, rc->drp_avail.local); |
265 | seq_printf(s, "global: %s\n", buf); | 263 | seq_printf(s, "pending: %*pb\n", UWB_NUM_MAS, rc->drp_avail.pending); |
266 | bitmap_scnprintf(buf, sizeof(buf), rc->drp_avail.local, UWB_NUM_MAS); | ||
267 | seq_printf(s, "local: %s\n", buf); | ||
268 | bitmap_scnprintf(buf, sizeof(buf), rc->drp_avail.pending, UWB_NUM_MAS); | ||
269 | seq_printf(s, "pending: %s\n", buf); | ||
270 | 264 | ||
271 | return 0; | 265 | return 0; |
272 | } | 266 | } |