* [PATCH 4/4] sh/kexec: Fix kexec build warning
2013-12-12 0:18 ` Geoff Levand
@ 2013-12-12 0:18 ` Geoff Levand
-1 siblings, 0 replies; 27+ messages in thread
From: Geoff Levand @ 2013-12-12 0:18 UTC (permalink / raw)
To: linux-sh
Add a cast to a printk argument to suppress a type mismatch compiler warning.
Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
---
arch/sh/kernel/machine_kexec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c
index 9fea49f..b7e65a8 100644
--- a/arch/sh/kernel/machine_kexec.c
+++ b/arch/sh/kernel/machine_kexec.c
@@ -60,7 +60,7 @@ static void kexec_info(struct kimage *image)
i,
(unsigned int)image->segment[i].mem,
(unsigned int)image->segment[i].mem +
- image->segment[i].memsz,
+ (unsigned int)image->segment[i].memsz,
(unsigned int)image->segment[i].memsz);
}
printk(" start : 0x%08x\n\n", (unsigned int)image->start);
--
1.8.1.2
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 0/4] Minor fixes and improvements for kexec
@ 2013-12-12 0:18 ` Geoff Levand
0 siblings, 0 replies; 27+ messages in thread
From: Geoff Levand @ 2013-12-12 0:18 UTC (permalink / raw)
To: Eric Biederman; +Cc: linux-sh, kexec, Paul Mundt, Paul Mackerras, linuxppc-dev
Hi Eric,
Here are a few minor fixes and improvements for kexec. Please consider.
-Geoff
The following changes since commit 374b105797c3d4f29c685f3be535c35f5689b30e:
Linux 3.13-rc3 (2013-12-06 09:34:04 -0800)
are available in the git repository at:
git://git.linaro.org/people/geoff.levand/linux-kexec.git for-kexec
for you to fetch changes up to 594a3d26aac66e9668edc81d7bfb4e801575514f:
sh/kexec: Fix kexec build warning (2013-12-11 16:03:27 -0800)
----------------------------------------------------------------
Geoff Levand (4):
kexec: Simplify conditional
kexec: Add IND_FLAGS macro
powerpc/kexec: Use global IND_FLAGS macro
sh/kexec: Fix kexec build warning
arch/powerpc/kernel/machine_kexec_64.c | 2 --
arch/sh/kernel/machine_kexec.c | 2 +-
include/linux/kexec.h | 1 +
kernel/kexec.c | 17 ++++++++++-------
4 files changed, 12 insertions(+), 10 deletions(-)
--
1.8.1.2
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 3/4] powerpc/kexec: Use global IND_FLAGS macro
2013-12-12 0:18 ` Geoff Levand
@ 2013-12-12 0:18 ` Geoff Levand
-1 siblings, 0 replies; 27+ messages in thread
From: Geoff Levand @ 2013-12-12 0:18 UTC (permalink / raw)
To: Eric Biederman; +Cc: kexec, linuxppc-dev, Paul Mackerras
linux/kexec.h now defines an IND_FLAGS macro. Remove the local powerpc
definition and use the generic one.
Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
---
arch/powerpc/kernel/machine_kexec_64.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
index be4e6d6..1fab1f0 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -96,8 +96,6 @@ int default_machine_kexec_prepare(struct kimage *image)
return 0;
}
-#define IND_FLAGS (IND_DESTINATION | IND_INDIRECTION | IND_DONE | IND_SOURCE)
-
static void copy_segments(unsigned long ind)
{
unsigned long entry;
--
1.8.1.2
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 2/4] kexec: Add IND_FLAGS macro
2013-12-12 0:18 ` Geoff Levand
@ 2013-12-12 0:18 ` Geoff Levand
-1 siblings, 0 replies; 27+ messages in thread
From: Geoff Levand @ 2013-12-12 0:18 UTC (permalink / raw)
To: Eric Biederman; +Cc: kexec, linuxppc-dev, Paul Mackerras
Add a new kexec preprocessor macro IND_FLAGS, which is the bitwise OR of
all the possible kexec IND_ kimage_entry indirection flags.
Having this macro allows for simplified code in the prosessing of the
kexec kimage_entry items.
Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
---
include/linux/kexec.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index d78d28a..f755ec3 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -67,6 +67,7 @@ typedef unsigned long kimage_entry_t;
#define IND_INDIRECTION 0x2
#define IND_DONE 0x4
#define IND_SOURCE 0x8
+#define IND_FLAGS (IND_DESTINATION | IND_INDIRECTION | IND_DONE | IND_SOURCE)
struct kexec_segment {
void __user *buf;
--
1.8.1.2
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 1/4] kexec: Simplify conditional
2013-12-12 0:18 ` Geoff Levand
(?)
@ 2013-12-12 0:18 ` Geoff Levand
2013-12-12 1:32 ` Zhang Yanfei
-1 siblings, 1 reply; 27+ messages in thread
From: Geoff Levand @ 2013-12-12 0:18 UTC (permalink / raw)
To: Eric Biederman; +Cc: kexec
Simplify the code around one of the conditionals in the kexec_load
syscall routine.
The original code was confusing with a redundant check on KEXEC_ON_CRASH
and comments outside of the conditional block. This change switches the
order of the conditional check, and cleans up the comments for the
conditional. There is no functional change to the code.
Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
---
kernel/kexec.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/kernel/kexec.c b/kernel/kexec.c
index 490afc0..89a6fa3 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -980,19 +980,22 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
if (nr_segments > 0) {
unsigned long i;
- /* Loading another kernel to reboot into */
- if ((flags & KEXEC_ON_CRASH) == 0)
- result = kimage_normal_alloc(&image, entry,
- nr_segments, segments);
- /* Loading another kernel to switch to if this one crashes */
- else if (flags & KEXEC_ON_CRASH) {
- /* Free any current crash dump kernel before
+ if (flags & KEXEC_ON_CRASH) {
+ /*
+ * Loading another kernel to switch to if this one
+ * crashes. Free any current crash dump kernel before
* we corrupt it.
*/
+
kimage_free(xchg(&kexec_crash_image, NULL));
result = kimage_crash_alloc(&image, entry,
nr_segments, segments);
crash_map_reserved_pages();
+ } else {
+ /* Loading another kernel to reboot into. */
+
+ result = kimage_normal_alloc(&image, entry,
+ nr_segments, segments);
}
if (result)
goto out;
--
1.8.1.2
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 4/4] sh/kexec: Fix kexec build warning
@ 2013-12-12 0:18 ` Geoff Levand
0 siblings, 0 replies; 27+ messages in thread
From: Geoff Levand @ 2013-12-12 0:18 UTC (permalink / raw)
To: Eric Biederman; +Cc: Paul Mundt, kexec, linux-sh
Add a cast to a printk argument to suppress a type mismatch compiler warning.
Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
---
arch/sh/kernel/machine_kexec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c
index 9fea49f..b7e65a8 100644
--- a/arch/sh/kernel/machine_kexec.c
+++ b/arch/sh/kernel/machine_kexec.c
@@ -60,7 +60,7 @@ static void kexec_info(struct kimage *image)
i,
(unsigned int)image->segment[i].mem,
(unsigned int)image->segment[i].mem +
- image->segment[i].memsz,
+ (unsigned int)image->segment[i].memsz,
(unsigned int)image->segment[i].memsz);
}
printk(" start : 0x%08x\n\n", (unsigned int)image->start);
--
1.8.1.2
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 2/4] kexec: Add IND_FLAGS macro
@ 2013-12-12 0:18 ` Geoff Levand
0 siblings, 0 replies; 27+ messages in thread
From: Geoff Levand @ 2013-12-12 0:18 UTC (permalink / raw)
To: Eric Biederman
Cc: Benjamin Herrenschmidt, kexec, linuxppc-dev, Paul Mackerras
Add a new kexec preprocessor macro IND_FLAGS, which is the bitwise OR of
all the possible kexec IND_ kimage_entry indirection flags.
Having this macro allows for simplified code in the prosessing of the
kexec kimage_entry items.
Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
---
include/linux/kexec.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index d78d28a..f755ec3 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -67,6 +67,7 @@ typedef unsigned long kimage_entry_t;
#define IND_INDIRECTION 0x2
#define IND_DONE 0x4
#define IND_SOURCE 0x8
+#define IND_FLAGS (IND_DESTINATION | IND_INDIRECTION | IND_DONE | IND_SOURCE)
struct kexec_segment {
void __user *buf;
--
1.8.1.2
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 0/4] Minor fixes and improvements for kexec
@ 2013-12-12 0:18 ` Geoff Levand
0 siblings, 0 replies; 27+ messages in thread
From: Geoff Levand @ 2013-12-12 0:18 UTC (permalink / raw)
To: Eric Biederman
Cc: linux-sh, Benjamin Herrenschmidt, kexec, Paul Mundt,
Paul Mackerras, linuxppc-dev
Hi Eric,
Here are a few minor fixes and improvements for kexec. Please consider.
-Geoff
The following changes since commit 374b105797c3d4f29c685f3be535c35f5689b30e:
Linux 3.13-rc3 (2013-12-06 09:34:04 -0800)
are available in the git repository at:
git://git.linaro.org/people/geoff.levand/linux-kexec.git for-kexec
for you to fetch changes up to 594a3d26aac66e9668edc81d7bfb4e801575514f:
sh/kexec: Fix kexec build warning (2013-12-11 16:03:27 -0800)
----------------------------------------------------------------
Geoff Levand (4):
kexec: Simplify conditional
kexec: Add IND_FLAGS macro
powerpc/kexec: Use global IND_FLAGS macro
sh/kexec: Fix kexec build warning
arch/powerpc/kernel/machine_kexec_64.c | 2 --
arch/sh/kernel/machine_kexec.c | 2 +-
include/linux/kexec.h | 1 +
kernel/kexec.c | 17 ++++++++++-------
4 files changed, 12 insertions(+), 10 deletions(-)
--
1.8.1.2
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 3/4] powerpc/kexec: Use global IND_FLAGS macro
@ 2013-12-12 0:18 ` Geoff Levand
0 siblings, 0 replies; 27+ messages in thread
From: Geoff Levand @ 2013-12-12 0:18 UTC (permalink / raw)
To: Eric Biederman
Cc: Benjamin Herrenschmidt, kexec, linuxppc-dev, Paul Mackerras
linux/kexec.h now defines an IND_FLAGS macro. Remove the local powerpc
definition and use the generic one.
Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
---
arch/powerpc/kernel/machine_kexec_64.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
index be4e6d6..1fab1f0 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -96,8 +96,6 @@ int default_machine_kexec_prepare(struct kimage *image)
return 0;
}
-#define IND_FLAGS (IND_DESTINATION | IND_INDIRECTION | IND_DONE | IND_SOURCE)
-
static void copy_segments(unsigned long ind)
{
unsigned long entry;
--
1.8.1.2
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 1/4] kexec: Simplify conditional
2013-12-12 0:18 ` [PATCH 1/4] kexec: Simplify conditional Geoff Levand
@ 2013-12-12 1:32 ` Zhang Yanfei
2013-12-17 0:45 ` Andrew Morton
0 siblings, 1 reply; 27+ messages in thread
From: Zhang Yanfei @ 2013-12-12 1:32 UTC (permalink / raw)
To: Geoff Levand; +Cc: Andrew Morton, kexec, Eric Biederman
Add CCing Andrew Morton
On 12/12/2013 08:18 AM, Geoff Levand wrote:
> Simplify the code around one of the conditionals in the kexec_load
> syscall routine.
>
> The original code was confusing with a redundant check on KEXEC_ON_CRASH
> and comments outside of the conditional block. This change switches the
> order of the conditional check, and cleans up the comments for the
> conditional. There is no functional change to the code.
This looks good.
Reviewed-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
minor comments below.
>
> Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
> ---
> kernel/kexec.c | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/kernel/kexec.c b/kernel/kexec.c
> index 490afc0..89a6fa3 100644
> --- a/kernel/kexec.c
> +++ b/kernel/kexec.c
> @@ -980,19 +980,22 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
> if (nr_segments > 0) {
> unsigned long i;
>
> - /* Loading another kernel to reboot into */
> - if ((flags & KEXEC_ON_CRASH) == 0)
> - result = kimage_normal_alloc(&image, entry,
> - nr_segments, segments);
> - /* Loading another kernel to switch to if this one crashes */
> - else if (flags & KEXEC_ON_CRASH) {
> - /* Free any current crash dump kernel before
> + if (flags & KEXEC_ON_CRASH) {
> + /*
> + * Loading another kernel to switch to if this one
> + * crashes. Free any current crash dump kernel before
> * we corrupt it.
> */
> +
This empty line is not necessary, I think. But no big deal.
> kimage_free(xchg(&kexec_crash_image, NULL));
> result = kimage_crash_alloc(&image, entry,
> nr_segments, segments);
> crash_map_reserved_pages();
> + } else {
> + /* Loading another kernel to reboot into. */
> +
ditto.
> + result = kimage_normal_alloc(&image, entry,
> + nr_segments, segments);
> }
> if (result)
> goto out;
>
--
Thanks.
Zhang Yanfei
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/4] kexec: Add IND_FLAGS macro
2013-12-12 0:18 ` Geoff Levand
@ 2013-12-12 1:35 ` Zhang Yanfei
-1 siblings, 0 replies; 27+ messages in thread
From: Zhang Yanfei @ 2013-12-12 1:35 UTC (permalink / raw)
To: Geoff Levand; +Cc: linuxppc-dev, kexec, Eric Biederman, Paul Mackerras
Hello
On 12/12/2013 08:18 AM, Geoff Levand wrote:
> Add a new kexec preprocessor macro IND_FLAGS, which is the bitwise OR of
> all the possible kexec IND_ kimage_entry indirection flags.
>
> Having this macro allows for simplified code in the prosessing of the
> kexec kimage_entry items.
Where? I didn't see any place you use this macro to help simplification.
Thanks
Zhang
>
> Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
> ---
> include/linux/kexec.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/kexec.h b/include/linux/kexec.h
> index d78d28a..f755ec3 100644
> --- a/include/linux/kexec.h
> +++ b/include/linux/kexec.h
> @@ -67,6 +67,7 @@ typedef unsigned long kimage_entry_t;
> #define IND_INDIRECTION 0x2
> #define IND_DONE 0x4
> #define IND_SOURCE 0x8
> +#define IND_FLAGS (IND_DESTINATION | IND_INDIRECTION | IND_DONE | IND_SOURCE)
>
> struct kexec_segment {
> void __user *buf;
>
--
Thanks.
Zhang Yanfei
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/4] kexec: Add IND_FLAGS macro
@ 2013-12-12 1:35 ` Zhang Yanfei
0 siblings, 0 replies; 27+ messages in thread
From: Zhang Yanfei @ 2013-12-12 1:35 UTC (permalink / raw)
To: Geoff Levand
Cc: Benjamin Herrenschmidt, linuxppc-dev, kexec, Eric Biederman,
Paul Mackerras
Hello
On 12/12/2013 08:18 AM, Geoff Levand wrote:
> Add a new kexec preprocessor macro IND_FLAGS, which is the bitwise OR of
> all the possible kexec IND_ kimage_entry indirection flags.
>
> Having this macro allows for simplified code in the prosessing of the
> kexec kimage_entry items.
Where? I didn't see any place you use this macro to help simplification.
Thanks
Zhang
>
> Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
> ---
> include/linux/kexec.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/kexec.h b/include/linux/kexec.h
> index d78d28a..f755ec3 100644
> --- a/include/linux/kexec.h
> +++ b/include/linux/kexec.h
> @@ -67,6 +67,7 @@ typedef unsigned long kimage_entry_t;
> #define IND_INDIRECTION 0x2
> #define IND_DONE 0x4
> #define IND_SOURCE 0x8
> +#define IND_FLAGS (IND_DESTINATION | IND_INDIRECTION | IND_DONE | IND_SOURCE)
>
> struct kexec_segment {
> void __user *buf;
>
--
Thanks.
Zhang Yanfei
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 0/4] Minor fixes and improvements for kexec
2013-12-12 0:18 ` Geoff Levand
(?)
@ 2013-12-12 5:11 ` Simon Horman
-1 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2013-12-12 5:11 UTC (permalink / raw)
To: Geoff Levand
Cc: linux-sh, kexec, Paul Mundt, Paul Mackerras, Eric Biederman,
linuxppc-dev
On Thu, Dec 12, 2013 at 12:18:56AM +0000, Geoff Levand wrote:
> Hi Eric,
>
> Here are a few minor fixes and improvements for kexec. Please consider.
FWIW,
Reviewed-by: Simon Horman <horms@verge.net.au>
>
> -Geoff
>
> The following changes since commit 374b105797c3d4f29c685f3be535c35f5689b30e:
>
> Linux 3.13-rc3 (2013-12-06 09:34:04 -0800)
>
> are available in the git repository at:
>
> git://git.linaro.org/people/geoff.levand/linux-kexec.git for-kexec
>
> for you to fetch changes up to 594a3d26aac66e9668edc81d7bfb4e801575514f:
>
> sh/kexec: Fix kexec build warning (2013-12-11 16:03:27 -0800)
>
> ----------------------------------------------------------------
> Geoff Levand (4):
> kexec: Simplify conditional
> kexec: Add IND_FLAGS macro
> powerpc/kexec: Use global IND_FLAGS macro
> sh/kexec: Fix kexec build warning
>
> arch/powerpc/kernel/machine_kexec_64.c | 2 --
> arch/sh/kernel/machine_kexec.c | 2 +-
> include/linux/kexec.h | 1 +
> kernel/kexec.c | 17 ++++++++++-------
> 4 files changed, 12 insertions(+), 10 deletions(-)
>
> --
> 1.8.1.2
>
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 0/4] Minor fixes and improvements for kexec
@ 2013-12-12 5:11 ` Simon Horman
0 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2013-12-12 5:11 UTC (permalink / raw)
To: Geoff Levand
Cc: linux-sh, kexec, Paul Mundt, Paul Mackerras, Eric Biederman,
linuxppc-dev
On Thu, Dec 12, 2013 at 12:18:56AM +0000, Geoff Levand wrote:
> Hi Eric,
>
> Here are a few minor fixes and improvements for kexec. Please consider.
FWIW,
Reviewed-by: Simon Horman <horms@verge.net.au>
>
> -Geoff
>
> The following changes since commit 374b105797c3d4f29c685f3be535c35f5689b30e:
>
> Linux 3.13-rc3 (2013-12-06 09:34:04 -0800)
>
> are available in the git repository at:
>
> git://git.linaro.org/people/geoff.levand/linux-kexec.git for-kexec
>
> for you to fetch changes up to 594a3d26aac66e9668edc81d7bfb4e801575514f:
>
> sh/kexec: Fix kexec build warning (2013-12-11 16:03:27 -0800)
>
> ----------------------------------------------------------------
> Geoff Levand (4):
> kexec: Simplify conditional
> kexec: Add IND_FLAGS macro
> powerpc/kexec: Use global IND_FLAGS macro
> sh/kexec: Fix kexec build warning
>
> arch/powerpc/kernel/machine_kexec_64.c | 2 --
> arch/sh/kernel/machine_kexec.c | 2 +-
> include/linux/kexec.h | 1 +
> kernel/kexec.c | 17 ++++++++++-------
> 4 files changed, 12 insertions(+), 10 deletions(-)
>
> --
> 1.8.1.2
>
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 0/4] Minor fixes and improvements for kexec
@ 2013-12-12 5:11 ` Simon Horman
0 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2013-12-12 5:11 UTC (permalink / raw)
To: Geoff Levand
Cc: linux-sh, Benjamin Herrenschmidt, kexec, Paul Mundt,
Paul Mackerras, Eric Biederman, linuxppc-dev
On Thu, Dec 12, 2013 at 12:18:56AM +0000, Geoff Levand wrote:
> Hi Eric,
>
> Here are a few minor fixes and improvements for kexec. Please consider.
FWIW,
Reviewed-by: Simon Horman <horms@verge.net.au>
>
> -Geoff
>
> The following changes since commit 374b105797c3d4f29c685f3be535c35f5689b30e:
>
> Linux 3.13-rc3 (2013-12-06 09:34:04 -0800)
>
> are available in the git repository at:
>
> git://git.linaro.org/people/geoff.levand/linux-kexec.git for-kexec
>
> for you to fetch changes up to 594a3d26aac66e9668edc81d7bfb4e801575514f:
>
> sh/kexec: Fix kexec build warning (2013-12-11 16:03:27 -0800)
>
> ----------------------------------------------------------------
> Geoff Levand (4):
> kexec: Simplify conditional
> kexec: Add IND_FLAGS macro
> powerpc/kexec: Use global IND_FLAGS macro
> sh/kexec: Fix kexec build warning
>
> arch/powerpc/kernel/machine_kexec_64.c | 2 --
> arch/sh/kernel/machine_kexec.c | 2 +-
> include/linux/kexec.h | 1 +
> kernel/kexec.c | 17 ++++++++++-------
> 4 files changed, 12 insertions(+), 10 deletions(-)
>
> --
> 1.8.1.2
>
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
>
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/4] sh/kexec: Fix kexec build warning
2013-12-12 0:18 ` Geoff Levand
@ 2013-12-12 14:48 ` Geert Uytterhoeven
-1 siblings, 0 replies; 27+ messages in thread
From: Geert Uytterhoeven @ 2013-12-12 14:48 UTC (permalink / raw)
To: linux-sh
Hi Geoff,
On Thu, Dec 12, 2013 at 1:18 AM, Geoff Levand <geoff@infradead.org> wrote:
> Add a cast to a printk argument to suppress a type mismatch compiler warning.
>
> Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
> ---
> arch/sh/kernel/machine_kexec.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c
> index 9fea49f..b7e65a8 100644
> --- a/arch/sh/kernel/machine_kexec.c
> +++ b/arch/sh/kernel/machine_kexec.c
> @@ -60,7 +60,7 @@ static void kexec_info(struct kimage *image)
> i,
> (unsigned int)image->segment[i].mem,
> (unsigned int)image->segment[i].mem +
> - image->segment[i].memsz,
> + (unsigned int)image->segment[i].memsz,
> (unsigned int)image->segment[i].memsz);
> }
> printk(" start : 0x%08x\n\n", (unsigned int)image->start);
Wouldn't it be better to remove all casts and correct the printf-style
format specifiers instead?
- mem and start are unsigned long, hence use "0x%08lx",
- memsz is size_t, hence use "0x%08zx".
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/4] sh/kexec: Fix kexec build warning
@ 2013-12-12 14:48 ` Geert Uytterhoeven
0 siblings, 0 replies; 27+ messages in thread
From: Geert Uytterhoeven @ 2013-12-12 14:48 UTC (permalink / raw)
To: Geoff Levand; +Cc: Paul Mundt, kexec, Eric Biederman, Linux-sh list
Hi Geoff,
On Thu, Dec 12, 2013 at 1:18 AM, Geoff Levand <geoff@infradead.org> wrote:
> Add a cast to a printk argument to suppress a type mismatch compiler warning.
>
> Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
> ---
> arch/sh/kernel/machine_kexec.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c
> index 9fea49f..b7e65a8 100644
> --- a/arch/sh/kernel/machine_kexec.c
> +++ b/arch/sh/kernel/machine_kexec.c
> @@ -60,7 +60,7 @@ static void kexec_info(struct kimage *image)
> i,
> (unsigned int)image->segment[i].mem,
> (unsigned int)image->segment[i].mem +
> - image->segment[i].memsz,
> + (unsigned int)image->segment[i].memsz,
> (unsigned int)image->segment[i].memsz);
> }
> printk(" start : 0x%08x\n\n", (unsigned int)image->start);
Wouldn't it be better to remove all casts and correct the printf-style
format specifiers instead?
- mem and start are unsigned long, hence use "0x%08lx",
- memsz is size_t, hence use "0x%08zx".
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/4] sh/kexec: Fix kexec build warning
2013-12-12 14:48 ` Geert Uytterhoeven
@ 2013-12-12 19:30 ` Geoff Levand
-1 siblings, 0 replies; 27+ messages in thread
From: Geoff Levand @ 2013-12-12 19:30 UTC (permalink / raw)
To: linux-sh
Hi,
On Thu, 2013-12-12 at 15:48 +0100, Geert Uytterhoeven wrote:
> On Thu, Dec 12, 2013 at 1:18 AM, Geoff Levand <geoff@infradead.org> wrote:
> > - image->segment[i].memsz,
> > + (unsigned int)image->segment[i].memsz,e->start);
>
> Wouldn't it be better to remove all casts and correct the printf-style
> format specifiers instead?
That would be better, I'll make a new patch.
Thanks Geert!
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/4] sh/kexec: Fix kexec build warning
@ 2013-12-12 19:30 ` Geoff Levand
0 siblings, 0 replies; 27+ messages in thread
From: Geoff Levand @ 2013-12-12 19:30 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Paul Mundt, kexec, Eric Biederman, Linux-sh list
Hi,
On Thu, 2013-12-12 at 15:48 +0100, Geert Uytterhoeven wrote:
> On Thu, Dec 12, 2013 at 1:18 AM, Geoff Levand <geoff@infradead.org> wrote:
> > - image->segment[i].memsz,
> > + (unsigned int)image->segment[i].memsz,e->start);
>
> Wouldn't it be better to remove all casts and correct the printf-style
> format specifiers instead?
That would be better, I'll make a new patch.
Thanks Geert!
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/4] kexec: Add IND_FLAGS macro
2013-12-12 1:35 ` Zhang Yanfei
@ 2013-12-12 19:33 ` Geoff Levand
-1 siblings, 0 replies; 27+ messages in thread
From: Geoff Levand @ 2013-12-12 19:33 UTC (permalink / raw)
To: Zhang Yanfei; +Cc: linuxppc-dev, kexec, Eric Biederman, Paul Mackerras
Hi Zhang,
On Thu, 2013-12-12 at 09:35 +0800, Zhang Yanfei wrote:
> On 12/12/2013 08:18 AM, Geoff Levand wrote:
> > Add a new kexec preprocessor macro IND_FLAGS, which is the bitwise OR of
> > all the possible kexec IND_ kimage_entry indirection flags.
> >
> > Having this macro allows for simplified code in the prosessing of the
> > kexec kimage_entry items.
>
> Where? I didn't see any place you use this macro to help simplification.
As in powerpc, it allows constructions like this:
switch (entry & IND_FLAGS) {
case IND_DESTINATION:
...
case IND_INDIRECTION:
...
}
-Geoff
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/4] kexec: Add IND_FLAGS macro
@ 2013-12-12 19:33 ` Geoff Levand
0 siblings, 0 replies; 27+ messages in thread
From: Geoff Levand @ 2013-12-12 19:33 UTC (permalink / raw)
To: Zhang Yanfei
Cc: Benjamin Herrenschmidt, linuxppc-dev, kexec, Eric Biederman,
Paul Mackerras
Hi Zhang,
On Thu, 2013-12-12 at 09:35 +0800, Zhang Yanfei wrote:
> On 12/12/2013 08:18 AM, Geoff Levand wrote:
> > Add a new kexec preprocessor macro IND_FLAGS, which is the bitwise OR of
> > all the possible kexec IND_ kimage_entry indirection flags.
> >
> > Having this macro allows for simplified code in the prosessing of the
> > kexec kimage_entry items.
>
> Where? I didn't see any place you use this macro to help simplification.
As in powerpc, it allows constructions like this:
switch (entry & IND_FLAGS) {
case IND_DESTINATION:
...
case IND_INDIRECTION:
...
}
-Geoff
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH v2 4/4] sh/kexec: Fix kexec build warning
2013-12-12 0:18 ` Geoff Levand
@ 2013-12-12 19:51 ` Geoff Levand
-1 siblings, 0 replies; 27+ messages in thread
From: Geoff Levand @ 2013-12-12 19:51 UTC (permalink / raw)
To: linux-sh
Change the format specifiers in the kexec_info routine to match the data
types. Eliminates the need for type casts and fixes a type mismatch
compiler warning. Also replace indenting spaces with a tab character.
Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
---
V2:
Change from type cast fix to format specifier fix.
arch/sh/kernel/machine_kexec.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c
index 9fea49f..8195c35 100644
--- a/arch/sh/kernel/machine_kexec.c
+++ b/arch/sh/kernel/machine_kexec.c
@@ -53,17 +53,17 @@ void machine_kexec_cleanup(struct kimage *image)
static void kexec_info(struct kimage *image)
{
- int i;
+ int i;
printk("kexec information\n");
for (i = 0; i < image->nr_segments; i++) {
- printk(" segment[%d]: 0x%08x - 0x%08x (0x%08x)\n",
+ printk(" segment[%d]: 0x%08lx - 0x%08lx (0x%08zx)\n",
i,
- (unsigned int)image->segment[i].mem,
- (unsigned int)image->segment[i].mem +
- image->segment[i].memsz,
- (unsigned int)image->segment[i].memsz);
+ image->segment[i].mem,
+ image->segment[i].mem +
+ image->segment[i].memsz,
+ image->segment[i].memsz);
}
- printk(" start : 0x%08x\n\n", (unsigned int)image->start);
+ printk(" start : 0x%08lx\n\n", image->start);
}
/*
--
1.8.1.2
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH v2 4/4] sh/kexec: Fix kexec build warning
@ 2013-12-12 19:51 ` Geoff Levand
0 siblings, 0 replies; 27+ messages in thread
From: Geoff Levand @ 2013-12-12 19:51 UTC (permalink / raw)
To: Eric Biederman; +Cc: Geert Uytterhoeven, Paul Mundt, kexec, linux-sh
Change the format specifiers in the kexec_info routine to match the data
types. Eliminates the need for type casts and fixes a type mismatch
compiler warning. Also replace indenting spaces with a tab character.
Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
---
V2:
Change from type cast fix to format specifier fix.
arch/sh/kernel/machine_kexec.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c
index 9fea49f..8195c35 100644
--- a/arch/sh/kernel/machine_kexec.c
+++ b/arch/sh/kernel/machine_kexec.c
@@ -53,17 +53,17 @@ void machine_kexec_cleanup(struct kimage *image)
static void kexec_info(struct kimage *image)
{
- int i;
+ int i;
printk("kexec information\n");
for (i = 0; i < image->nr_segments; i++) {
- printk(" segment[%d]: 0x%08x - 0x%08x (0x%08x)\n",
+ printk(" segment[%d]: 0x%08lx - 0x%08lx (0x%08zx)\n",
i,
- (unsigned int)image->segment[i].mem,
- (unsigned int)image->segment[i].mem +
- image->segment[i].memsz,
- (unsigned int)image->segment[i].memsz);
+ image->segment[i].mem,
+ image->segment[i].mem +
+ image->segment[i].memsz,
+ image->segment[i].memsz);
}
- printk(" start : 0x%08x\n\n", (unsigned int)image->start);
+ printk(" start : 0x%08lx\n\n", image->start);
}
/*
--
1.8.1.2
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 1/4] kexec: Simplify conditional
2013-12-12 1:32 ` Zhang Yanfei
@ 2013-12-17 0:45 ` Andrew Morton
0 siblings, 0 replies; 27+ messages in thread
From: Andrew Morton @ 2013-12-17 0:45 UTC (permalink / raw)
To: Zhang Yanfei; +Cc: Geoff Levand, kexec, Eric Biederman
On Thu, 12 Dec 2013 09:32:02 +0800 Zhang Yanfei <zhangyanfei@cn.fujitsu.com> wrote:
> Add CCing Andrew Morton
I'm not on kexec@lists.infradead.org. (Well, I am now!).
> On 12/12/2013 08:18 AM, Geoff Levand wrote:
> > Simplify the code around one of the conditionals in the kexec_load
> > syscall routine.
> >
> > The original code was confusing with a redundant check on KEXEC_ON_CRASH
> > and comments outside of the conditional block. This change switches the
> > order of the conditional check, and cleans up the comments for the
> > conditional. There is no functional change to the code.
>
> This looks good.
>
> Reviewed-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
>
> minor comments below.
Please cc me on the resend?
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 0/4] Minor fixes and improvements for kexec
2013-12-12 0:18 ` Geoff Levand
(?)
@ 2013-12-17 5:37 ` WANG Chao
-1 siblings, 0 replies; 27+ messages in thread
From: WANG Chao @ 2013-12-17 5:37 UTC (permalink / raw)
To: Geoff Levand
Cc: linux-sh, kexec, Paul Mundt, Paul Mackerras, Eric Biederman,
linuxppc-dev
On 12/12/13 at 12:18am, Geoff Levand wrote:
> Hi Eric,
>
> Here are a few minor fixes and improvements for kexec. Please consider.
>
> -Geoff
>
> The following changes since commit 374b105797c3d4f29c685f3be535c35f5689b30e:
>
> Linux 3.13-rc3 (2013-12-06 09:34:04 -0800)
>
> are available in the git repository at:
>
> git://git.linaro.org/people/geoff.levand/linux-kexec.git for-kexec
>
> for you to fetch changes up to 594a3d26aac66e9668edc81d7bfb4e801575514f:
>
> sh/kexec: Fix kexec build warning (2013-12-11 16:03:27 -0800)
>
> ----------------------------------------------------------------
> Geoff Levand (4):
> kexec: Simplify conditional
> kexec: Add IND_FLAGS macro
> powerpc/kexec: Use global IND_FLAGS macro
> sh/kexec: Fix kexec build warning
For this series (besides 4/4 v2):
Acked-by: WANG Chao <chaowang@redhat.com>
>
> arch/powerpc/kernel/machine_kexec_64.c | 2 --
> arch/sh/kernel/machine_kexec.c | 2 +-
> include/linux/kexec.h | 1 +
> kernel/kexec.c | 17 ++++++++++-------
> 4 files changed, 12 insertions(+), 10 deletions(-)
>
> --
> 1.8.1.2
>
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 0/4] Minor fixes and improvements for kexec
@ 2013-12-17 5:37 ` WANG Chao
0 siblings, 0 replies; 27+ messages in thread
From: WANG Chao @ 2013-12-17 5:37 UTC (permalink / raw)
To: Geoff Levand
Cc: linux-sh, kexec, Paul Mundt, Paul Mackerras, Eric Biederman,
linuxppc-dev
On 12/12/13 at 12:18am, Geoff Levand wrote:
> Hi Eric,
>
> Here are a few minor fixes and improvements for kexec. Please consider.
>
> -Geoff
>
> The following changes since commit 374b105797c3d4f29c685f3be535c35f5689b30e:
>
> Linux 3.13-rc3 (2013-12-06 09:34:04 -0800)
>
> are available in the git repository at:
>
> git://git.linaro.org/people/geoff.levand/linux-kexec.git for-kexec
>
> for you to fetch changes up to 594a3d26aac66e9668edc81d7bfb4e801575514f:
>
> sh/kexec: Fix kexec build warning (2013-12-11 16:03:27 -0800)
>
> ----------------------------------------------------------------
> Geoff Levand (4):
> kexec: Simplify conditional
> kexec: Add IND_FLAGS macro
> powerpc/kexec: Use global IND_FLAGS macro
> sh/kexec: Fix kexec build warning
For this series (besides 4/4 v2):
Acked-by: WANG Chao <chaowang@redhat.com>
>
> arch/powerpc/kernel/machine_kexec_64.c | 2 --
> arch/sh/kernel/machine_kexec.c | 2 +-
> include/linux/kexec.h | 1 +
> kernel/kexec.c | 17 ++++++++++-------
> 4 files changed, 12 insertions(+), 10 deletions(-)
>
> --
> 1.8.1.2
>
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 0/4] Minor fixes and improvements for kexec
@ 2013-12-17 5:37 ` WANG Chao
0 siblings, 0 replies; 27+ messages in thread
From: WANG Chao @ 2013-12-17 5:37 UTC (permalink / raw)
To: Geoff Levand
Cc: linux-sh, Benjamin Herrenschmidt, kexec, Paul Mundt,
Paul Mackerras, Eric Biederman, linuxppc-dev
On 12/12/13 at 12:18am, Geoff Levand wrote:
> Hi Eric,
>
> Here are a few minor fixes and improvements for kexec. Please consider.
>
> -Geoff
>
> The following changes since commit 374b105797c3d4f29c685f3be535c35f5689b30e:
>
> Linux 3.13-rc3 (2013-12-06 09:34:04 -0800)
>
> are available in the git repository at:
>
> git://git.linaro.org/people/geoff.levand/linux-kexec.git for-kexec
>
> for you to fetch changes up to 594a3d26aac66e9668edc81d7bfb4e801575514f:
>
> sh/kexec: Fix kexec build warning (2013-12-11 16:03:27 -0800)
>
> ----------------------------------------------------------------
> Geoff Levand (4):
> kexec: Simplify conditional
> kexec: Add IND_FLAGS macro
> powerpc/kexec: Use global IND_FLAGS macro
> sh/kexec: Fix kexec build warning
For this series (besides 4/4 v2):
Acked-by: WANG Chao <chaowang@redhat.com>
>
> arch/powerpc/kernel/machine_kexec_64.c | 2 --
> arch/sh/kernel/machine_kexec.c | 2 +-
> include/linux/kexec.h | 1 +
> kernel/kexec.c | 17 ++++++++++-------
> 4 files changed, 12 insertions(+), 10 deletions(-)
>
> --
> 1.8.1.2
>
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 27+ messages in thread
end of thread, other threads:[~2013-12-17 5:38 UTC | newest]
Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-12 0:18 [PATCH 0/4] Minor fixes and improvements for kexec Geoff Levand
2013-12-12 0:18 ` Geoff Levand
2013-12-12 0:18 ` [PATCH 1/4] kexec: Simplify conditional Geoff Levand
2013-12-12 1:32 ` Zhang Yanfei
2013-12-17 0:45 ` Andrew Morton
2013-12-12 0:18 ` [PATCH 2/4] kexec: Add IND_FLAGS macro Geoff Levand
2013-12-12 0:18 ` Geoff Levand
2013-12-12 1:35 ` Zhang Yanfei
2013-12-12 1:35 ` Zhang Yanfei
2013-12-12 19:33 ` Geoff Levand
2013-12-12 19:33 ` Geoff Levand
2013-12-12 0:18 ` [PATCH 3/4] powerpc/kexec: Use global " Geoff Levand
2013-12-12 0:18 ` Geoff Levand
2013-12-12 5:11 ` [PATCH 0/4] Minor fixes and improvements for kexec Simon Horman
2013-12-12 5:11 ` Simon Horman
2013-12-12 5:11 ` Simon Horman
2013-12-17 5:37 ` WANG Chao
2013-12-17 5:37 ` WANG Chao
2013-12-17 5:37 ` WANG Chao
-- strict thread matches above, loose matches on Subject: below --
2013-12-12 19:51 [PATCH v2 4/4] sh/kexec: Fix kexec build warning Geoff Levand
2013-12-12 19:51 ` Geoff Levand
2013-12-12 0:18 [PATCH " Geoff Levand
2013-12-12 0:18 ` Geoff Levand
2013-12-12 14:48 ` Geert Uytterhoeven
2013-12-12 14:48 ` Geert Uytterhoeven
2013-12-12 19:30 ` Geoff Levand
2013-12-12 19:30 ` Geoff Levand
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.