Macro 'offsetof' has been defined in 'stddef.h'. So remove the redefined one in 'wd_ecc_drv.h'.
Signed-off-by: Yang Shen shenyang39@huawei.com --- include/drv/wd_ecc_drv.h | 2 -- wd_ecc.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/include/drv/wd_ecc_drv.h b/include/drv/wd_ecc_drv.h index ef98606..857da20 100644 --- a/include/drv/wd_ecc_drv.h +++ b/include/drv/wd_ecc_drv.h @@ -45,8 +45,6 @@ extern "C" { #define WD_X448 0x2 #define WD_SM2P256 0x3
-#define offsetof(t, m) ((size_t)(uintptr_t)&((t *)0)->m) - /* ECC message format */ struct wd_ecc_msg { struct wd_ecc_req req; diff --git a/wd_ecc.c b/wd_ecc.c index 1ff6ed3..4cf287b 100644 --- a/wd_ecc.c +++ b/wd_ecc.c @@ -8,6 +8,7 @@ #include <errno.h> #include <pthread.h> #include <stdlib.h> +#include <stddef.h> #include <string.h> #include <time.h> #include <dlfcn.h>
Macro 'offsetof' has been defined in 'stddef.h'. So remove the redefined one in 'hisi_qm_udrv.h'.
Signed-off-by: Yang Shen shenyang39@huawei.com --- include/hisi_qm_udrv.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/hisi_qm_udrv.h b/include/hisi_qm_udrv.h index 0ea17c6..88758ac 100644 --- a/include/hisi_qm_udrv.h +++ b/include/hisi_qm_udrv.h @@ -5,6 +5,7 @@ #define __HZIP_DRV_H__
#include <stdbool.h> +#include <stddef.h> #include <pthread.h> #include <linux/types.h>
@@ -29,10 +30,9 @@ extern "C" { #define BYTE_BITS 8 #define BYTE_BITS_SHIFT 3
-#define __offsetof(t, m) ((size_t)(uintptr_t)&((t *)0)->m) #define container_of(ptr, type, member) ({ \ typeof(((type *)0)->member)(*__mptr) = (ptr); \ - (type *)((char *)__mptr - __offsetof(type, member)); }) + (type *)((char *)__mptr - offsetof(type, member)); })
enum hisi_qm_sgl_copy_dir { COPY_SGL_TO_PBUFF,