On 8/17/23 5:46 PM, Anh Tuan Phan wrote:
Use the macro version of swap function and move its definition to bpf_util.h since it is repetitive in some files. This commit also fixes a warning from coccinelle: - ./samples/bpf/xdp_sample_user.c:1493:8-9: WARNING opportunity for swap() - ./samples/bpf/xdp_rxq_info_user.c:435:8-9: WARNING opportunity for swap() Signed-off-by: Anh Tuan Phan <tuananhlfc@xxxxxxxxx>
I don't think it really improves anything. If a user takes this sample, he/she now needs to figure out that the swap implementation is actually somewhere hidden deep in tools/testing/selftests/bpf/bpf_util.h to ensure/audit that there's nothing special about it. Thanks, Daniel