Skip to content

Commit ff92acb

Browse files
committed
Merge tag 'dma-mapping-5.11-2' of git://git.infradead.org/users/hch/dma-mapping
Pull dma-mapping fix from Christoph Hellwig: "Fix a 32 vs 64-bit padding issue in the new benchmark code (Barry Song)" * tag 'dma-mapping-5.11-2' of git://git.infradead.org/users/hch/dma-mapping: dma-mapping: benchmark: use u8 for reserved field in uAPI structure
2 parents fc6c0ae + 9f5f8ec commit ff92acb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

kernel/dma/map_benchmark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct map_benchmark {
3636
__s32 node; /* which numa node this benchmark will run on */
3737
__u32 dma_bits; /* DMA addressing capability */
3838
__u32 dma_dir; /* DMA data direction */
39-
__u64 expansion[10]; /* For future use */
39+
__u8 expansion[84]; /* For future use */
4040
};
4141

4242
struct map_benchmark_data {

tools/testing/selftests/dma/dma_map_benchmark.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <fcntl.h>
77
#include <stdio.h>
88
#include <stdlib.h>
9+
#include <string.h>
910
#include <unistd.h>
1011
#include <sys/ioctl.h>
1112
#include <sys/mman.h>
@@ -35,7 +36,7 @@ struct map_benchmark {
3536
__s32 node; /* which numa node this benchmark will run on */
3637
__u32 dma_bits; /* DMA addressing capability */
3738
__u32 dma_dir; /* DMA data direction */
38-
__u64 expansion[10]; /* For future use */
39+
__u8 expansion[84]; /* For future use */
3940
};
4041

4142
int main(int argc, char **argv)
@@ -102,6 +103,7 @@ int main(int argc, char **argv)
102103
exit(1);
103104
}
104105

106+
memset(&map, 0, sizeof(map));
105107
map.seconds = seconds;
106108
map.threads = threads;
107109
map.node = node;

0 commit comments

Comments
 (0)