2011-04-25 18:11:39

by Mike Travis

[permalink] [raw]
Subject: [PATCH 1/2] memblock: add error return when CONFIG_HAVE_MEMBLOCK is not set

Add an error return if CONFIG_HAVE_MEMBLOCK is not set instead
of having to add #ifdef CONFIG_HAVE_MEMBLOCK around blocks of
code calling that function.

Authored-by: Yinghai Lu <[email protected]>
Signed-off-by: Mike Travis <[email protected]>
---
include/linux/memblock.h | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

--- linux.orig/include/linux/memblock.h
+++ linux/include/linux/memblock.h
@@ -2,6 +2,8 @@
#define _LINUX_MEMBLOCK_H
#ifdef __KERNEL__

+#define MEMBLOCK_ERROR 0
+
#ifdef CONFIG_HAVE_MEMBLOCK
/*
* Logical memory blocks.
@@ -20,7 +22,6 @@
#include <asm/memblock.h>

#define INIT_MEMBLOCK_REGIONS 128
-#define MEMBLOCK_ERROR 0

struct memblock_region {
phys_addr_t base;
@@ -160,6 +161,12 @@ static inline unsigned long memblock_reg
#define __initdata_memblock
#endif

+#else
+static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align)
+{
+ return MEMBLOCK_ERROR;
+}
+
#endif /* CONFIG_HAVE_MEMBLOCK */

#endif /* __KERNEL__ */

--


2011-04-25 22:49:28

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH 1/2] memblock: add error return when CONFIG_HAVE_MEMBLOCK is not set

On Mon, 25 Apr 2011 13:11:37 -0500
Mike Travis <[email protected]> wrote:

> Add an error return if CONFIG_HAVE_MEMBLOCK is not set instead
> of having to add #ifdef CONFIG_HAVE_MEMBLOCK around blocks of
> code calling that function.
>
> Authored-by: Yinghai Lu <[email protected]>
> Signed-off-by: Mike Travis <[email protected]>

There is no such thing as "Authored-by:". If this patch was written by
yinghai then it must be tagged as From:him at the top of the changelog
and preferably has his signed-off-by: at the end.

Please clarify?

2011-04-26 17:07:21

by Mike Travis

[permalink] [raw]
Subject: Re: [PATCH 1/2] memblock: add error return when CONFIG_HAVE_MEMBLOCK is not set



Andrew Morton wrote:
> On Mon, 25 Apr 2011 13:11:37 -0500
> Mike Travis <[email protected]> wrote:
>
>> Add an error return if CONFIG_HAVE_MEMBLOCK is not set instead
>> of having to add #ifdef CONFIG_HAVE_MEMBLOCK around blocks of
>> code calling that function.
>>
>> Authored-by: Yinghai Lu <[email protected]>
>> Signed-off-by: Mike Travis <[email protected]>
>
> There is no such thing as "Authored-by:". If this patch was written by
> yinghai then it must be tagged as From:him at the top of the changelog
> and preferably has his signed-off-by: at the end.
>
> Please clarify?

Yes, you have it correct. I had added the From: line but when I receive
the email, it's removed.

Why not have an "Authored-by"? That would eliminate the sendmail program
from screwing it up?

Thanks,
Mike

2011-04-27 06:33:42

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 1/2] memblock: add error return when CONFIG_HAVE_MEMBLOCK is not set


* Mike Travis <[email protected]> wrote:

>
>
> Andrew Morton wrote:
> >On Mon, 25 Apr 2011 13:11:37 -0500
> >Mike Travis <[email protected]> wrote:
> >
> >> Add an error return if CONFIG_HAVE_MEMBLOCK is not set instead
> >> of having to add #ifdef CONFIG_HAVE_MEMBLOCK around blocks of
> >> code calling that function.
> >>
> >>Authored-by: Yinghai Lu <[email protected]>
> >>Signed-off-by: Mike Travis <[email protected]>
> >
> >There is no such thing as "Authored-by:". If this patch was written by
> >yinghai then it must be tagged as From:him at the top of the changelog
> >and preferably has his signed-off-by: at the end.
> >
> >Please clarify?
>
> Yes, you have it correct. I had added the From: line but when I receive
> the email, it's removed.
>
> Why not have an "Authored-by"? That would eliminate the sendmail program
> from screwing it up?

"From:" headers are properly recognized by Git and both git log and git
annotate will show the right authorship. Authored-by does not get propagated.

Also, sendmail does not screw up From: headers that are in the body of the
email - forwarding emails is one of the oldest things that can be done to
emails.

Thanks,

Ingo

2011-04-29 14:10:23

by Valdis Klētnieks

[permalink] [raw]
Subject: Re: [PATCH 1/2] memblock: add error return when CONFIG_HAVE_MEMBLOCK is not set

On Wed, 27 Apr 2011 08:33:18 +0200, Ingo Molnar said:
> Also, sendmail does not screw up From: headers that are in the body of the
> email - forwarding emails is one of the oldest things that can be done to
> emails.

What some Sendmail configurations *do* eat is lines that start with 'From ' (no
colon). Those will get escaped as '>From ...' to prevent them from looking
like a separator line for what's known as 'mbox' format - which is basically
the same info as in the Return-Path: header plus a timestamp. They look like:

>From [email protected] Fri Apr 19 15:50:15 2002

(If the above line has a >From, you have the issue. Yes, it could be smarter
and do a full parse for a mbox header rather than just '^From '. And yes, I
had to go digging to find an old archived mbox format file to snarf the example
from.


Attachments:
(No filename) (227.00 B)