diff options
author | Enzo Matsumiya <ematsumiya@suse.de> | 2022-10-13 06:53:09 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2022-10-13 17:36:39 +0300 |
commit | d7173623bf0b1503bc4e6f13cd0fccab5e98c6ce (patch) | |
tree | c5a1df48298e7e9b31ef8faa5de508cc94e44a8c /fs/cifs/dfs_cache.h | |
parent | e4029e072673d8a694f660f551609dd4f9265088 (diff) | |
download | linux-d7173623bf0b1503bc4e6f13cd0fccab5e98c6ce.tar.xz |
cifs: use ALIGN() and round_up() macros
Improve code readability by using existing macros:
Replace hardcoded alignment computations (e.g. (len + 7) & ~0x7) by
ALIGN()/IS_ALIGNED() macros.
Also replace (DIV_ROUND_UP(len, 8) * 8) with ALIGN(len, 8), which, if
not optimized by the compiler, has the overhead of a multiplication
and a division. Do the same for roundup() by replacing it by round_up()
(division-less version, but requires the multiple to be a power of 2,
which is always the case for us).
And remove some unnecessary checks where !IS_ALIGNED() would fit, but
calling round_up() directly is fine as it's a no-op if the value is
already aligned.
Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/dfs_cache.h')
0 files changed, 0 insertions, 0 deletions