]> git.itanic.dy.fi Git - linux-stable/commit
net: ipa: avoid 64-bit modulus
authorAlex Elder <elder@linaro.org>
Tue, 23 Mar 2021 01:05:05 +0000 (20:05 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Mar 2021 00:15:23 +0000 (17:15 -0700)
commit437c78f976f5b39fc4b2a1c65903a229f55912dd
treea37b648b0968bcdb419dd4e6c8ad33adb53ed45e
parented97143e00982e1cab3544977f33b94a6de2e6fa
net: ipa: avoid 64-bit modulus

It is possible for a 32 bit x86 build to use a 64 bit DMA address.

There are two remaining spots where the IPA driver does a modulo
operation to check alignment of a DMA address, and under certain
conditions this can lead to a build error on i386 (at least).

The alignment checks we're doing are for power-of-2 values, and this
means the lower 32 bits of the DMA address can be used.  This ensures
both operands to the modulo operator are 32 bits wide.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Alex Elder <elder@linaro.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/gsi.c
drivers/net/ipa/ipa_table.c