mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zdump: refractor PTR_DIFF
PTR_SUB already implements subtraction of pointers. Let's reuse it. Suggested-by: Alexander Egorenkov <egorenar@linux.ibm.com> Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
ae305b5158
commit
5b0115fdb4
@@ -142,7 +142,7 @@ static inline u32 zg_csum_partial(const void *buf, int len, u32 sum)
|
||||
*/
|
||||
#define PTR_SUB(x, y) (((char *) (x)) - ((unsigned long) (y)))
|
||||
#define PTR_ADD(x, y) (((char *) (x)) + ((unsigned long) (y)))
|
||||
#define PTR_DIFF(x, y) ((unsigned long)(((char *) (x)) - ((unsigned long) (y))))
|
||||
#define PTR_DIFF(x, y) ((unsigned long)PTR_SUB(x, y))
|
||||
|
||||
/*
|
||||
* File functions
|
||||
|
||||
Reference in New Issue
Block a user