Commit 66a5c40f authored by Tanzir Hasan's avatar Tanzir Hasan Committed by Kees Cook
Browse files

kernel.h: removed REPEAT_BYTE from kernel.h



This patch creates wordpart.h and includes it in asm/word-at-a-time.h
for all architectures. WORD_AT_A_TIME_CONSTANTS depends on kernel.h
because of REPEAT_BYTE. Moving this to another header and including it
where necessary allows us to not include the bloated kernel.h. Making
this implicit dependency on REPEAT_BYTE explicit allows for later
improvements in the lib/string.c inclusion list.

Suggested-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Suggested-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarTanzir Hasan <tanzirh@google.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20231226-libstringheader-v6-1-80aa08c7652c@google.com


Signed-off-by: default avatarKees Cook <keescook@chromium.org>
parent 735b7636
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -8,7 +8,8 @@
 * Little-endian word-at-a-time zero byte handling.
 * Heavily based on the x86 algorithm.
 */
#include <linux/kernel.h>
#include <linux/bitops.h>
#include <linux/wordpart.h>

struct word_at_a_time {
	const unsigned long one_bits, high_bits;
+2 −1
Original line number Diff line number Diff line
@@ -9,7 +9,8 @@

#ifndef __AARCH64EB__

#include <linux/kernel.h>
#include <linux/bitops.h>
#include <linux/wordpart.h>

struct word_at_a_time {
	const unsigned long one_bits, high_bits;
+2 −2
Original line number Diff line number Diff line
@@ -4,8 +4,8 @@
/*
 * Word-at-a-time interfaces for PowerPC.
 */

#include <linux/kernel.h>
#include <linux/bitops.h>
#include <linux/wordpart.h>
#include <asm/asm-compat.h>
#include <asm/extable.h>

+2 −1
Original line number Diff line number Diff line
@@ -10,7 +10,8 @@


#include <asm/asm-extable.h>
#include <linux/kernel.h>
#include <linux/bitops.h>
#include <linux/wordpart.h>

struct word_at_a_time {
	const unsigned long one_bits, high_bits;
+2 −1
Original line number Diff line number Diff line
@@ -2,7 +2,8 @@
#ifndef _ASM_WORD_AT_A_TIME_H
#define _ASM_WORD_AT_A_TIME_H

#include <linux/kernel.h>
#include <linux/bitops.h>
#include <linux/wordpart.h>
#include <asm/asm-extable.h>
#include <asm/bitsperlong.h>

Loading