drivers: base: Add prototype declaration in memory.c
Subsystems (3)
PATCH 1/1 drivers: base: Add prototype declaration in memory.c
Add the prototype declaration of function memory_block_size_bytes() in memory.c.
This eliminates the following warning in memory.c:drivers/base/memory.c:87:1: warning: no previous prototype for ‘memory_block_size_bytes’ [-Wmissing-prototypes]
--- drivers/base/memory.c | 1 + 1 file changed, 1 insertion(+)
drivers/base/memory.c +1 -0
@@ -83,6 +83,7 @@ static void memory_block_release(struct device *dev)kfree (mem); } +unsigned long __weak memory_block_size_bytes (void );unsigned long __weak memory_block_size_bytes (void ) {return MIN_MEMORY_BLOCK_SIZE ;
Signature · 1 line
1.7.9.5
Greg Kroah-Hartman
maintainerQuoted 17 lines · Rashika Kheria
Add the prototype declaration of function
memory_block_size_bytes()inmemory.c.This eliminates the following warning in
memory.c:drivers/base/memory.c:87:1: warning: no previous prototype for ‘memory_block_size_bytes’ [-Wmissing-prototypes]Signed-off-by Rashika Kheria <[email protected]>Reviewed-by Josh Triplett <[email protected]>--- drivers/base/memory.c | 1 + 1 file changed, 1 insertion(+)drivers/base/memory.c +0
-0
drivers/base/memory.c static void memory_block_release(struct device *dev) · line 87
Quoted 5 lines
drivers/base/memory.c +1
-0@@ -83,6 +83,7 @@ static void memory_block_release(struct device *dev)kfree (mem); } +unsigned long __weak memory_block_size_bytes (void );unsigned long __weak memory_block_size_bytes (void )
If this patch is the "solution" then something else is really wrong here, please use your judgement to realize this...
greg k-h
Quoted 21 lines · Greg Kroah-Hartman
Quoted 20 lines · Rashika Kheria
Add the prototype declaration of function
memory_block_size_bytes()inmemory.c.This eliminates the following warning in
memory.c:drivers/base/memory.c:87:1: warning: no previous prototype for ‘memory_block_size_bytes’ [-Wmissing-prototypes]Signed-off-by Rashika Kheria <[email protected]>Reviewed-by Josh Triplett <[email protected]>--- drivers/base/memory.c | 1 + 1 file changed, 1 insertion(+)drivers/base/memory.c +0
-0@@ -83,6 +83,7 @@ static void memory_block_release(struct device *dev)kfree (mem); }
Quoted 5 lines
drivers/base/memory.c static void memory_block_release(struct device *dev) · line 87
Quoted 2 lines
drivers/base/memory.c +1
-0+unsigned long __weak memory_block_size_bytes (void );unsigned long __weak memory_block_size_bytes (void )If this patch is the "solution" then something else is really wrong here, please use your judgement to realize this...
It's a weak symbol provided and consumed within the same file, and then overridden on a few random architectures. It isn't currently prototyped in any header file. The other potential solution would be to add it to an appropriate existing header or create a new one. Any suggestions for an appropriate existing header to prototype it in instead?
- Josh Triplett
Greg Kroah-Hartman
maintainerQuoted 28 lines · On Wed, Dec 18, 2013 at 11:01:08AM -0800, [email protected] wrote:
Quoted 21 lines · Greg Kroah-Hartman
Quoted 20 lines · Rashika Kheria
Add the prototype declaration of function
memory_block_size_bytes()inmemory.c.This eliminates the following warning in
memory.c:drivers/base/memory.c:87:1: warning: no previous prototype for ‘memory_block_size_bytes’ [-Wmissing-prototypes]Signed-off-by Rashika Kheria <[email protected]>Reviewed-by Josh Triplett <[email protected]>--- drivers/base/memory.c | 1 + 1 file changed, 1 insertion(+)drivers/base/memory.c +0
-0@@ -83,6 +83,7 @@ static void memory_block_release(struct device *dev)kfree (mem); }Quoted 5 lines
drivers/base/memory.c static void memory_block_release(struct device *dev) · line 87
Quoted 2 lines
drivers/base/memory.c +1
-0+unsigned long __weak memory_block_size_bytes (void );unsigned long __weak memory_block_size_bytes (void )If this patch is the "solution" then something else is really wrong here, please use your judgement to realize this...
Quoted 5 lines
It's a weak symbol provided and consumed within the same file, and then overridden on a few random architectures. It isn't currently prototyped in any header file. The other potential solution would be to add it to an appropriate existing header or create a new one. Any suggestions for an appropriate existing header to prototype it in instead?
device.h?
Quoted 29 lines · Greg Kroah-Hartman
Quoted 28 lines · On Wed, Dec 18, 2013 at 11:01:08AM -0800, [email protected] wrote:
Quoted 26 lines · Greg Kroah-Hartman
Quoted 17 lines · Rashika Kheria
Add the prototype declaration of function
memory_block_size_bytes()inmemory.c.This eliminates the following warning in
memory.c:drivers/base/memory.c:87:1: warning: no previous prototype for ‘memory_block_size_bytes’ [-Wmissing-prototypes]Signed-off-by Rashika Kheria <[email protected]>Reviewed-by Josh Triplett <[email protected]>--- drivers/base/memory.c | 1 + 1 file changed, 1 insertion(+)drivers/base/memory.c +0
-0drivers/base/memory.c static void memory_block_release(struct device *dev) · line 87
Quoted 5 lines
drivers/base/memory.c +1
-0@@ -83,6 +83,7 @@ static void memory_block_release(struct device *dev)kfree (mem); } +unsigned long __weak memory_block_size_bytes (void );unsigned long __weak memory_block_size_bytes (void )If this patch is the "solution" then something else is really wrong here, please use your judgement to realize this...
Quoted 7 lines
Quoted 5 lines
It's a weak symbol provided and consumed within the same file, and then overridden on a few random architectures. It isn't currently prototyped in any header file. The other potential solution would be to add it to an appropriate existing header or create a new one. Any suggestions for an appropriate existing header to prototype it in instead?
device.h?
include/linux/device.h? That would work, though it seems slightly out of place there.
Would include/linux/memory.h work?
- Josh Triplett
Greg Kroah-Hartman
maintainerQuoted 36 lines · On Wed, Dec 18, 2013 at 11:10:24AM -0800, [email protected] wrote:
Quoted 35 lines · Greg Kroah-Hartman
Quoted 33 lines · On Wed, Dec 18, 2013 at 11:01:08AM -0800, [email protected] wrote:
Quoted 21 lines · Greg Kroah-Hartman
Quoted 20 lines · Rashika Kheria
Add the prototype declaration of function
memory_block_size_bytes()inmemory.c.This eliminates the following warning in
memory.c:drivers/base/memory.c:87:1: warning: no previous prototype for ‘memory_block_size_bytes’ [-Wmissing-prototypes]Signed-off-by Rashika Kheria <[email protected]>Reviewed-by Josh Triplett <[email protected]>--- drivers/base/memory.c | 1 + 1 file changed, 1 insertion(+)drivers/base/memory.c +0
-0@@ -83,6 +83,7 @@ static void memory_block_release(struct device *dev)kfree (mem); }Quoted 5 lines
drivers/base/memory.c static void memory_block_release(struct device *dev) · line 87
Quoted 2 lines
drivers/base/memory.c +1
-0+unsigned long __weak memory_block_size_bytes (void );unsigned long __weak memory_block_size_bytes (void )If this patch is the "solution" then something else is really wrong here, please use your judgement to realize this...
It's a weak symbol provided and consumed within the same file, and then overridden on a few random architectures. It isn't currently prototyped in any header file. The other potential solution would be to add it to an appropriate existing header or create a new one. Any suggestions for an appropriate existing header to prototype it in instead?
Quoted 6 lines
Quoted 1 line
device.h?
include/linux/device.h? That would work, though it seems slightly out of place there.Would
include/linux/memory.hwork?
Sure, that's fine, I don't really care...
PATCH v2 1/1 drivers: base: Add prototype declaration to the header file
In reply to Rashika KheriaAdd prototype declaration of function memory_block_size_bytes() to the header file include/linux/memory.h.
This eliminates the following warning in memory.c:drivers/base/memory.c:87:1: warning: no previous prototype for ‘memory_block_size_bytes’ [-Wmissing-prototypes]
---
Changes since v1:
Incorrect Fix
include/linux/memory.h | 1 + 1 file changed, 1 insertion(+)
include/linux/memory.h +1 -0
@@ -35,6 +35,7 @@ struct memory_block { };int arch_get_memory_phys_device (unsigned long start_pfn); +unsigned long __weak memory_block_size_bytes (void );/* These states are exposed to userspace as text strings in sysfs */ #define MEM_ONLINE (1<<0)/* exposed to userspace */
Signature · 1 line
1.7.9.5
Re: [PATCH v2] drivers: base: Add prototype declaration to the header file
Quoted 7 lines · Rashika Kheria
Add prototype declaration of function
memory_block_size_bytes()to the header fileinclude/linux/memory.h.This eliminates the following warning in
memory.c:drivers/base/memory.c:87:1: warning: no previous prototype for ‘memory_block_size_bytes’ [-Wmissing-prototypes]Signed-off-by Rashika Kheria <[email protected]>
Quoted 18 lines
include/linux/memory.h | 1 + 1 file changed, 1 insertion(+)include/linux/memory.h +1
-0@@ -35,6 +35,7 @@ struct memory_block { };int arch_get_memory_phys_device (unsigned long start_pfn); +unsigned long __weak memory_block_size_bytes (void );/* These states are exposed to userspace as text strings in sysfs */ #define MEM_ONLINE (1<<0)/* exposed to userspace */ Signature · 1 line
1.7.9.5
Greg Kroah-Hartman
maintainerRe: [PATCH v2] drivers: base: Add prototype declaration to the header file
In reply to Rashika KheriaQuoted 8 lines · Rashika Kheria
Add prototype declaration of function
memory_block_size_bytes()to the header fileinclude/linux/memory.h.This eliminates the following warning in
memory.c:drivers/base/memory.c:87:1: warning: no previous prototype for ‘memory_block_size_bytes’ [-Wmissing-prototypes]Signed-off-by Rashika Kheria <[email protected]>Reviewed-by Josh Triplett <[email protected]>
Please ALWAYS run your patches through checkpatch.pl so a maintainer doesn't have to write you an email like this reminding you to do that...
Josh, come on, you should have caught this as well, fix up your email client to flag stuff like this easier...
greg k-h
Re: [PATCH v2] drivers: base: Add prototype declaration to the header file
Quoted 7 lines · Greg Kroah-Hartman
Quoted 6 lines · Rashika Kheria
Add prototype declaration of function
memory_block_size_bytes()to the header fileinclude/linux/memory.h.This eliminates the following warning in
memory.c:drivers/base/memory.c:87:1: warning: no previous prototype for ‘memory_block_size_bytes’ [-Wmissing-prototypes]
Quoted 8 lines
Quoted 2 lines
Signed-off-by Rashika Kheria <[email protected]>Reviewed-by Josh Triplett <[email protected]>Please ALWAYS run your patches through checkpatch.pl so a maintainer doesn't have to write you an email like this reminding you to do that...
Josh, come on, you should have caught this as well, fix up your email client to flag stuff like this easier...
If you're referring to the trailing whitespace on the line that was added, I did indeed miss that. Sorry about that.
I don't see any option in mutt that would make trailing whitespace visible; if you know of one, I'd love to hear about it. I do have vim configured to highlight trailing whitespace, but I normally review patches in mutt and then hit reply and use vim to provide a Reviewed-by or line-by-line feedback if needed. I should get in the habit of reviewing patches in vim instead; if I had, I'd have caught this.
- Josh Triplett
PATCH v3 1/1 drivers: base: Add prototype declaration to the header file
In reply to Rashika KheriaAdd prototype declaration of function memory_block_size_bytes() to the header file include/linux/memory.h.
This eliminates the following warning in memory.c:drivers/base/memory.c:87:1: warning: no previous prototype for ‘memory_block_size_bytes’ [-Wmissing-prototypes]
---
Changes since v2:
Checkpatch error
include/linux/memory.h | 1 + 1 file changed, 1 insertion(+)
include/linux/memory.h +1 -0
@@ -35,6 +35,7 @@ struct memory_block { };int arch_get_memory_phys_device (unsigned long start_pfn); +unsigned long __weak memory_block_size_bytes (void );/* These states are exposed to userspace as text strings in sysfs */ #define MEM_ONLINE (1<<0)/* exposed to userspace */
Signature · 1 line
1.7.9.5