]> git.baikalelectronics.ru Git - kernel.git/commit
dma-mapping: benchmark: use u8 for reserved field in uAPI structure
authorBarry Song <song.bao.hua@hisilicon.com>
Fri, 5 Feb 2021 11:33:24 +0000 (00:33 +1300)
committerChristoph Hellwig <hch@lst.de>
Fri, 5 Feb 2021 11:48:46 +0000 (12:48 +0100)
commitc218446989d36e3af3f6868389f46aae83f7fd14
treed0132b5941b1c52dd825126eb3f6bda1fcfc02d0
parent98bf6d5d12ef1b895bf72750fe6a44a87f5a83c8
dma-mapping: benchmark: use u8 for reserved field in uAPI structure

The original code put five u32 before a u64 expansion[10] array. Five is
odd, this will cause trouble in the extension of the structure by adding
new features. This patch moves to use u8 for reserved field to avoid
future alignment risk.
Meanwhile, it also clears the memory of struct map_benchmark in tools,
otherwise, if users use old version to run on newer kernel, the random
expansion value will cause side effect on newer kernel.

Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
kernel/dma/map_benchmark.c
tools/testing/selftests/dma/dma_map_benchmark.c