diff options
author | Kees Cook <[email protected]> | 2021-05-17 20:16:57 -0700 |
---|---|---|
committer | Kees Cook <[email protected]> | 2021-10-18 12:28:52 -0700 |
commit | 6dbefad40815a61aecbcf9b552e87ef57ab8cc7d (patch) | |
tree | 30f48300a013f5a629a0e624818689f950587426 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | caf283d040f53bc4fd81ce3d2a1a364b069cfd7d (diff) |
string.h: Introduce memset_startat() for wiping trailing members and padding
A common idiom in kernel code is to wipe the contents of a structure
starting from a given member. These open-coded cases are usually difficult
to read and very sensitive to struct layout changes. Like memset_after(),
introduce a new helper, memset_startat() that takes the target struct
instance, the byte to write, and the member name where zeroing should
start.
Note that this doesn't zero padding preceding the target member. For
those cases, memset_after() should be used on the preceding member.
Cc: Steffen Klassert <[email protected]>
Cc: Herbert Xu <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Francis Laniel <[email protected]>
Cc: Vincenzo Frascino <[email protected]>
Cc: Daniel Axtens <[email protected]>
Cc: [email protected]
Signed-off-by: Kees Cook <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions