Skip to content

Commit

Permalink
Merge tag 'dma-mapping-5.11-2' of git://git.infradead.org/users/hch/d…
Browse files Browse the repository at this point in the history
…ma-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
  • Loading branch information
Linus Torvalds committed Feb 7, 2021
2 parents fc6c0ae + 9f5f8ec commit ff92acb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kernel/dma/map_benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct map_benchmark {
__s32 node; /* which numa node this benchmark will run on */
__u32 dma_bits; /* DMA addressing capability */
__u32 dma_dir; /* DMA data direction */
__u64 expansion[10]; /* For future use */
__u8 expansion[84]; /* For future use */
};

struct map_benchmark_data {
Expand Down
4 changes: 3 additions & 1 deletion tools/testing/selftests/dma/dma_map_benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
Expand Down Expand Up @@ -35,7 +36,7 @@ struct map_benchmark {
__s32 node; /* which numa node this benchmark will run on */
__u32 dma_bits; /* DMA addressing capability */
__u32 dma_dir; /* DMA data direction */
__u64 expansion[10]; /* For future use */
__u8 expansion[84]; /* For future use */
};

int main(int argc, char **argv)
Expand Down Expand Up @@ -102,6 +103,7 @@ int main(int argc, char **argv)
exit(1);
}

memset(&map, 0, sizeof(map));
map.seconds = seconds;
map.threads = threads;
map.node = node;
Expand Down

0 comments on commit ff92acb

Please sign in to comment.