Skip to contentSkip to conversation

include: <linux/bitops.h>: discard left-over hweight code

PATCH Applied Ahmad Fatoum 2 participants 6 messages Oct 30, 2021 – Nov 1, 2021

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

PATCH 1/5 include: <linux/bitops.h>: discard left-over hweight code

There are no definitions for __sw_hweight*, so no point in keeping the prototypes around. The scripts version of the header also ultimately tries to access non-existing normal headers, so fix that up as well.

---
 include/linux/bitops.h                             | 5 -----
 scripts/include/asm-generic/bitops/arch_hweight.h  | 1 -
 scripts/include/asm-generic/bitops/const_hweight.h | 1 -
 scripts/include/asm-generic/bitops/hweight.h       | 3 +--
 scripts/include/linux/bitops.h                     | 4 ----
 5 files changed, 1 insertion(+), 13 deletions(-)
 delete mode 100644 scripts/include/asm-generic/bitops/arch_hweight.h
 delete mode 100644 scripts/include/asm-generic/bitops/const_hweight.h
include/linux/bitops.h +0 -5
index 31345c219d33..dd13bf93118c 100644
@@ -24,11 +24,6 @@
 #define GENMASK_ULL(h, l) \
 	(((~0ULL) << (l)) & (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h))))
 
-extern unsigned int __sw_hweight8(unsigned int w);
-extern unsigned int __sw_hweight16(unsigned int w);
-extern unsigned int __sw_hweight32(unsigned int w);
-extern unsigned long __sw_hweight64(__u64 w);
-
 /*
  * Include this here because some architectures need generic_ffs/fls in
  * scope
scripts/include/asm-generic/bitops/arch_hweight.h deleted +0 -1
deleted file mode 100644
index 318bb2b202b0..000000000000
@@ -1 +0,0 @@
-#include "../../../../include/asm-generic/bitops/arch_hweight.h"
scripts/include/asm-generic/bitops/const_hweight.h deleted +0 -1
deleted file mode 100644
index 0afd644aff83..000000000000
@@ -1 +0,0 @@
-#include "../../../../include/asm-generic/bitops/const_hweight.h"
scripts/include/asm-generic/bitops/hweight.h +1 -2
index 290120c01a8e..eb95ca33d5c0 100644
@@ -1,7 +1,6 @@
 #ifndef _TOOLS_LINUX_ASM_GENERIC_BITOPS_HWEIGHT_H_
 #define _TOOLS_LINUX_ASM_GENERIC_BITOPS_HWEIGHT_H_
 
-#include <asm-generic/bitops/arch_hweight.h>
-#include <asm-generic/bitops/const_hweight.h>
+#include "../../../../include/asm-generic/bitops/hweight.h"
 
 #endif /* _TOOLS_LINUX_ASM_GENERIC_BITOPS_HWEIGHT_H_ */
scripts/include/linux/bitops.h +0 -4
index 5ad9ee1dd7f6..c9ec614e0db6 100644
@@ -19,10 +19,6 @@
 #define BITS_TO_U32(nr)		DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u32))
 #define BITS_TO_BYTES(nr)	DIV_ROUND_UP(nr, BITS_PER_BYTE)
 
-extern unsigned int __sw_hweight8(unsigned int w);
-extern unsigned int __sw_hweight16(unsigned int w);
-extern unsigned int __sw_hweight32(unsigned int w);
-extern unsigned long __sw_hweight64(__u64 w);
 
 /*
  * Include this here because some architectures need generic_ffs/fls in
Signature · 7 lines
2.30.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 2/5 scripts: <linux/bitops.h>: fix references to undefined __BITS_PER_LONG

No where do we define __BITS_PER_LONG, but we know about BITS_PER_LONG. Fix it.

---
 scripts/include/asm-generic/bitops/__ffs.h  |  3 ++-
 scripts/include/asm-generic/bitops/atomic.h |  9 +++++----
 scripts/include/asm-generic/bitsperlong.h   | 12 ++++++++++++
 scripts/include/linux/bitops.h              |  7 +------
 4 files changed, 20 insertions(+), 11 deletions(-)
 create mode 100644 scripts/include/asm-generic/bitsperlong.h
scripts/include/asm-generic/bitops/__ffs.h +2 -1
index c94175015a82..15ffaa12c592 100644
@@ -2,6 +2,7 @@
 #define _TOOLS_LINUX_ASM_GENERIC_BITOPS___FFS_H_
 
 #include <asm/types.h>
+#include <asm-generic/bitsperlong.h>
 
 /**
  * __ffs - find first bit in word.
@@ -13,7 +14,7 @@ static __always_inline unsigned long __ffs(unsigned long word)
 {
 	int num = 0;
 
-#if __BITS_PER_LONG == 64
+#if BITS_PER_LONG == 64
 	if ((word & 0xffffffff) == 0) {
 		num += 32;
 		word >>= 32;
scripts/include/asm-generic/bitops/atomic.h +5 -4
index 4bccd7c3d5d6..03fe804024df 100644
@@ -2,21 +2,22 @@
 #define _TOOLS_LINUX_ASM_GENERIC_BITOPS_ATOMIC_H_
 
 #include <asm/types.h>
+#include <asm-generic/bitsperlong.h>
 
 static inline void set_bit(int nr, unsigned long *addr)
 {
-	addr[nr / __BITS_PER_LONG] |= 1UL << (nr % __BITS_PER_LONG);
+	addr[nr / BITS_PER_LONG] |= 1UL << (nr % BITS_PER_LONG);
 }
 
 static inline void clear_bit(int nr, unsigned long *addr)
 {
-	addr[nr / __BITS_PER_LONG] &= ~(1UL << (nr % __BITS_PER_LONG));
+	addr[nr / BITS_PER_LONG] &= ~(1UL << (nr % BITS_PER_LONG));
 }
 
 static __always_inline int test_bit(unsigned int nr, const unsigned long *addr)
 {
-	return ((1UL << (nr % __BITS_PER_LONG)) &
-		(((unsigned long *)addr)[nr / __BITS_PER_LONG])) != 0;
+	return ((1UL << (nr % BITS_PER_LONG)) &
+		(((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0;
 }
 
 #endif /* _TOOLS_LINUX_ASM_GENERIC_BITOPS_ATOMIC_H_ */
scripts/include/asm-generic/bitsperlong.h new file +12 -0
new file mode 100644
index 000000000000..eb2dfd9065a7
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef __BITS_PER_LONG_H_
+#define __BITS_PER_LONG_H_
+
+#ifndef __WORDSIZE
+#define __WORDSIZE (__SIZEOF_LONG__ * 8)
+#endif
+
+#define BITS_PER_LONG __WORDSIZE
+
+#endif
scripts/include/linux/bitops.h +1 -6
index c9ec614e0db6..60f5c5b4f927 100644
@@ -4,12 +4,7 @@
 #include <asm/types.h>
 #include <linux/kernel.h>
 #include <linux/compiler.h>
-
-#ifndef __WORDSIZE
-#define __WORDSIZE (__SIZEOF_LONG__ * 8)
-#endif
-
-#define BITS_PER_LONG __WORDSIZE
+#include <asm-generic/bitsperlong.h>
 
 #define BIT_MASK(nr)		(1UL << ((nr) % BITS_PER_LONG))
 #define BIT_WORD(nr)		((nr) / BITS_PER_LONG)
Signature · 7 lines
2.30.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 3/5 include: add dedicated header for printf/printk

In reply to Ahmad Fatoum

Including <stdio.h> for printf is a bit problematic, because it pulls in other headers for <console.h>, which includes quite a few more headers as well. To make it easier to share code between barebox and host tools make <printk.h> the new minimal header for printf and move the extra logging stuff into <linux/printk.h>.

---
 arch/arm/boards/netgear-rn2120/board.c  |   2 +-
 arch/arm/mach-mvebu/kwb_bbu.c           |   2 +-
 common/bootchooser.c                    |   2 +-
 common/optee.c                          |   2 +-
 common/state/backend_bucket_direct.c    |   2 +-
 common/state/backend_storage.c          |   2 +-
 common/state/state_variables.c          |   2 +-
 drivers/clk/analogbits/wrpll-cln28hpc.c |   2 +-
 drivers/clk/at91/pmc.h                  |   2 +-
 drivers/clk/sifive/sifive-prci.c        |   2 +-
 drivers/gpio/gpio-sifive.c              |   2 +-
 drivers/gpio/gpio-starfive-vic.c        |   2 +-
 drivers/pwm/pwm-atmel.c                 |   2 +-
 drivers/soc/sifive/sifive_l2_cache.c    |   2 +-
 drivers/watchdog/f71808e_wdt.c          |   2 +-
 fs/pstore/platform.c                    |   2 +-
 fs/pstore/ram.c                         |   2 +-
 fs/squashfs/squashfs.h                  |   2 +-
 include/common.h                        |   2 +-
 include/linux/barebox-wrapper.h         |  15 +-
 include/linux/mtd/mtd.h                 |   2 +-
 include/linux/printk.h                  | 173 ++++++++++++++++++++++++
 include/printk.h                        | 168 ++---------------------
 include/stdio.h                         |   8 +-
 lib/hexdump.c                           |   2 +-
 lib/kasan/report.c                      |   2 +-
 pbl/fdt.c                               |   2 +-
 27 files changed, 211 insertions(+), 199 deletions(-)
 create mode 100644 include/linux/printk.h
arch/arm/boards/netgear-rn2120/board.c +1 -1
index caf106af50d6..d5756e09694b 100644
@@ -2,7 +2,7 @@
 #include <init.h>
 #include <of.h>
 #include <gpio.h>
-#include <printk.h>
+#include <linux/printk.h>
 #include <linux/kernel.h>
 #include <asm/armlinux.h>
 #include <generated/mach-types.h>
arch/arm/mach-mvebu/kwb_bbu.c +1 -1
index f79464fe53e4..3de575740c27 100644
@@ -1,6 +1,6 @@
 #include <bbu.h>
 #include <libfile.h>
-#include <printk.h>
+#include <linux/printk.h>
 
 #include <mach/bbu.h>
 
common/bootchooser.c +1 -1
index 2f22e03c4768..75dfbc6166c2 100644
@@ -13,7 +13,7 @@
 #include <libfile.h>
 #include <common.h>
 #include <malloc.h>
-#include <printk.h>
+#include <linux/printk.h>
 #include <xfuncs.h>
 #include <envfs.h>
 #include <errno.h>
common/optee.c +1 -1
index d542dde11854..b460fbcd0161 100644
@@ -3,7 +3,7 @@
 #define pr_fmt(fmt) "optee: " fmt
 
 #include <tee/optee.h>
-#include <printk.h>
+#include <linux/printk.h>
 #include <asm-generic/errno.h>
 
 int optee_verify_header(struct optee_header *hdr)
common/state/backend_bucket_direct.c +1 -1
index 4522f0170f3d..517aec60634b 100644
@@ -17,7 +17,7 @@
 #include <libfile.h>
 #include <linux/kernel.h>
 #include <malloc.h>
-#include <printk.h>
+#include <linux/printk.h>
 
 #include "state.h"
 
common/state/backend_storage.c +1 -1
index fe7e89e8fb39..7fc7acfdcbc8 100644
@@ -21,7 +21,7 @@
 #include <linux/mtd/mtd-abi.h>
 #include <sys/stat.h>
 #include <malloc.h>
-#include <printk.h>
+#include <linux/printk.h>
 
 #include "state.h"
 
common/state/state_variables.c +1 -1
index 66c66f38bd45..f112c60bf602 100644
@@ -21,7 +21,7 @@
 #include <linux/types.h>
 #include <malloc.h>
 #include <net.h>
-#include <printk.h>
+#include <linux/printk.h>
 #include <of.h>
 #include <stdio.h>
 
drivers/clk/analogbits/wrpll-cln28hpc.c +1 -1
index 640af533d606..5a3602649f18 100644
@@ -23,7 +23,7 @@
 
 #include <linux/kernel.h>
 #include <stdio.h>
-#include <printk.h>
+#include <linux/printk.h>
 #include <linux/bug.h>
 #include <linux/err.h>
 #include <linux/log2.h>
drivers/clk/at91/pmc.h +1 -1
index 4e6ec8231eae..f9b2324f6aac 100644
@@ -10,7 +10,7 @@
 
 #include <io.h>
 #include <linux/bitops.h>
-#include <printk.h>
+#include <linux/printk.h>
 
 struct pmc_data {
 	unsigned int ncore;
drivers/clk/sifive/sifive-prci.c +1 -1
index 1701a2c5a0ef..fa0d1dc432bf 100644
@@ -8,7 +8,7 @@
 #include <linux/list.h>
 #include <linux/clkdev.h>
 #include <linux/overflow.h>
-#include <printk.h>
+#include <linux/printk.h>
 #include <clock.h>
 #include <io.h>
 #include <of.h>
drivers/gpio/gpio-sifive.c +1 -1
index 63f2c097e446..58ffd8778855 100644
@@ -4,7 +4,7 @@
  */
 
 #include <linux/basic_mmio_gpio.h>
-#include <printk.h>
+#include <linux/printk.h>
 #include <driver.h>
 #include <errno.h>
 
drivers/gpio/gpio-starfive-vic.c +1 -1
index baa4f584d5e8..4f8c0c6cd779 100644
@@ -6,7 +6,7 @@
 #include <linux/basic_mmio_gpio.h>
 #include <linux/reset.h>
 #include <linux/clk.h>
-#include <printk.h>
+#include <linux/printk.h>
 #include <driver.h>
 #include <errno.h>
 #include <pinctrl.h>
drivers/pwm/pwm-atmel.c +1 -1
index 7fa394934a76..1c6214594c9d 100644
@@ -12,7 +12,7 @@
 #include <common.h>
 #include <driver.h>
 #include <module.h>
-#include <printk.h>
+#include <linux/printk.h>
 #include <stdio.h>
 #include <init.h>
 #include <pwm.h>
drivers/soc/sifive/sifive_l2_cache.c +1 -1
index a1e9a1062204..c1b7fda9c868 100644
@@ -9,7 +9,7 @@
 #define pr_fmt(fmt) "sifive-l2: " fmt
 
 #include <io.h>
-#include <printk.h>
+#include <linux/printk.h>
 #include <stdio.h>
 #include <driver.h>
 #include <init.h>
drivers/watchdog/f71808e_wdt.c +1 -1
index 925c2f809df7..b2cf0f8ddd22 100644
@@ -13,7 +13,7 @@
 #include <asm/io.h>
 #include <driver.h>
 #include <watchdog.h>
-#include <printk.h>
+#include <linux/printk.h>
 #include <reset_source.h>
 #include <superio.h>
 #include <common.h>
fs/pstore/platform.c +1 -1
index f4b77226d906..50a1bffdd053 100644
@@ -27,7 +27,7 @@
 #include <linux/mutex.h>
 #include <console.h>
 #include <malloc.h>
-#include <printk.h>
+#include <linux/printk.h>
 #include <module.h>
 
 #include "internal.h"
fs/pstore/ram.c +1 -1
index 958f46b0ead0..0d8bb8f418f4 100644
@@ -31,7 +31,7 @@
 #include <linux/log2.h>
 #include <linux/spinlock.h>
 #include <malloc.h>
-#include <printk.h>
+#include <linux/printk.h>
 #include <stdio.h>
 #include <globalvar.h>
 #include <init.h>
fs/squashfs/squashfs.h +1 -1
index 825df2aeddbd..9ddcfbf1c25c 100644
@@ -17,7 +17,7 @@
  * squashfs.h
  */
 
-#include <printk.h>
+#include <linux/printk.h>
 #include <fs.h>
 #include <linux/fs.h>
 #include <linux/kernel.h>
include/common.h +1 -1
index 693f5bf97029..083b76cfedc9 100644
@@ -18,7 +18,7 @@
 #include <linux/stddef.h>
 #include <asm/common.h>
 #include <asm/io.h>
-#include <printk.h>
+#include <linux/printk.h>
 
 /*
  * sanity check. The Linux Kernel defines only one of __LITTLE_ENDIAN and
include/linux/barebox-wrapper.h +1 -14
index 82c52dd93309..83fa9223decc 100644
@@ -4,6 +4,7 @@
 #include <malloc.h>
 #include <xfuncs.h>
 #include <linux/slab.h>
+#include <printk.h>
 
 #define vmalloc(len)		malloc(len)
 #define __vmalloc(len, mode, pgsz)	malloc(len)
@@ -13,20 +14,6 @@ static inline void vfree(const void *addr)
 	free((void *)addr);
 }
 
-#define KERN_EMERG      ""   /* system is unusable                   */
-#define KERN_ALERT      ""   /* action must be taken immediately     */
-#define KERN_CRIT       ""   /* critical conditions                  */
-#define KERN_ERR        ""   /* error conditions                     */
-#define KERN_WARNING    ""   /* warning conditions                   */
-#define KERN_NOTICE     ""   /* normal but significant condition     */
-#define KERN_INFO       ""   /* informational                        */
-#define KERN_DEBUG      ""   /* debug-level messages                 */
-#define KERN_CONT       ""
-
-#define printk			printf
-
-#define pr_warn			pr_warning
-
 #define __init
 
 #define MODULE_AUTHOR(x)
include/linux/mtd/mtd.h +1 -1
index b17e590f5e91..f9c464518021 100644
@@ -11,7 +11,7 @@
 
 #include <driver.h>
 #include <errno.h>
-#include <printk.h>
+#include <linux/printk.h>
 #include <linux/types.h>
 #include <linux/list.h>
 #include <linux/mtd/mtd-abi.h>
include/linux/printk.h new file +173 -0

173 lines not on this page · raw message

include/printk.h +13 -155

193 lines not on this page · raw message

include/stdio.h +1 -7
index 1cb11e88deea..49f3d0cf77b3 100644
@@ -4,6 +4,7 @@
 
 #include <stdarg.h>
 #include <console.h>
+#include <printk.h>
 
 /*
  * STDIO based functions (can always be used)
@@ -71,8 +72,6 @@ static inline int ctrlc (void)
 
 #if (!defined(__PBL__) && !defined(CONFIG_CONSOLE_NONE)) || \
 	(defined(__PBL__) && defined(CONFIG_PBL_CONSOLE))
-int printf(const char *fmt, ...) __attribute__ ((format(__printf__, 1, 2)));
-
 static inline int puts(const char *s)
 {
 	return console_puts(CONSOLE_STDOUT, s);
@@ -83,11 +82,6 @@ static inline void putchar(char c)
 	console_putc(CONSOLE_STDOUT, c);
 }
 #else
-static int printf(const char *fmt, ...) __attribute__ ((format(__printf__, 1, 2)));
-static inline int printf(const char *fmt, ...)
-{
-	return 0;
-}
 static inline int puts(const char *s)
 {
 	return 0;
lib/hexdump.c +1 -1
index 93f345e8817c..fb80ef9724d8 100644
@@ -7,7 +7,7 @@
 #include <linux/types.h>
 #include <linux/ctype.h>
 #include <linux/log2.h>
-#include <printk.h>
+#include <linux/printk.h>
 #include <asm/unaligned.h>
 
 const char hex_asc[] = "0123456789abcdef";
lib/kasan/report.c +1 -1
index b7b2d032eee0..79442c00f4cb 100644
@@ -17,7 +17,7 @@
 #include <common.h>
 #include <linux/bitops.h>
 #include <linux/kernel.h>
-#include <printk.h>
+#include <linux/printk.h>
 #include <asm-generic/sections.h>
 
 #include "kasan.h"
pbl/fdt.c +1 -1
index 18ddb9f48a6e..7a913c546af6 100644
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <linux/libfdt.h>
 #include <pbl.h>
-#include <printk.h>
+#include <linux/printk.h>
 
 void fdt_find_mem(const void *fdt, unsigned long *membase, unsigned long *memsize)
 {
Signature · 7 lines
2.30.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH 4/5 include: <asm-generic/bug.h>: make self-contained

In reply to Ahmad Fatoum

<asm-generic/bug.h> so far depended on a preceding <common.h> to get the dump_stack() definition. Move dump_stack() to the new printk.h and drop the remaining puts() use to make header self-contained.

---
 include/asm-generic/bug.h |  5 +++--
 include/common.h          |  9 ---------
 include/printk.h          | 10 ++++++++++
 3 files changed, 13 insertions(+), 11 deletions(-)
include/asm-generic/bug.h +3 -2
index 82b78261fc5d..6aa3eada0ec5 100644
@@ -2,6 +2,8 @@
 #define _ASM_GENERIC_BUG_H
 
 #include <linux/compiler.h>
+#include <linux/kernel.h>
+#include <printk.h>
 
 #define BUG() do { \
 	printf("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \
@@ -28,8 +30,7 @@
 	int __ret_warn_on = !!(condition);				\
 	if (unlikely(__ret_warn_on)) {					\
 		__WARN();						\
-		puts("WARNING: ");					\
-		printf(format);						\
+		printf("WARNING: " format);				\
 	}								\
 	unlikely(__ret_warn_on);					\
 })
include/common.h +0 -9
index 083b76cfedc9..e37630243e73 100644
@@ -62,15 +62,6 @@ void ctrlc_handled(void);
 static inline void ctrlc_handled(void) { }
 #endif
 
-#ifdef CONFIG_ARCH_HAS_STACK_DUMP
-void dump_stack(void);
-#else
-static inline void dump_stack(void)
-{
-	printf("no stack data available\n");
-}
-#endif
-
 int parse_area_spec(const char *str, loff_t *start, loff_t *size);
 
 /* Just like simple_strtoul(), but this one honors a K/M/G suffix */
include/printk.h +10 -0
index 0915efbadd51..baf2cca20213 100644
@@ -47,4 +47,14 @@ extern void print_hex_dump(const char *level, const char *prefix_str,
 			   int prefix_type, int rowsize, int groupsize,
 			   const void *buf, size_t len, bool ascii);
 
+#ifdef CONFIG_ARCH_HAS_STACK_DUMP
+void dump_stack(void);
+#else
+static inline void dump_stack(void)
+{
+	printf("no stack data available\n");
+}
+#endif
+
+
 #endif
Signature · 7 lines
2.30.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

PATCH 5/5 include: move ARRAY_AND_SIZE to <linux/kernel.h>

In reply to Ahmad Fatoum

Linux defines this macro at multiple places. We define it once, but in <common.h>, which is a bit heavy weight. Move it next to the ARRAY_SIZE() definition.

---
 include/common.h               | 2 --
 include/linux/kernel.h         | 1 +
 scripts/include/linux/kernel.h | 1 +
 3 files changed, 2 insertions(+), 2 deletions(-)
include/common.h +0 -2
index e37630243e73..4167d4676e50 100644
@@ -88,8 +88,6 @@ enum autoboot_state do_autoboot_countdown(void);
 void __noreturn start_barebox(void);
 void shutdown_barebox(void);
 
-#define ARRAY_AND_SIZE(x)	(x), ARRAY_SIZE(x)
-
 /*
  * The STACK_ALIGN_ARRAY macro is used to allocate a buffer on the stack that
  * meets a minimum alignment requirement.
include/linux/kernel.h +1 -0
index 9ccdd60224dd..4483d33e65bb 100644
@@ -15,6 +15,7 @@
 #define IS_ALIGNED(x, a)		(((x) & ((typeof(x))(a) - 1)) == 0)
 
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
+#define ARRAY_AND_SIZE(x)	(x), ARRAY_SIZE(x)
 
 /*
  * This looks more complex than it should be. But we need to
scripts/include/linux/kernel.h +1 -0
index dc2e64e16413..f3083ff3545d 100644
@@ -9,6 +9,7 @@
 #define __ALIGN_MASK(x, mask)	(((x) + (mask)) & ~(mask))
 #define ALIGN(x, a)		__ALIGN_MASK(x, (typeof(x))(a) - 1)
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+#define ARRAY_AND_SIZE(x)	(x), ARRAY_SIZE(x)
 
 #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
 
Signature · 7 lines
2.30.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#5 lore raw
In reply to Ahmad Fatoum
Quoted 5 lines · Ahmad Fatoum

There are no definitions for __sw_hweight*, so no point in keeping the prototypes around. The scripts version of the header also ultimately tries to access non-existing normal headers, so fix that up as well.

Quoted 9 lines
---
 include/linux/bitops.h                             | 5 -----
 scripts/include/asm-generic/bitops/arch_hweight.h  | 1 -
 scripts/include/asm-generic/bitops/const_hweight.h | 1 -
 scripts/include/asm-generic/bitops/hweight.h       | 3 +--
 scripts/include/linux/bitops.h                     | 4 ----
 5 files changed, 1 insertion(+), 13 deletions(-)
 delete mode 100644 scripts/include/asm-generic/bitops/arch_hweight.h
 delete mode 100644 scripts/include/asm-generic/bitops/const_hweight.h

Applied, thanks

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox