Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1228479 > unrolled thread
| Started by | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| First post | 2015-09-19 19:20 +0200 |
| Last post | 2015-09-22 11:00 +0200 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 0/3] fix allmodconfig failure of avr32 Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-19 19:20 +0200
[PATCH 3/3] page-flags: rectify forward declaration Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-19 19:20 +0200
Re: [PATCH 3/3] page-flags: rectify forward declaration Andrew Morton <akpm@linux-foundation.org> - 2015-09-22 00:40 +0200
Re: [PATCH 3/3] page-flags: rectify forward declaration Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-22 11:00 +0200
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Date | 2015-09-19 19:20 +0200 |
| Subject | [PATCH 0/3] fix allmodconfig failure of avr32 |
| Message-ID | <qatXQ-7P2-7@gated-at.bofh.it> |
Build of allmodconfig with avr32 used to fail with the errors: error: implicit declaration of function 'pci_iomap' error: implicit declaration of function 'pci_iounmap' and "at91_pmc_base" [drivers/usb/gadget/udc/atmel_usba_udc.ko] undefined! First two patches fixes these two problems. Third patch is related to a build warning: warning: 'compound_head' declared inline after being called. warning: previous declaration of 'compound_head' was here. regards sudip Sudip Mukherjee (3): avr32: fix build failure usb: gadget: at91_udc: mention proper dependency page-flags: rectify forward declaration arch/avr32/include/asm/io.h | 13 +++++++++++++ drivers/usb/gadget/udc/Kconfig | 2 +- include/linux/page-flags.h | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Date | 2015-09-19 19:20 +0200 |
| Subject | [PATCH 3/3] page-flags: rectify forward declaration |
| Message-ID | <qatXQ-7P2-17@gated-at.bofh.it> |
| In reply to | #1228479 |
compound_head is defined as inline in page-flags.h but in the forward
declaration of compound_head in the same file missed "inline". As a result
we got plenty of build warnings while building for some architecture
like avr32. The warning showed as:
warning: 'compound_head' declared inline after being called.
warning: previous declaration of 'compound_head' was here
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
tested build with avr32 and also with x86_64 allmodconfig to verify that
nothing breaks due to this change.
include/linux/page-flags.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index ab1a0e9..2a2391c 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -227,7 +227,7 @@ static inline int __TestClearPage##uname(struct page *page) { return 0; }
struct page;
static inline int PageCompound(struct page *page);
static inline int PageTail(struct page *page);
-static struct page *compound_head(struct page *page);
+static inline struct page *compound_head(struct page *page);
__PAGEFLAG(Locked, locked, PF_NO_TAIL)
PAGEFLAG(Error, error, PF_NO_COMPOUND) TESTCLEARFLAG(Error, error, PF_NO_COMPOUND)
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Andrew Morton <akpm@linux-foundation.org> |
|---|---|
| Date | 2015-09-22 00:40 +0200 |
| Subject | Re: [PATCH 3/3] page-flags: rectify forward declaration |
| Message-ID | <qbhUB-3qy-7@gated-at.bofh.it> |
| In reply to | #1228481 |
On Sat, 19 Sep 2015 22:42:59 +0530 Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:
> compound_head is defined as inline in page-flags.h but in the forward
> declaration of compound_head in the same file missed "inline". As a result
> we got plenty of build warnings while building for some architecture
> like avr32. The warning showed as:
> warning: 'compound_head' declared inline after being called.
> warning: previous declaration of 'compound_head' was here
>
> ...
>
> --- a/include/linux/page-flags.h
> +++ b/include/linux/page-flags.h
> @@ -227,7 +227,7 @@ static inline int __TestClearPage##uname(struct page *page) { return 0; }
> struct page;
> static inline int PageCompound(struct page *page);
> static inline int PageTail(struct page *page);
> -static struct page *compound_head(struct page *page);
> +static inline struct page *compound_head(struct page *page);
>
> __PAGEFLAG(Locked, locked, PF_NO_TAIL)
> PAGEFLAG(Error, error, PF_NO_COMPOUND) TESTCLEARFLAG(Error, error, PF_NO_COMPOUND)
Yes, that's an error, in -mm due to Kirill's page-flags patches.
The code is effectively doing
static inline XXX foo(...);
static inline YYY bar(...)
{
foo(...);
}
inline XXX foo(...)
{
...
}
ie: asking gcc to inline a forward-defined function. That does work,
but it's unusual and unexpected, and it's a bit unwise to expect the
compiler to do unusual and more difficult things.
Is it fixable? Can we use the traditional define-before-using structure?
Also, I'm finding that the patch series introduces a pretty large
bisection hole:
include/linux/page-flags.h: In function 'PageYoung':
include/linux/page-flags.h:327: error: implicit declaration of function 'PF_ANY'
include/linux/page-flags.h:327: error: invalid type argument of '->' (have 'int')
include/linux/page-flags.h:327: error: invalid type argument of '->' (have 'int')
which later gets fixed up by
page-flags-rectify-forward-declaration.patch.
Maybe it's time to do a wholesale refactoring of the patchset?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Date | 2015-09-22 11:00 +0200 |
| Subject | Re: [PATCH 3/3] page-flags: rectify forward declaration |
| Message-ID | <qbrAC-qV-19@gated-at.bofh.it> |
| In reply to | #1229798 |
On Mon, Sep 21, 2015 at 03:35:09PM -0700, Andrew Morton wrote:
> On Sat, 19 Sep 2015 22:42:59 +0530 Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:
>
<snip>
>
> Is it fixable? Can we use the traditional define-before-using structure?
How about this:
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index ab1a0e9..d7a1055 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -133,6 +133,19 @@ enum pageflags {
#ifndef __GENERATING_BOUNDS_H
+/* Forward declarations */
+struct page;
+static inline int PageCompound(struct page *page);
+static inline int PageTail(struct page *page);
+static inline struct page *compound_head(struct page *page)
+{
+ unsigned long head = READ_ONCE(page->compound_head);
+
+ if (unlikely(head & 1))
+ return (struct page *) (head - 1);
+ return page;
+}
+
/* Page flags policies wrt compound pages */
#define PF_ANY(page, enforce) page
#define PF_HEAD(page, enforce) compound_head(page)
@@ -223,12 +236,6 @@ static inline int __TestClearPage##uname(struct page *page) { return 0; }
#define TESTSCFLAG_FALSE(uname) \
TESTSETFLAG_FALSE(uname) TESTCLEARFLAG_FALSE(uname)
-/* Forward declarations */
-struct page;
-static inline int PageCompound(struct page *page);
-static inline int PageTail(struct page *page);
-static struct page *compound_head(struct page *page);
-
__PAGEFLAG(Locked, locked, PF_NO_TAIL)
PAGEFLAG(Error, error, PF_NO_COMPOUND) TESTCLEARFLAG(Error, error, PF_NO_COMPOUND)
PAGEFLAG(Referenced, referenced, PF_HEAD)
@@ -450,15 +457,6 @@ static inline void clear_compound_head(struct page *page)
WRITE_ONCE(page->compound_head, 0);
}
-static inline struct page *compound_head(struct page *page)
-{
- unsigned long head = READ_ONCE(page->compound_head);
-
- if (unlikely(head & 1))
- return (struct page *) (head - 1);
- return page;
-}
-
static inline int PageCompound(struct page *page)
{
return PageHead(page) || PageTail(page);
---
It builds properly. Tested with allmodconfig of x86_64 and avr32.
>
> Also, I'm finding that the patch series introduces a pretty large
> bisection hole:
>
> include/linux/page-flags.h: In function 'PageYoung':
> include/linux/page-flags.h:327: error: implicit declaration of function 'PF_ANY'
> include/linux/page-flags.h:327: error: invalid type argument of '->' (have 'int')
> include/linux/page-flags.h:327: error: invalid type argument of '->' (have 'int')
>
> which later gets fixed up by
> page-flags-rectify-forward-declaration.patch.
How to test this? Should I apply them on top of v4.2 and bisect? And I
don't see any relation between the first two patches and this patch of
the series, then how does it fail in bisect? Am I missing something?
Confused.. :(
>
> Maybe it's time to do a wholesale refactoring of the patchset?
If this patch is the first in the series will that help?
And besides I got the auto mail from you that the patch is applied.
Now totally confused.. :(
regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web