#ifndef XMALLOC_H #define XMALLOC_H #include #include "built_in.h" #include "die.h" extern void *xmalloc(size_t size) __hidden __warn_unused_result; extern void *xcalloc(size_t nmemb, size_t size) __hidden __warn_unused_result; extern void *xzmalloc(size_t size) __hidden __warn_unused_result; extern void *xmallocz(size_t size) __hidden __warn_unused_result; extern void *xmalloc_aligned(size_t size, size_t alignment) __hidden __warn_unused_result; extern void *xzmalloc_aligned(size_t size, size_t alignment) __hidden __warn_unused_result; extern void *xmemdupz(const void *data, size_t len) __hidden __warn_unused_result; extern void *xrealloc(void *ptr, size_t size) __hidden __warn_unused_result; extern void xfree_func(void *ptr) __hidden; extern char *xstrdup(const char *str) __hidden __warn_unused_result; extern char *xstrndup(const char *str, size_t size) __hidden __warn_unused_result; static inline void __xfree(void *ptr) { if (unlikely((ptr) == NULL)) panic("xfree: NULL pointer given as argument\n"); free(ptr); } #define xzfree(ptr, size) \ do { \ xmemset(ptr, 0, size); \ xfree(ptr); \ } while (0) #define xfree(ptr) \ do { \ __xfree(ptr); \ (ptr) = NULL; \ } while (0) #endif /* XMALLOC_H */ t-loop-back net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-05-06 20:03:16 +0200
committerJens Axboe <axboe@fb.com>2016-05-06 12:51:10 -0600
commit45bbd0529e5d50aa91a4bb5fffffc5e24df3ef7e (patch)
tree61359e81520a2215ff56712a704cff16e3147517
parentcca87bc9d359f1a03ac34ca095343d1bfa2e6b15 (diff)
lightnvm: pass dma address to hardware rather than pointer
A recent change to lightnvm added code to pass a kernel pointer to the hardware, which gcc complained about: drivers/nvme/host/lightnvm.c: In function 'nvme_nvm_rqtocmd': drivers/nvme/host/lightnvm.c:472:32: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] c->ph_rw.metadata = cpu_to_le64(rqd->meta_list); It looks like this has no way of working anyway, so this changes the code to pass the dma_address instead. This was most likely what was intended here. Neither of the two are currently ever written to, so the effect is the same for now. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: a34b1eb78e21 ("lightnvm: enable metadata to be sent to device") Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com>