* [PATCH 0/2] x86/boot: Small string.c cleanups
@ 2014-04-25 17:46 Vivek Goyal
2014-04-25 17:46 ` [PATCH 1/2] x86/boot: Do not include boot.h in string.c Vivek Goyal
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Vivek Goyal @ 2014-04-25 17:46 UTC (permalink / raw)
To: linux-kernel, hpa; +Cc: Vivek Goyal
Hi Hpa,
Here are two more small cleanups to boot/string.c code. This makes
inclusion of boot/string.c at other places even simpler.
Thanks
Vivek
Vivek Goyal (2):
x86/boot: Do not include boot.h in string.c
x86/boot: Remove misc.h inclusion from compressed/string.c
arch/x86/boot/compressed/string.c | 4 ----
arch/x86/boot/string.c | 9 ++-------
2 files changed, 2 insertions(+), 11 deletions(-)
--
1.9.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] x86/boot: Do not include boot.h in string.c
2014-04-25 17:46 [PATCH 0/2] x86/boot: Small string.c cleanups Vivek Goyal
@ 2014-04-25 17:46 ` Vivek Goyal
2014-05-08 15:09 ` [tip:x86/boot] x86, boot: " tip-bot for Vivek Goyal
2014-04-25 17:46 ` [PATCH 2/2] x86/boot: Remove misc.h inclusion from compressed/string.c Vivek Goyal
2014-05-08 14:23 ` [PATCH 0/2] x86/boot: Small string.c cleanups Vivek Goyal
2 siblings, 1 reply; 6+ messages in thread
From: Vivek Goyal @ 2014-04-25 17:46 UTC (permalink / raw)
To: linux-kernel, hpa; +Cc: Vivek Goyal
string.c does not require whole of boot.h. Just inclusion of linux/types.h
and ctypes.h seems to be sufficient.
Keep list of stuff being included in string.c to bare minimal so that
string.c can be included in other places easily.
For example, Currently boot/compressed/string.c includes boot/string.c
but looks like it does not want boot/boot.h. Hence there is a define
in boot/compressed/misc.h "define BOOT_BOOT_H" which prevents inclusion
of boot.h in compressed/string.c. And compressed/string.c is forced to
include misc.h just for that reason.
So by removing inclusion of boot.h, we can also get rid of inclusion of
misch.h in compressed/misc.c.
This also enables including of boot/string.c in purgatory/ code relatively
easily.
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---
arch/x86/boot/string.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index 5339040..aca52b8 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -12,7 +12,8 @@
* Very basic string functions
*/
-#include "boot.h"
+#include <linux/types.h>
+#include "ctype.h"
/*
* This file gets included in compressed/string.c which might pull in
--
1.9.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] x86/boot: Remove misc.h inclusion from compressed/string.c
2014-04-25 17:46 [PATCH 0/2] x86/boot: Small string.c cleanups Vivek Goyal
2014-04-25 17:46 ` [PATCH 1/2] x86/boot: Do not include boot.h in string.c Vivek Goyal
@ 2014-04-25 17:46 ` Vivek Goyal
2014-05-08 15:09 ` [tip:x86/boot] x86, boot: Remove misc.h inclusion from compressed /string.c tip-bot for Vivek Goyal
2014-05-08 14:23 ` [PATCH 0/2] x86/boot: Small string.c cleanups Vivek Goyal
2 siblings, 1 reply; 6+ messages in thread
From: Vivek Goyal @ 2014-04-25 17:46 UTC (permalink / raw)
To: linux-kernel, hpa; +Cc: Vivek Goyal
Given the fact that we removed inclusion of boot.h from boot/string.c
does not look like we need misc.h inclusion in compressed/string.c. So
remove it.
misc.h was also pulling in string_32.h which in turn had macros for
memcmp and memcpy. So we don't need to #undef memcmp and memcpy anymore.
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---
arch/x86/boot/compressed/string.c | 4 ----
arch/x86/boot/string.c | 6 ------
2 files changed, 10 deletions(-)
diff --git a/arch/x86/boot/compressed/string.c b/arch/x86/boot/compressed/string.c
index f3c57e3..00e788b 100644
--- a/arch/x86/boot/compressed/string.c
+++ b/arch/x86/boot/compressed/string.c
@@ -1,9 +1,5 @@
-#include "misc.h"
#include "../string.c"
-/* misc.h might pull in string_32.h which has a macro for memcpy. undef that */
-#undef memcpy
-
#ifdef CONFIG_X86_32
void *memcpy(void *dest, const void *src, size_t n)
{
diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index aca52b8..493f3fd 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -15,12 +15,6 @@
#include <linux/types.h>
#include "ctype.h"
-/*
- * This file gets included in compressed/string.c which might pull in
- * string_32.h and which in turn maps memcmp to __builtin_memcmp(). Undo
- * that first.
- */
-#undef memcmp
int memcmp(const void *s1, const void *s2, size_t len)
{
u8 diff;
--
1.9.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] x86/boot: Small string.c cleanups
2014-04-25 17:46 [PATCH 0/2] x86/boot: Small string.c cleanups Vivek Goyal
2014-04-25 17:46 ` [PATCH 1/2] x86/boot: Do not include boot.h in string.c Vivek Goyal
2014-04-25 17:46 ` [PATCH 2/2] x86/boot: Remove misc.h inclusion from compressed/string.c Vivek Goyal
@ 2014-05-08 14:23 ` Vivek Goyal
2 siblings, 0 replies; 6+ messages in thread
From: Vivek Goyal @ 2014-05-08 14:23 UTC (permalink / raw)
To: hpa; +Cc: linux kernel mailing list
Hi Peter,
Can you please include these small cleanup fixes. Please do let me know
if you have any concerns.
Thanks
Vivek
On Fri, Apr 25, 2014 at 01:46:10PM -0400, Vivek Goyal wrote:
> Hi Hpa,
>
> Here are two more small cleanups to boot/string.c code. This makes
> inclusion of boot/string.c at other places even simpler.
>
> Thanks
> Vivek
>
> Vivek Goyal (2):
> x86/boot: Do not include boot.h in string.c
> x86/boot: Remove misc.h inclusion from compressed/string.c
>
> arch/x86/boot/compressed/string.c | 4 ----
> arch/x86/boot/string.c | 9 ++-------
> 2 files changed, 2 insertions(+), 11 deletions(-)
>
> --
> 1.9.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tip:x86/boot] x86, boot: Do not include boot.h in string.c
2014-04-25 17:46 ` [PATCH 1/2] x86/boot: Do not include boot.h in string.c Vivek Goyal
@ 2014-05-08 15:09 ` tip-bot for Vivek Goyal
0 siblings, 0 replies; 6+ messages in thread
From: tip-bot for Vivek Goyal @ 2014-05-08 15:09 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, tglx, vgoyal
Commit-ID: 3d379225c458097d41d104b4f78f40ee97719333
Gitweb: http://git.kernel.org/tip/3d379225c458097d41d104b4f78f40ee97719333
Author: Vivek Goyal <vgoyal@redhat.com>
AuthorDate: Fri, 25 Apr 2014 13:46:11 -0400
Committer: H. Peter Anvin <hpa@zytor.com>
CommitDate: Thu, 8 May 2014 08:00:01 -0700
x86, boot: Do not include boot.h in string.c
string.c does not require whole of boot.h. Just inclusion of linux/types.h
and ctypes.h seems to be sufficient.
Keep list of stuff being included in string.c to bare minimal so that
string.c can be included in other places easily.
For example, Currently boot/compressed/string.c includes boot/string.c
but looks like it does not want boot/boot.h. Hence there is a define
in boot/compressed/misc.h "define BOOT_BOOT_H" which prevents inclusion
of boot.h in compressed/string.c. And compressed/string.c is forced to
include misc.h just for that reason.
So by removing inclusion of boot.h, we can also get rid of inclusion of
misch.h in compressed/misc.c.
This also enables including of boot/string.c in purgatory/ code relatively
easily.
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Link: http://lkml.kernel.org/r/1398447972-27896-2-git-send-email-vgoyal@redhat.com
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
arch/x86/boot/string.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index 5339040..aca52b8 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -12,7 +12,8 @@
* Very basic string functions
*/
-#include "boot.h"
+#include <linux/types.h>
+#include "ctype.h"
/*
* This file gets included in compressed/string.c which might pull in
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [tip:x86/boot] x86, boot: Remove misc.h inclusion from compressed /string.c
2014-04-25 17:46 ` [PATCH 2/2] x86/boot: Remove misc.h inclusion from compressed/string.c Vivek Goyal
@ 2014-05-08 15:09 ` tip-bot for Vivek Goyal
0 siblings, 0 replies; 6+ messages in thread
From: tip-bot for Vivek Goyal @ 2014-05-08 15:09 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, tglx, vgoyal
Commit-ID: a9a17104a112a67a7bf0679b734704c130eb5faa
Gitweb: http://git.kernel.org/tip/a9a17104a112a67a7bf0679b734704c130eb5faa
Author: Vivek Goyal <vgoyal@redhat.com>
AuthorDate: Fri, 25 Apr 2014 13:46:12 -0400
Committer: H. Peter Anvin <hpa@zytor.com>
CommitDate: Thu, 8 May 2014 08:00:06 -0700
x86, boot: Remove misc.h inclusion from compressed/string.c
Given the fact that we removed inclusion of boot.h from boot/string.c
does not look like we need misc.h inclusion in compressed/string.c. So
remove it.
misc.h was also pulling in string_32.h which in turn had macros for
memcmp and memcpy. So we don't need to #undef memcmp and memcpy anymore.
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Link: http://lkml.kernel.org/r/1398447972-27896-3-git-send-email-vgoyal@redhat.com
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
arch/x86/boot/compressed/string.c | 4 ----
arch/x86/boot/string.c | 6 ------
2 files changed, 10 deletions(-)
diff --git a/arch/x86/boot/compressed/string.c b/arch/x86/boot/compressed/string.c
index f3c57e3..00e788b 100644
--- a/arch/x86/boot/compressed/string.c
+++ b/arch/x86/boot/compressed/string.c
@@ -1,9 +1,5 @@
-#include "misc.h"
#include "../string.c"
-/* misc.h might pull in string_32.h which has a macro for memcpy. undef that */
-#undef memcpy
-
#ifdef CONFIG_X86_32
void *memcpy(void *dest, const void *src, size_t n)
{
diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index aca52b8..493f3fd 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -15,12 +15,6 @@
#include <linux/types.h>
#include "ctype.h"
-/*
- * This file gets included in compressed/string.c which might pull in
- * string_32.h and which in turn maps memcmp to __builtin_memcmp(). Undo
- * that first.
- */
-#undef memcmp
int memcmp(const void *s1, const void *s2, size_t len)
{
u8 diff;
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-05-08 15:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-25 17:46 [PATCH 0/2] x86/boot: Small string.c cleanups Vivek Goyal
2014-04-25 17:46 ` [PATCH 1/2] x86/boot: Do not include boot.h in string.c Vivek Goyal
2014-05-08 15:09 ` [tip:x86/boot] x86, boot: " tip-bot for Vivek Goyal
2014-04-25 17:46 ` [PATCH 2/2] x86/boot: Remove misc.h inclusion from compressed/string.c Vivek Goyal
2014-05-08 15:09 ` [tip:x86/boot] x86, boot: Remove misc.h inclusion from compressed /string.c tip-bot for Vivek Goyal
2014-05-08 14:23 ` [PATCH 0/2] x86/boot: Small string.c cleanups Vivek Goyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox