diff options
author | Fuqian Huang <[email protected]> | 2019-07-11 20:53:19 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2019-07-12 11:05:41 -0700 |
commit | d8b2fa657deaa73ff70d40aea9a54997fc0c7fc9 (patch) | |
tree | 86687af68f31040dc21d90e837c2d4e9ef644f70 /drivers/misc/lkdtm/heap.c | |
parent | 4658d87cb38cb3ab3a234d1b8d63f65df4cce62b (diff) |
ocfs2: use kmemdup rather than duplicating its implementation
kmemdup is introduced to duplicate a region of memory in a neat way.
Rather than kmalloc/kzalloc + memcpy, which the programmer needs to
write the size twice (sometimes lead to mistakes), kmemdup improves
readability, leads to smaller code and also reduce the chances of
mistakes.
Suggestion to use kmemdup rather than using kmalloc/kzalloc + memcpy.
[[email protected]: coding style fixes]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Fuqian Huang <[email protected]>
Reviewed-by: Joseph Qi <[email protected]>
Cc: Mark Fasheh <[email protected]>
Cc: Joel Becker <[email protected]>
Cc: Junxiao Bi <[email protected]>
Cc: Changwei Ge <[email protected]>
Cc: Gang He <[email protected]>
Cc: Jun Piao <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'drivers/misc/lkdtm/heap.c')
0 files changed, 0 insertions, 0 deletions