mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
libceph: use swap() macro instead of taking tmp variable
Fix the following coccicheck warning: net/ceph/crush/mapper.c:1077:8-9: WARNING opportunity for swap() by using swap() for the swapping of variable values and drop the tmp variable that is not needed any more. Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com> Reviewed-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
committed by
Ilya Dryomov
parent
261998c300
commit
d9d58f0402
@@ -906,7 +906,6 @@ int crush_do_rule(const struct crush_map *map,
|
||||
int recurse_to_leaf;
|
||||
int wsize = 0;
|
||||
int osize;
|
||||
int *tmp;
|
||||
const struct crush_rule *rule;
|
||||
__u32 step;
|
||||
int i, j;
|
||||
@@ -1073,9 +1072,7 @@ int crush_do_rule(const struct crush_map *map,
|
||||
memcpy(o, c, osize*sizeof(*o));
|
||||
|
||||
/* swap o and w arrays */
|
||||
tmp = o;
|
||||
o = w;
|
||||
w = tmp;
|
||||
swap(o, w);
|
||||
wsize = osize;
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user