[lkml]   [2019]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] afs: use BIT_ULL for shifting to fix integer overflow
Colin King <> wrote:

> The expression 1 << nr_slots is evaluated with 32 bit integer arithmetic
> and can overflow before it is widened.

If it does, it's an error on the part of the caller. See the banner comment:
1 <= nr_slots <= 9.

And, in any case, if nr_slots >= 64, using BIT_ULL wouldn't help...


 \ /
  Last update: 2019-08-30 16:02    [W:0.037 / U:2.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site