* [PATCH] drivers: base: Add prototype declaration in memory.c
@ 2013-12-18 6:39 Rashika Kheria
2013-12-18 15:34 ` Greg Kroah-Hartman
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Rashika Kheria @ 2013-12-18 6:39 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, josh
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]
Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
drivers/base/memory.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index bece691..cfa03de 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -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;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH] drivers: base: Add prototype declaration in memory.c 2013-12-18 6:39 [PATCH] drivers: base: Add prototype declaration in memory.c Rashika Kheria @ 2013-12-18 15:34 ` Greg Kroah-Hartman 2013-12-18 19:01 ` josh 2013-12-19 11:24 ` [PATCH v2] drivers: base: Add prototype declaration to the header file Rashika Kheria 2013-12-20 15:08 ` [PATCH v3] " Rashika Kheria 2 siblings, 1 reply; 11+ messages in thread From: Greg Kroah-Hartman @ 2013-12-18 15:34 UTC (permalink / raw) To: Rashika Kheria; +Cc: linux-kernel, josh On Wed, Dec 18, 2013 at 12:09:53PM +0530, Rashika Kheria wrote: > 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] > > Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> > Reviewed-by: Josh Triplett <josh@joshtriplett.org> > --- > drivers/base/memory.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/base/memory.c b/drivers/base/memory.c > index bece691..cfa03de 100644 > --- a/drivers/base/memory.c > +++ b/drivers/base/memory.c > @@ -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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drivers: base: Add prototype declaration in memory.c 2013-12-18 15:34 ` Greg Kroah-Hartman @ 2013-12-18 19:01 ` josh 2013-12-18 19:03 ` Greg Kroah-Hartman 0 siblings, 1 reply; 11+ messages in thread From: josh @ 2013-12-18 19:01 UTC (permalink / raw) To: Greg Kroah-Hartman; +Cc: Rashika Kheria, linux-kernel On Wed, Dec 18, 2013 at 07:34:51AM -0800, Greg Kroah-Hartman wrote: > On Wed, Dec 18, 2013 at 12:09:53PM +0530, Rashika Kheria wrote: > > 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] > > > > Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> > > Reviewed-by: Josh Triplett <josh@joshtriplett.org> > > --- > > drivers/base/memory.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/base/memory.c b/drivers/base/memory.c > > index bece691..cfa03de 100644 > > --- a/drivers/base/memory.c > > +++ b/drivers/base/memory.c > > @@ -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... 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drivers: base: Add prototype declaration in memory.c 2013-12-18 19:01 ` josh @ 2013-12-18 19:03 ` Greg Kroah-Hartman 2013-12-18 19:10 ` josh 0 siblings, 1 reply; 11+ messages in thread From: Greg Kroah-Hartman @ 2013-12-18 19:03 UTC (permalink / raw) To: josh; +Cc: Rashika Kheria, linux-kernel On Wed, Dec 18, 2013 at 11:01:08AM -0800, josh@joshtriplett.org wrote: > On Wed, Dec 18, 2013 at 07:34:51AM -0800, Greg Kroah-Hartman wrote: > > On Wed, Dec 18, 2013 at 12:09:53PM +0530, Rashika Kheria wrote: > > > 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] > > > > > > Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> > > > Reviewed-by: Josh Triplett <josh@joshtriplett.org> > > > --- > > > drivers/base/memory.c | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/drivers/base/memory.c b/drivers/base/memory.c > > > index bece691..cfa03de 100644 > > > --- a/drivers/base/memory.c > > > +++ b/drivers/base/memory.c > > > @@ -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... > > 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? ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drivers: base: Add prototype declaration in memory.c 2013-12-18 19:03 ` Greg Kroah-Hartman @ 2013-12-18 19:10 ` josh 2013-12-18 19:18 ` Greg Kroah-Hartman 0 siblings, 1 reply; 11+ messages in thread From: josh @ 2013-12-18 19:10 UTC (permalink / raw) To: Greg Kroah-Hartman; +Cc: Rashika Kheria, linux-kernel On Wed, Dec 18, 2013 at 11:03:44AM -0800, Greg Kroah-Hartman wrote: > On Wed, Dec 18, 2013 at 11:01:08AM -0800, josh@joshtriplett.org wrote: > > On Wed, Dec 18, 2013 at 07:34:51AM -0800, Greg Kroah-Hartman wrote: > > > On Wed, Dec 18, 2013 at 12:09:53PM +0530, Rashika Kheria wrote: > > > > 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] > > > > > > > > Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> > > > > Reviewed-by: Josh Triplett <josh@joshtriplett.org> > > > > --- > > > > drivers/base/memory.c | 1 + > > > > 1 file changed, 1 insertion(+) > > > > > > > > diff --git a/drivers/base/memory.c b/drivers/base/memory.c > > > > index bece691..cfa03de 100644 > > > > --- a/drivers/base/memory.c > > > > +++ b/drivers/base/memory.c > > > > @@ -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... > > > > 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drivers: base: Add prototype declaration in memory.c 2013-12-18 19:10 ` josh @ 2013-12-18 19:18 ` Greg Kroah-Hartman 0 siblings, 0 replies; 11+ messages in thread From: Greg Kroah-Hartman @ 2013-12-18 19:18 UTC (permalink / raw) To: josh; +Cc: Rashika Kheria, linux-kernel On Wed, Dec 18, 2013 at 11:10:24AM -0800, josh@joshtriplett.org wrote: > On Wed, Dec 18, 2013 at 11:03:44AM -0800, Greg Kroah-Hartman wrote: > > On Wed, Dec 18, 2013 at 11:01:08AM -0800, josh@joshtriplett.org wrote: > > > On Wed, Dec 18, 2013 at 07:34:51AM -0800, Greg Kroah-Hartman wrote: > > > > On Wed, Dec 18, 2013 at 12:09:53PM +0530, Rashika Kheria wrote: > > > > > 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] > > > > > > > > > > Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> > > > > > Reviewed-by: Josh Triplett <josh@joshtriplett.org> > > > > > --- > > > > > drivers/base/memory.c | 1 + > > > > > 1 file changed, 1 insertion(+) > > > > > > > > > > diff --git a/drivers/base/memory.c b/drivers/base/memory.c > > > > > index bece691..cfa03de 100644 > > > > > --- a/drivers/base/memory.c > > > > > +++ b/drivers/base/memory.c > > > > > @@ -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... > > > > > > 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? Sure, that's fine, I don't really care... ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2] drivers: base: Add prototype declaration to the header file 2013-12-18 6:39 [PATCH] drivers: base: Add prototype declaration in memory.c Rashika Kheria 2013-12-18 15:34 ` Greg Kroah-Hartman @ 2013-12-19 11:24 ` Rashika Kheria 2013-12-19 14:29 ` Josh Triplett 2013-12-19 18:13 ` Greg Kroah-Hartman 2013-12-20 15:08 ` [PATCH v3] " Rashika Kheria 2 siblings, 2 replies; 11+ messages in thread From: Rashika Kheria @ 2013-12-19 11:24 UTC (permalink / raw) To: linux-kernel, Greg Kroah-Hartman, josh Add 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] Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> --- Changes since v1: Incorrect Fix include/linux/memory.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/memory.h b/include/linux/memory.h index 9a6bbf7..8c8f51c 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h @@ -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 */ -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2] drivers: base: Add prototype declaration to the header file 2013-12-19 11:24 ` [PATCH v2] drivers: base: Add prototype declaration to the header file Rashika Kheria @ 2013-12-19 14:29 ` Josh Triplett 2013-12-19 18:13 ` Greg Kroah-Hartman 1 sibling, 0 replies; 11+ messages in thread From: Josh Triplett @ 2013-12-19 14:29 UTC (permalink / raw) To: Rashika Kheria; +Cc: linux-kernel, Greg Kroah-Hartman On Thu, Dec 19, 2013 at 04:54:57PM +0530, Rashika Kheria wrote: > Add 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] > > Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> > include/linux/memory.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/linux/memory.h b/include/linux/memory.h > index 9a6bbf7..8c8f51c 100644 > --- a/include/linux/memory.h > +++ b/include/linux/memory.h > @@ -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 */ > -- > 1.7.9.5 > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] drivers: base: Add prototype declaration to the header file 2013-12-19 11:24 ` [PATCH v2] drivers: base: Add prototype declaration to the header file Rashika Kheria 2013-12-19 14:29 ` Josh Triplett @ 2013-12-19 18:13 ` Greg Kroah-Hartman 2013-12-19 18:41 ` Josh Triplett 1 sibling, 1 reply; 11+ messages in thread From: Greg Kroah-Hartman @ 2013-12-19 18:13 UTC (permalink / raw) To: Rashika Kheria; +Cc: linux-kernel, josh On Thu, Dec 19, 2013 at 04:54:57PM +0530, Rashika Kheria wrote: > Add 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] > > Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> > Reviewed-by: Josh Triplett <josh@joshtriplett.org> 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] drivers: base: Add prototype declaration to the header file 2013-12-19 18:13 ` Greg Kroah-Hartman @ 2013-12-19 18:41 ` Josh Triplett 0 siblings, 0 replies; 11+ messages in thread From: Josh Triplett @ 2013-12-19 18:41 UTC (permalink / raw) To: Greg Kroah-Hartman; +Cc: Rashika Kheria, linux-kernel On Thu, Dec 19, 2013 at 10:13:57AM -0800, Greg Kroah-Hartman wrote: > On Thu, Dec 19, 2013 at 04:54:57PM +0530, Rashika Kheria wrote: > > Add 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] > > > > Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> > > Reviewed-by: Josh Triplett <josh@joshtriplett.org> > > 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3] drivers: base: Add prototype declaration to the header file 2013-12-18 6:39 [PATCH] drivers: base: Add prototype declaration in memory.c Rashika Kheria 2013-12-18 15:34 ` Greg Kroah-Hartman 2013-12-19 11:24 ` [PATCH v2] drivers: base: Add prototype declaration to the header file Rashika Kheria @ 2013-12-20 15:08 ` Rashika Kheria 2 siblings, 0 replies; 11+ messages in thread From: Rashika Kheria @ 2013-12-20 15:08 UTC (permalink / raw) To: josh, linux-kernel, gregkh Add 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] Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> --- Changes since v2: Checkpatch error include/linux/memory.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/memory.h b/include/linux/memory.h index 9a6bbf7..bb7384e 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h @@ -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 */ -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2013-12-20 15:08 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-12-18 6:39 [PATCH] drivers: base: Add prototype declaration in memory.c Rashika Kheria 2013-12-18 15:34 ` Greg Kroah-Hartman 2013-12-18 19:01 ` josh 2013-12-18 19:03 ` Greg Kroah-Hartman 2013-12-18 19:10 ` josh 2013-12-18 19:18 ` Greg Kroah-Hartman 2013-12-19 11:24 ` [PATCH v2] drivers: base: Add prototype declaration to the header file Rashika Kheria 2013-12-19 14:29 ` Josh Triplett 2013-12-19 18:13 ` Greg Kroah-Hartman 2013-12-19 18:41 ` Josh Triplett 2013-12-20 15:08 ` [PATCH v3] " Rashika Kheria
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox