Re: [PATCH] iov_iter: Use __bitwise with the extraction_flags

From: David Hildenbrand
Date: Thu Jan 26 2023 - 05:42:35 EST


On 26.01.23 11:33, David Howells wrote:

Interestingly, things like __be32 are __bitwise. I wonder if that actually
makes sense or if it was just convenient so stop people doing arithmetic on
them. I guess doing AND/OR/XOR on them isn't a problem provided both
arguments are appropriately byte-swapped.

I recall that __be32 and friends were one of the early users of __bitwise in the kernel. And the reason IIRC was exactly that: detect when no proper conversion was performed using static code analysis (Sparse). While some operations might make sense, the abuse is much more likely.


LGTM, thanks!

--
Thanks,

David / dhildenb