net/mlx5: Use void pointer as the type in address_of macro
authorBodong Wang <[email protected]>
Wed, 13 Feb 2019 06:55:32 +0000 (22:55 -0800)
committerSaeed Mahameed <[email protected]>
Thu, 14 Feb 2019 20:14:41 +0000 (12:14 -0800)
Better to use void * and avoid unnecessary casts.

This patch doesn't change any functionality.

Signed-off-by: Bodong Wang <[email protected]>
Signed-off-by: Eli Cohen <[email protected]>
Reviewed-by: Or Gerlitz <[email protected]>
Reviewed-by: Daniel Jurgens <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
include/linux/mlx5/device.h

index 0845a227a7b24401593ac4f7aec62848dc24cde8..46223efa187795579a2e0e4b3fa1bdfc62fe59fd 100644 (file)
@@ -67,7 +67,7 @@
 #define MLX5_UN_SZ_BYTES(typ) (sizeof(union mlx5_ifc_##typ##_bits) / 8)
 #define MLX5_UN_SZ_DW(typ) (sizeof(union mlx5_ifc_##typ##_bits) / 32)
 #define MLX5_BYTE_OFF(typ, fld) (__mlx5_bit_off(typ, fld) / 8)
-#define MLX5_ADDR_OF(typ, p, fld) ((char *)(p) + MLX5_BYTE_OFF(typ, fld))
+#define MLX5_ADDR_OF(typ, p, fld) ((void *)((uint8_t *)(p) + MLX5_BYTE_OFF(typ, fld)))
 
 /* insert a value to a struct */
 #define MLX5_SET(typ, p, fld, v) do { \