Skip to content

Commit

Permalink
rds: ib: force endiannes annotation
Browse files Browse the repository at this point in the history
While the endiannes is being handled correctly as indicated by the comment
above the offending line - sparse was unhappy with the missing annotation
as be64_to_cpu() expects a __be64 argument. To mitigate this annotation
all involved variables are changed to a consistent __le64 and the
 conversion to uint64_t delayed to the call to rds_cong_map_updated().

Signed-off-by: Nicholas Mc Guire <[email protected]>
Acked-by: Santosh Shilimkar <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Nicholas Mc Guire authored and davem330 committed May 1, 2019
1 parent f68d7c4 commit f350574
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions net/rds/ib_recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ static void rds_ib_cong_recv(struct rds_connection *conn,
unsigned long frag_off;
unsigned long to_copy;
unsigned long copied;
uint64_t uncongested = 0;
__le64 uncongested = 0;
void *addr;

/* catch completely corrupt packets */
Expand All @@ -789,7 +789,7 @@ static void rds_ib_cong_recv(struct rds_connection *conn,
copied = 0;

while (copied < RDS_CONG_MAP_BYTES) {
uint64_t *src, *dst;
__le64 *src, *dst;
unsigned int k;

to_copy = min(RDS_FRAG_SIZE - frag_off, PAGE_SIZE - map_off);
Expand Down Expand Up @@ -824,9 +824,7 @@ static void rds_ib_cong_recv(struct rds_connection *conn,
}

/* the congestion map is in little endian order */
uncongested = le64_to_cpu(uncongested);

rds_cong_map_updated(map, uncongested);
rds_cong_map_updated(map, le64_to_cpu(uncongested));
}

static void rds_ib_process_recv(struct rds_connection *conn,
Expand Down

0 comments on commit f350574

Please sign in to comment.