IB/srpt: Convert use of __constant_cpu_to_beXX to cpu_to_beXX
authorVaishali Thakkar <vthakkar1994@gmail.com>
Wed, 24 Jun 2015 04:42:13 +0000 (10:12 +0530)
committerDoug Ledford <dledford@redhat.com>
Tue, 14 Jul 2015 17:20:09 +0000 (13:20 -0400)
commitb356c1c1f90a347b6f67d9272dda7ecf47e0b46c
tree3de425b80bc6a68d7924ca01ac385462733e34a5
parent3b8ab700af0a5c5e59c833f8a88f94b97499f5e5
IB/srpt: Convert use of __constant_cpu_to_beXX to cpu_to_beXX

In little endian cases, the macro cpu_to_be{16,32,64} unfolds to
__swab{16,32,64} which provides special case for constants. In
big endian cases, __constant_cpu_to_be{16,32,64} and
cpu_to_be{16,32,64} expand directly to the same expression. So,
replace __constant_cpu_to_be{16,32,64} with cpu_to_be{16,32,64}
with the goal of getting rid of the definitions of
__constant_cpu_to_be{16,32,64} completely.

The Coccinelle semantic patch that performs this transformation
is as follows:

@@expression x;@@

(
- __constant_cpu_to_be16(x)
+ cpu_to_be16(x)
|
- __constant_cpu_to_be32(x)
+ cpu_to_be32(x)
|
- __constant_cpu_to_be64(x)
+ cpu_to_be64(x)
)

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/ulp/srpt/ib_srpt.c