Hi all, newbie here.
Can the BIT macro be safely used on other parts of the kernel as well?
Just using git grep "1 <<" returns a ton of results where bit shifting
is used the old fashioned way.
Am Do., 18. Juni 2020 um 16:23 Uhr schrieb Liviu Dudau :
>
> On Thu, Jun 18, 2020 at 01:50:34PM +0100, C
On Thu, Jun 18, 2020 at 04:36:51PM +0200, Garrit Franke wrote:
> Hi all, newbie here.
> Can the BIT macro be safely used on other parts of the kernel as well?
> Just using git grep "1 <<" returns a ton of results where bit shifting
> is used the old fashioned way.
Yeah. There is a checkpatch warn
On 18/06/2020 15:36, Garrit Franke wrote:
> Hi all, newbie here.
> Can the BIT macro be safely used on other parts of the kernel as well?
> Just using git grep "1 <<" returns a ton of results where bit shifting
> is used the old fashioned way.
The BIT macro casts the 1 it a UL before shifting so i
On Thu, Jun 18, 2020 at 01:50:34PM +0100, Colin Ian King wrote:
> On 18/06/2020 13:14, Liviu Dudau wrote:
> > On Thu, Jun 18, 2020 at 11:04:00AM +0100, Colin King wrote:
> >> From: Colin Ian King
> >
> > Hi Colin,
> >
> >>
> >> Shifting the integer value 1 is evaluated using 32-bit arithmetic
>
On 18/06/2020 13:14, Liviu Dudau wrote:
> On Thu, Jun 18, 2020 at 11:04:00AM +0100, Colin King wrote:
>> From: Colin Ian King
>
> Hi Colin,
>
>>
>> Shifting the integer value 1 is evaluated using 32-bit arithmetic
>> and then used in an expression that expects a long value leads to
>> a potentia
On Thu, Jun 18, 2020 at 11:04:00AM +0100, Colin King wrote:
> From: Colin Ian King
Hi Colin,
>
> Shifting the integer value 1 is evaluated using 32-bit arithmetic
> and then used in an expression that expects a long value leads to
> a potential integer overflow.
I'm afraid this explanation mak