]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/firewire/ohci.c
locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_...
[mirror_ubuntu-bionic-kernel.git] / drivers / firewire / ohci.c
index 8bf89267dc252f260a3fc6e640c0c1809f04ef2d..ccf52368a073ecf0518b946853a8f7980087d8f1 100644 (file)
@@ -734,7 +734,7 @@ static unsigned int ar_search_last_active_buffer(struct ar_context *ctx,
        __le16 res_count, next_res_count;
 
        i = ar_first_buffer_index(ctx);
-       res_count = ACCESS_ONCE(ctx->descriptors[i].res_count);
+       res_count = READ_ONCE(ctx->descriptors[i].res_count);
 
        /* A buffer that is not yet completely filled must be the last one. */
        while (i != last && res_count == 0) {
@@ -742,8 +742,7 @@ static unsigned int ar_search_last_active_buffer(struct ar_context *ctx,
                /* Peek at the next descriptor. */
                next_i = ar_next_buffer_index(i);
                rmb(); /* read descriptors in order */
-               next_res_count = ACCESS_ONCE(
-                               ctx->descriptors[next_i].res_count);
+               next_res_count = READ_ONCE(ctx->descriptors[next_i].res_count);
                /*
                 * If the next descriptor is still empty, we must stop at this
                 * descriptor.
@@ -759,8 +758,7 @@ static unsigned int ar_search_last_active_buffer(struct ar_context *ctx,
                        if (MAX_AR_PACKET_SIZE > PAGE_SIZE && i != last) {
                                next_i = ar_next_buffer_index(next_i);
                                rmb();
-                               next_res_count = ACCESS_ONCE(
-                                       ctx->descriptors[next_i].res_count);
+                               next_res_count = READ_ONCE(ctx->descriptors[next_i].res_count);
                                if (next_res_count != cpu_to_le16(PAGE_SIZE))
                                        goto next_buffer_is_active;
                        }
@@ -2812,7 +2810,7 @@ static int handle_ir_buffer_fill(struct context *context,
        u32 buffer_dma;
 
        req_count = le16_to_cpu(last->req_count);
-       res_count = le16_to_cpu(ACCESS_ONCE(last->res_count));
+       res_count = le16_to_cpu(READ_ONCE(last->res_count));
        completed = req_count - res_count;
        buffer_dma = le32_to_cpu(last->data_address);