Commit 04b31c77 authored by Akinobu Mita's avatar Akinobu Mita Committed by Greg Kroah-Hartman

usb: isp1362-hcd: use bitmap_clear() and bitmap_set()

Use bitmap_set()/bitmap_clear() to fill/zero a region of a bitmap
instead of doing set_bit()/clear_bit() each bit.
Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5c8d61bf
...@@ -226,7 +226,6 @@ static int claim_ptd_buffers(struct isp1362_ep_queue *epq, ...@@ -226,7 +226,6 @@ static int claim_ptd_buffers(struct isp1362_ep_queue *epq,
static inline void release_ptd_buffers(struct isp1362_ep_queue *epq, struct isp1362_ep *ep) static inline void release_ptd_buffers(struct isp1362_ep_queue *epq, struct isp1362_ep *ep)
{ {
int index = ep->ptd_index;
int last = ep->ptd_index + ep->num_ptds; int last = ep->ptd_index + ep->num_ptds;
if (last > epq->buf_count) if (last > epq->buf_count)
...@@ -236,10 +235,8 @@ static inline void release_ptd_buffers(struct isp1362_ep_queue *epq, struct isp1 ...@@ -236,10 +235,8 @@ static inline void release_ptd_buffers(struct isp1362_ep_queue *epq, struct isp1
epq->buf_map, epq->skip_map); epq->buf_map, epq->skip_map);
BUG_ON(last > epq->buf_count); BUG_ON(last > epq->buf_count);
for (; index < last; index++) { bitmap_clear(&epq->buf_map, ep->ptd_index, ep->num_ptds);
__clear_bit(index, &epq->buf_map); bitmap_set(&epq->skip_map, ep->ptd_index, ep->num_ptds);
__set_bit(index, &epq->skip_map);
}
epq->buf_avail += ep->num_ptds; epq->buf_avail += ep->num_ptds;
epq->ptd_count--; epq->ptd_count--;
......
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