On 10/14/2025 11:09 AM, Youssef Samir wrote:
From: Zack McKevitt <[email protected]>
Use check_add_overflow instead of size_add in sahara when
64b types are being added to ensure compatibility with 32b
systems. The size_add function parameters are of size_t, so
64b data types may be truncated when cast to size_t on 32b
systems. When using check_add_overflow, no type casts are made,
making it a more portable option.
Signed-off-by: Zack McKevitt <[email protected]>
Signed-off-by: Youssef Samir <[email protected]>
I think you are missing two reviewed-by tags from v1.
---
Changes in V2:
- Use explicit casts with check_*_overflow() calls
- Replace min() with min_t()
Fixing typecast warnings with explicit casts seems good, but min->min_t
seems outside of scope. It doesn't match with the commit text, and I
don't see a good way to include it without making this patch look like
it should be split into two. Thus, lets do the typecast fixes for the
min usage as a follow up.
-Jeff