Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'asm-generic-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic

Pull asm-generic updates from Arnd Bergmann:
"Here are three small cleanup patches for the include/asm-generic
directory.

Christoph removes the __ioremap as part of a cleanup, Nico improves
the constant do_div() optimization, and Denis changes BUG_ON() to be
consistent with other implementations"

* tag 'asm-generic-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
asm-generic: add unlikely to default BUG_ON(x)
__div64_const32(): improve the generic C version
asm-generic: don't provide __ioremap

+11 -16
+1 -1
include/asm-generic/bug.h
··· 185 185 #endif 186 186 187 187 #ifndef HAVE_ARCH_BUG_ON 188 - #define BUG_ON(condition) do { if (condition) BUG(); } while (0) 188 + #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0) 189 189 #endif 190 190 191 191 #ifndef HAVE_ARCH_WARN_ON
+10 -6
include/asm-generic/div64.h
··· 178 178 uint32_t m_hi = m >> 32; 179 179 uint32_t n_lo = n; 180 180 uint32_t n_hi = n >> 32; 181 - uint64_t res, tmp; 181 + uint64_t res; 182 + uint32_t res_lo, res_hi, tmp; 182 183 183 184 if (!bias) { 184 185 res = ((uint64_t)m_lo * n_lo) >> 32; ··· 188 187 res = (m + (uint64_t)m_lo * n_lo) >> 32; 189 188 } else { 190 189 res = m + (uint64_t)m_lo * n_lo; 191 - tmp = (res < m) ? (1ULL << 32) : 0; 192 - res = (res >> 32) + tmp; 190 + res_lo = res >> 32; 191 + res_hi = (res_lo < m_hi); 192 + res = res_lo | ((uint64_t)res_hi << 32); 193 193 } 194 194 195 195 if (!(m & ((1ULL << 63) | (1ULL << 31)))) { ··· 199 197 res += (uint64_t)m_hi * n_lo; 200 198 res >>= 32; 201 199 } else { 202 - tmp = res += (uint64_t)m_lo * n_hi; 200 + res += (uint64_t)m_lo * n_hi; 201 + tmp = res >> 32; 203 202 res += (uint64_t)m_hi * n_lo; 204 - tmp = (res < tmp) ? (1ULL << 32) : 0; 205 - res = (res >> 32) + tmp; 203 + res_lo = res >> 32; 204 + res_hi = (res_lo < tmp); 205 + res = res_lo | ((uint64_t)res_hi << 32); 206 206 } 207 207 208 208 res += (uint64_t)m_hi * n_hi;
-9
include/asm-generic/io.h
··· 963 963 } 964 964 #endif 965 965 966 - #ifndef __ioremap 967 - #define __ioremap __ioremap 968 - static inline void __iomem *__ioremap(phys_addr_t offset, size_t size, 969 - unsigned long flags) 970 - { 971 - return ioremap(offset, size); 972 - } 973 - #endif 974 - 975 966 #ifndef iounmap 976 967 #define iounmap iounmap 977 968