Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32291 )
Change subject: nb/via/vx900: Use 64 bits to prevent overflow ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/32291/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/32291/1//COMMIT_MSG@9 PS1, Line 9: The bit operations are currently done using 32 bit math. : Cast the first argument to 64 bits to prevent possible : overflow.
What we currently have is […]
I can see that, but a cast does not fix anything, you just change the nature of the problem. What you ought to do, is do a sanity check on the 32 bit variable. For instance you have a value that needs to be below 4 << 20 (below 4G in KiB). Checking that makes more sense than avoiding overflows, because overflow or no overflow with the cast, you are in trouble...