[U-Boot] [PATCH 1/4] mips: Use the generic bitops headers

From: Fabio Estevam fabio.estevam@freescale.com
The generic bitops headers are required when calling logarithimic functions, such as ilog2().
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- Applies against u-boot-spi next
arch/mips/include/asm/bitops.h | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h index b5c2a63..c31ff6e 100644 --- a/arch/mips/include/asm/bitops.h +++ b/arch/mips/include/asm/bitops.h @@ -17,6 +17,11 @@ #include <asm/sgidefs.h> #include <asm/system.h>
+#include <asm-generic/bitops/fls.h> +#include <asm-generic/bitops/__fls.h> +#include <asm-generic/bitops/fls64.h> +#include <asm-generic/bitops/__ffs.h> + /* * clear_bit() doesn't provide any barrier for the compiler. */

From: Fabio Estevam fabio.estevam@freescale.com
The generic bitops headers are required when calling logarithimic functions, such as ilog2().
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- Applies against u-boot-spi next
arch/arc/include/asm/bitops.h | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/arch/arc/include/asm/bitops.h b/arch/arc/include/asm/bitops.h index 85721aa..370cb46 100644 --- a/arch/arc/include/asm/bitops.h +++ b/arch/arc/include/asm/bitops.h @@ -16,4 +16,9 @@ #define hweight16(x) generic_hweight16(x) #define hweight8(x) generic_hweight8(x)
+#include <asm-generic/bitops/fls.h> +#include <asm-generic/bitops/__fls.h> +#include <asm-generic/bitops/fls64.h> +#include <asm-generic/bitops/__ffs.h> + #endif /* __ASM_ARC_BITOPS_H */

From: Fabio Estevam fabio.estevam@freescale.com
The generic bitops headers are required when calling logarithimic functions, such as ilog2().
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- Applies against u-boot-spi next
arch/avr32/include/asm/bitops.h | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h index 0ec6784..0d425c2 100644 --- a/arch/avr32/include/asm/bitops.h +++ b/arch/avr32/include/asm/bitops.h @@ -6,4 +6,9 @@ #ifndef __ASM_AVR32_BITOPS_H #define __ASM_AVR32_BITOPS_H
+#include <asm-generic/bitops/fls.h> +#include <asm-generic/bitops/__fls.h> +#include <asm-generic/bitops/fls64.h> +#include <asm-generic/bitops/__ffs.h> + #endif /* __ASM_AVR32_BITOPS_H */

From: Fabio Estevam fabio.estevam@freescale.com
Let the function and its prototype use the same variable type for 'len'.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- Applies against u-boot-spi next
drivers/mtd/spi/sf_ops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c index 31c79c6..d832464 100644 --- a/drivers/mtd/spi/sf_ops.c +++ b/drivers/mtd/spi/sf_ops.c @@ -652,7 +652,7 @@ int stm_is_locked(struct spi_flash *flash, u32 ofs, size_t len) * * Returns negative on errors, 0 on success. */ -int stm_lock(struct spi_flash *flash, u32 ofs, u32 len) +int stm_lock(struct spi_flash *flash, u32 ofs, size_t len) { u8 status_old, status_new; u8 mask = SR_BP2 | SR_BP1 | SR_BP0; @@ -703,7 +703,7 @@ int stm_lock(struct spi_flash *flash, u32 ofs, u32 len) * * Returns negative on errors, 0 on success. */ -int stm_unlock(struct spi_flash *flash, u32 ofs, u32 len) +int stm_unlock(struct spi_flash *flash, u32 ofs, size_t len) { uint8_t status_old, status_new; u8 mask = SR_BP2 | SR_BP1 | SR_BP0;

On 11/04/2015 11:13 AM, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@freescale.com
The generic bitops headers are required when calling logarithimic functions, such as ilog2().
s/logarithimic/logarithmic
Same comment for 2/4 and 3/4
Dinh

On Wed, Nov 4, 2015 at 3:21 PM, Dinh Nguyen dinguyen@opensource.altera.com wrote:
On 11/04/2015 11:13 AM, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@freescale.com
The generic bitops headers are required when calling logarithimic functions, such as ilog2().
s/logarithimic/logarithmic
Same comment for 2/4 and 3/4
Good catch, thanks Dinh

Am 04.11.2015 um 18:13 schrieb Fabio Estevam:
From: Fabio Estevam fabio.estevam@freescale.com
The generic bitops headers are required when calling logarithimic functions, such as ilog2().
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com
Applies against u-boot-spi next
arch/mips/include/asm/bitops.h | 5 +++++ 1 file changed, 5 insertions(+)
Reviewed-by: Daniel Schwierzeck daniel.schwierzeck@gmail.com
-- After applying your patches
include: Add log2 header from the kernel include: Add generic bitops headers
I've got warnings on almost all MIPS boards. Maybe you should move your modification on "include/linux/bitops.h" in the second patch to a separate patch to be applied after all arch-specific patches to avoid this. I guess the other archs have the same problem.

Hi Daniel,
On Wed, Nov 4, 2015 at 3:58 PM, Daniel Schwierzeck daniel.schwierzeck@gmail.com wrote:
Reviewed-by: Daniel Schwierzeck daniel.schwierzeck@gmail.com
-- After applying your patches
include: Add log2 header from the kernel include: Add generic bitops headers
I've got warnings on almost all MIPS boards. Maybe you should move your modification on "include/linux/bitops.h" in the second patch to a separate patch to be applied after all arch-specific patches to avoid this. I guess the other archs have the same problem.
Thanks for reviewing it. This makes sense. Will do as suggested.
participants (3)
-
Daniel Schwierzeck
-
Dinh Nguyen
-
Fabio Estevam