On Mon, Nov 11, 2013 at 04:15:26PM -, David Laight wrote:
>
> This makes it clear that the ring->cycle_state value is used when
> writing to the actual ring itself.
>
> Always use ^= TRB_CYCLE to invert the bit.
>
> Signed-off-by: David Laight
> ---
> Changes for v2:
>
> 1 Adjusted so that it should apply to HEAD.
> (One of the ?: had been changed to ^=.)
> 2 Added Signed-off line.
All right, this is closer. However, it still contains the checkpatch.pl
warnings about lines over 80-characters:
sarah@xanatos:~/git/kernels/xhci$ git am -s ~/Maildir.fetchmail/.to-apply
Applying: usb: xhci: Use TRB_CYCLE instead of the constant 0x1
WARNING: line over 80 characters
#10: FILE: drivers/usb/host/xhci-mem.c:601:
+ xhci_ring_alloc(xhci, 2, TRB_CYCLE, TYPE_STREAM,
mem_flags);
WARNING: line over 80 characters
#19: FILE: drivers/usb/host/xhci-mem.c:909:
+ dev->eps[0].ring = xhci_ring_alloc(xhci, 2, TRB_CYCLE, TYPE_CTRL,
flags);
WARNING: line over 80 characters
#37: FILE: drivers/usb/host/xhci-mem.c:2306:
+ xhci->cmd_ring = xhci_ring_alloc(xhci, 1, TRB_CYCLE, TYPE_COMMAND,
flags);
WARNING: line over 80 characters
#46: FILE: drivers/usb/host/xhci-mem.c:2350:
+ xhci->event_ring = xhci_ring_alloc(xhci, ERST_NUM_SEGS, TRB_CYCLE,
TYPE_EVENT,
total: 0 errors, 4 warnings, 112 lines checked
Your patch has style problems, please review.
Can you please break these changed lines at 80-characters, recheck the
patch with checkpatch.pl, and resubmit?
Thanks,
Sarah Sharp
>
> drivers/usb/host/xhci-mem.c | 10 +-
> drivers/usb/host/xhci-ring.c | 16
> drivers/usb/host/xhci.c | 2 +-
> 3 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
> index 9b5d1c3..5b2d835 100644
> --- a/drivers/usb/host/xhci-mem.c
> +++ b/drivers/usb/host/xhci-mem.c
> @@ -597,7 +597,7 @@ struct xhci_stream_info *xhci_alloc_stream_info(struct
> xhci_hcd *xhci,
>*/
> for (cur_stream = 1; cur_stream < num_streams; cur_stream++) {
> stream_info->stream_rings[cur_stream] =
> - xhci_ring_alloc(xhci, 2, 1, TYPE_STREAM, mem_flags);
> + xhci_ring_alloc(xhci, 2, TRB_CYCLE, TYPE_STREAM,
> mem_flags);
> cur_ring = stream_info->stream_rings[cur_stream];
> if (!cur_ring)
> goto cleanup_rings;
> @@ -906,7 +906,7 @@ int xhci_alloc_virt_device(struct xhci_hcd *xhci, int
> slot_id,
> }
>
> /* Allocate endpoint 0 ring */
> - dev->eps[0].ring = xhci_ring_alloc(xhci, 2, 1, TYPE_CTRL, flags);
> + dev->eps[0].ring = xhci_ring_alloc(xhci, 2, TRB_CYCLE, TYPE_CTRL,
> flags);
> if (!dev->eps[0].ring)
> goto fail;
>
> @@ -1326,7 +1326,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
> type = usb_endpoint_type(&ep->desc);
> /* Set up the endpoint ring */
> virt_dev->eps[ep_index].new_ring =
> - xhci_ring_alloc(xhci, 2, 1, type, mem_flags);
> + xhci_ring_alloc(xhci, 2, TRB_CYCLE, type, mem_flags);
> if (!virt_dev->eps[ep_index].new_ring) {
> /* Attempt to use the ring cache */
> if (virt_dev->num_rings_cached == 0)
> @@ -2311,7 +2311,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
> goto fail;
>
> /* Set up the command ring to have one segments for now. */
> - xhci->cmd_ring = xhci_ring_alloc(xhci, 1, 1, TYPE_COMMAND, flags);
> + xhci->cmd_ring = xhci_ring_alloc(xhci, 1, TRB_CYCLE, TYPE_COMMAND,
> flags);
> if (!xhci->cmd_ring)
> goto fail;
> xhci_dbg_trace(xhci, trace_xhci_dbg_init,
> @@ -2355,7 +2355,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
>* the event ring segment table (ERST). Section 4.9.3.
>*/
> xhci_dbg_trace(xhci, trace_xhci_dbg_init, "// Allocating event ring");
> - xhci->event_ring = xhci_ring_alloc(xhci, ERST_NUM_SEGS, 1, TYPE_EVENT,
> + xhci->event_ring = xhci_ring_alloc(xhci, ERST_NUM_SEGS, TRB_CYCLE,
> TYPE_EVENT,
> flags);
> if (!xhci->event_ring)
> goto fail;
> diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
> index d3f4a9a..408978b 100644
> --- a/drivers/usb/host/xhci-ring.c
> +++ b/drivers/usb/host/xhci-ring.c
> @@ -178,7 +178,7 @@ static void inc_deq(struct xhci_hcd *xhci, struct
> xhci_ring *ring)
> if (ring->type == TYPE_EVENT &&
> last_trb_on_last_seg(xhci, ring,
> ring->deq_seg, ring->dequeue)) {
> - ring->cycle_state ^= 1;
> + ring->cycle_state ^= TRB_CYCLE;
> }
> ring->deq_seg = ring->deq_seg->next;
> ring->dequeue = ring->deq_se