summaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2file.c
diff options
context:
space:
mode:
authorEnzo Matsumiya <ematsumiya@suse.de>2022-10-12 22:53:09 -0500
committerSteve French <stfrench@microsoft.com>2022-10-13 09:36:39 -0500
commitd7173623bf0b1503bc4e6f13cd0fccab5e98c6ce (patch)
treec5a1df48298e7e9b31ef8faa5de508cc94e44a8c /fs/cifs/smb2file.c
parente4029e072673d8a694f660f551609dd4f9265088 (diff)
downloadlinux-d7173623bf0b1503bc4e6f13cd0fccab5e98c6ce.tar.gz
linux-d7173623bf0b1503bc4e6f13cd0fccab5e98c6ce.tar.bz2
linux-d7173623bf0b1503bc4e6f13cd0fccab5e98c6ce.zip
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/smb2file.c')
0 files changed, 0 insertions, 0 deletions