Skip to contentSkip to conversation

mips: Use the generic bitops headers

PATCH New Fabio Estevam 3 participants 8 messages Nov 4, 2015 – Nov 5, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 mips: Use the generic bitops headers

From: Fabio Estevam <[email protected]>

The generic bitops headers are required when calling logarithimic functions, such as ilog2().

---
Applies against u-boot-spi next

 arch/mips/include/asm/bitops.h | 5 +++++
 1 file changed, 5 insertions(+)
arch/mips/include/asm/bitops.h +5 -0
index b5c2a63..c31ff6e 100644
@@ -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.
  */
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/4 arc: Use the generic bitops headers

From: Fabio Estevam <[email protected]>

The generic bitops headers are required when calling logarithimic functions, such as ilog2().

---
Applies against u-boot-spi next

 arch/arc/include/asm/bitops.h | 5 +++++
 1 file changed, 5 insertions(+)
arch/arc/include/asm/bitops.h +5 -0
index 85721aa..370cb46 100644
@@ -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 */
Signature · 1 line
1.9.1
#2 lore raw

PATCH 3/4 avr32: Use the generic bitops headers

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

The generic bitops headers are required when calling logarithimic functions, such as ilog2().

---
Applies against u-boot-spi next

 arch/avr32/include/asm/bitops.h | 5 +++++
 1 file changed, 5 insertions(+)
arch/avr32/include/asm/bitops.h +5 -0
index 0ec6784..0d425c2 100644
@@ -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 */
Signature · 1 line
1.9.1
#3 lore raw

PATCH 4/4 spi: sf_ops: Use size_t for len

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

Let the function and its prototype use the same variable type for 'len'.

---
Applies against u-boot-spi next

 drivers/mtd/spi/sf_ops.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/spi/sf_ops.c +2 -2
index 31c79c6..d832464 100644
@@ -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;
Signature · 1 line
1.9.1
#4 lore raw

PATCH 1/4 mips: Use the generic bitops headers

In reply to Fabio Estevam
Quoted 5 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

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

#5 lore raw

PATCH 1/4 mips: Use the generic bitops headers

Quoted 10 lines · Dinh Nguyen
Quoted 5 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

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

#6 lore raw

PATCH 1/4 mips: Use the generic bitops headers

In reply to Fabio Estevam

Am 04.11.2015 um 18:13 schrieb Fabio Estevam:

Quoted 5 lines

From: Fabio Estevam <[email protected]>

The generic bitops headers are required when calling logarithimic functions, such as ilog2().

Quoted 7 lines

---
Applies against u-boot-spi next

 arch/mips/include/asm/bitops.h | 5 +++++
 1 file changed, 5 insertions(+)

--
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.

Signature · 1 line
- Daniel
#7 lore raw

PATCH 1/4 mips: Use the generic bitops headers

Hi Daniel,

Quoted 5 lines · Daniel Schwierzeck

--
After applying your patches

Quoted 7 lines

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.