Skip to contentSkip to conversation

drivers/s390/char/fs3270.c:337:10: error: implicit declaration of function 'compat_ptr'; did you mean 'complete'?

PATCH Arnd Bergmann 2 participants 2 messages Mar 26, 2018 4 messages not in the archive

Subsystems (12)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 201803210054.aktDFRUf%[email protected]

A message that is not in the archive (sent off-list or not yet received): CABeXuvqQfCYmz+md1tfEC3kiYWctSz7kBSjEu6+n1oOCAGGJzg@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): CAK8P3a37SqjhPPbOkhXBuaHhakS3T8tvejB9aA+ZO2m8ZRMsLg@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): CABeXuvqm2XHKKffHdo1CMUzQhCWkRzz9=+xbk_VXN9-t9i4duQ@mail.gmail.com

Arnd Bergmann

author maintainer
#4 lore raw
Quoted 33 lines · Deepa Dinamani
Quoted 16 lines · Arnd Bergmann
Quoted 15 lines · Deepa Dinamani

This does not have the recent s390 patch I sent out to be applied on linux-next. This is not yet in linux-next.

------

s390: Use asm/compat.h instead of linux/compat.h

Include asm/compat.h directly for uses of compat_ptr. This includes the compat defines when CONFIG_COMPAT is not on.

Also make compat data structure definitions conditional on CONFIG_COMPAT, to remove circular include dependencies in elf.h

Quoted 7 lines
Quoted 3 lines

I have an increasingly bad feeling about this workaround, I think we need to try harder to make linux/compat.h contain whatever is expected and provide everything that asm/compat.h does.

This is my plan, But, I was planning to get rid of this by posting individual patches to specific architectures after this series was merged to keep this series less complicated.
Problem comes from including compat code even when CONFIG_COMPAT is not on.

Quoted 2 lines

Generally it is expected that including linux/foo.h is a strict superset of asm/foo.h, and you should use the former in device drivers.

Quoted 8 lines

Right. I was also hesitant about this change. But, in this particular case, these are only s390 drivers that are not built on any other architectures.
So I thought this should be okay. Also, I plan to clean this up in the architecture specific patches.

If you still prefer fixing these now rather than later, then I can give it another try and post an update.

I've applied a different fix for now, see below.

I'll give it some more testing, but this solves both the arm64 and s390 issues I saw earlier, and lets us always include linux/compat.h instead of having to include asm/compat.h.

Let me know if you see a problem with that one.

Arnd

commit d1a353a4a8cce86c7651a8011cc860a921b850bc

Author: Arnd Bergmann <[email protected]>
Date:   Mon Mar 26 16:59:15 2018 +0200

compat: add an asm-generic/compat.h file

We have a couple of files that try to include asm/compat.h on architectures where this is available. Those should generally use the higher-level linux/compat.h file, but that in turn fails to include asm/compat.h when CONFIG_COMPAT is disabled, unless we can provide that header on all architectures.

This adds the asm/compat.h for all remaining architectures to simplify the dependencies.

Architectures that are getting removed in linux-4.17 are not changed here, to avoid needless conflicts with the removal patches. Those architectures are broken by this patch, but we have already shown that they have no users.

arch/alpha/include/asm/Kbuild +1 -0
index 9b68790013e2..0580cb8c84b2 100644
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 
 
+generic-y += compat.h
 generic-y += exec.h
 generic-y += export.h
 generic-y += fb.h
arch/arc/include/asm/Kbuild +1 -0
index 4bd5d4369e05..d51bc22e8795 100644
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 generic-y += bugs.h
+generic-y += compat.h
 generic-y += device.h
 generic-y += div64.h
 generic-y += emergency-restart.h
arch/arm/include/asm/Kbuild +1 -0
index 873e3c189279..1d66db9c9db5 100644
@@ -1,3 +1,4 @@
+generic-y += compat.h
 generic-y += current.h
 generic-y += early_ioremap.h
 generic-y += emergency-restart.h
arch/c6x/include/asm/Kbuild +1 -0
index fd4c840de837..24037486317c 100644
@@ -1,6 +1,7 @@
 generic-y += atomic.h
 generic-y += barrier.h
 generic-y += bugs.h
+generic-y += compat.h
 generic-y += current.h
 generic-y += device.h
 generic-y += div64.h
arch/h8300/include/asm/Kbuild +1 -0
index 14bac06b7116..a5d0b2991f47 100644
@@ -3,6 +3,7 @@ generic-y += barrier.h
 generic-y += bugs.h
 generic-y += cacheflush.h
 generic-y += checksum.h
+generic-y += compat.h
 generic-y += current.h
 generic-y += delay.h
 generic-y += device.h
arch/hexagon/include/asm/Kbuild +1 -0
index e9743f689fb8..dd2fd9c0d292 100644
@@ -2,6 +2,7 @@
 generic-y += barrier.h
 generic-y += bug.h
 generic-y += bugs.h
+generic-y += compat.h
 generic-y += current.h
 generic-y += device.h
 generic-y += div64.h
arch/ia64/include/asm/Kbuild +1 -0
index 6dd867873364..557bbc8ba9f5 100644
@@ -1,3 +1,4 @@
+generic-y += compat.h
 generic-y += exec.h
 generic-y += irq_work.h
 generic-y += mcs_spinlock.h
arch/m68k/include/asm/Kbuild +1 -0
index 88a9d27df1ac..4d8d68c4e3dd 100644
@@ -1,4 +1,5 @@
 generic-y += barrier.h
+generic-y += compat.h
 generic-y += device.h
 generic-y += emergency-restart.h
 generic-y += exec.h
(quoted diff) +0 -0

b/arch/microblaze/include/asm/Kbuild
index 3c80a5a308ed..fe6a6c6e5003 100644

arch/microblaze/include/asm/Kbuild +1 -0
@@ -2,6 +2,7 @@ generic-y += barrier.h
 generic-y += bitops.h
 generic-y += bug.h
 generic-y += bugs.h
+generic-y += compat.h
 generic-y += device.h
 generic-y += div64.h
 generic-y += emergency-restart.h
arch/nios2/include/asm/Kbuild +1 -0
index d232da2cbb38..64ed3d656956 100644
@@ -4,6 +4,7 @@ generic-y += bitops.h
 generic-y += bug.h
 generic-y += bugs.h
 generic-y += cmpxchg.h
+generic-y += compat.h
 generic-y += current.h
 generic-y += device.h
 generic-y += div64.h
arch/openrisc/include/asm/Kbuild +1 -0
index f05c722a21f8..65964d390b10 100644
@@ -2,6 +2,7 @@ generic-y += barrier.h
 generic-y += bug.h
 generic-y += bugs.h
 generic-y += checksum.h
+generic-y += compat.h
 generic-y += current.h
 generic-y += device.h
 generic-y += div64.h
arch/sh/include/asm/Kbuild +1 -0
index 1efcce74997b..46dd82ab2c29 100644
@@ -1,3 +1,4 @@
+generic-y += compat.h
 generic-y += current.h
 generic-y += delay.h
 generic-y += div64.h
arch/um/include/asm/Kbuild +1 -0
index bb5a196c3061..b10dde6cb793 100644
@@ -1,6 +1,7 @@
 generic-y += barrier.h
 generic-y += bpf_perf_event.h
 generic-y += bug.h
+generic-y += compat.h
 generic-y += current.h
 generic-y += delay.h
 generic-y += device.h
(quoted diff) +0 -0

b/arch/unicore32/include/asm/Kbuild
index 6f70c76c81fc..bfc7abe77905 100644

arch/unicore32/include/asm/Kbuild +1 -0
@@ -1,5 +1,6 @@
 generic-y += atomic.h
 generic-y += bugs.h
+generic-y += compat.h
 generic-y += current.h
 generic-y += device.h
 generic-y += div64.h
arch/xtensa/include/asm/Kbuild +1 -0
index 436b20337168..e5e1e61c538c 100644
@@ -1,4 +1,5 @@
 generic-y += bug.h
+generic-y += compat.h
 generic-y += device.h
 generic-y += div64.h
 generic-y += dma-contiguous.h
include/asm-generic/compat.h new file +3 -0
new file mode 100644
index 000000000000..28819451b6d1
@@ -0,0 +1,3 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+/* This is an empty stub for 32-bit-only architectures */
include/linux/compat.h +2 -1
index e291096dc937..94291c3e67dc 100644
@@ -17,8 +17,9 @@
 #include <linux/aio_abi.h> /* for aio_context_t */
 #include <linux/unistd.h>
 
-#ifdef CONFIG_COMPAT
 #include <asm/compat.h>
+
+#ifdef CONFIG_COMPAT
 #include <asm/siginfo.h>
 #include <asm/signal.h>
 #endif
#5 lore raw

I thought of doing something like this earlier.
I think there is an easier fix by moving the defines in linux/compat.h under CONFIG_32BIT_TIME.
Let me try to get that working also for comparison.
I will post it here.

Thanks,
Deepa

Quoted 266 lines · Arnd Bergmann
Quoted 33 lines · Deepa Dinamani
Quoted 16 lines · Arnd Bergmann
Quoted 15 lines · Deepa Dinamani

This does not have the recent s390 patch I sent out to be applied on linux-next. This is not yet in linux-next.

------

s390: Use asm/compat.h instead of linux/compat.h

Include asm/compat.h directly for uses of compat_ptr. This includes the compat defines when CONFIG_COMPAT is not on.

Also make compat data structure definitions conditional on CONFIG_COMPAT, to remove circular include dependencies in elf.h

Quoted 7 lines
Quoted 3 lines

I have an increasingly bad feeling about this workaround, I think we need to try harder to make linux/compat.h contain whatever is expected and provide everything that asm/compat.h does.

This is my plan, But, I was planning to get rid of this by posting individual patches to specific architectures after this series was merged to keep this series less complicated.
Problem comes from including compat code even when CONFIG_COMPAT is not on.

Quoted 2 lines

Generally it is expected that including linux/foo.h is a strict superset of asm/foo.h, and you should use the former in device drivers.

Quoted 8 lines

Right. I was also hesitant about this change. But, in this particular case, these are only s390 drivers that are not built on any other architectures.
So I thought this should be okay. Also, I plan to clean this up in the architecture specific patches.

If you still prefer fixing these now rather than later, then I can give it another try and post an update.

I've applied a different fix for now, see below.

I'll give it some more testing, but this solves both the arm64 and s390 issues I saw earlier, and lets us always include linux/compat.h instead of having to include asm/compat.h.

Let me know if you see a problem with that one.

Arnd

commit d1a353a4a8cce86c7651a8011cc860a921b850bc

Author: Arnd Bergmann <[email protected]>
Date:   Mon Mar 26 16:59:15 2018 +0200

compat: add an asm-generic/compat.h file

We have a couple of files that try to include asm/compat.h on architectures where this is available. Those should generally use the higher-level linux/compat.h file, but that in turn fails to include asm/compat.h when CONFIG_COMPAT is disabled, unless we can provide that header on all architectures.

This adds the asm/compat.h for all remaining architectures to simplify the dependencies.

Architectures that are getting removed in linux-4.17 are not changed here, to avoid needless conflicts with the removal patches. Those architectures are broken by this patch, but we have already shown that they have no users.

arch/alpha/include/asm/Kbuild +1 -0
index 9b68790013e2..0580cb8c84b2 100644
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 
 
+generic-y += compat.h
 generic-y += exec.h
 generic-y += export.h
 generic-y += fb.h
arch/arc/include/asm/Kbuild +1 -0
index 4bd5d4369e05..d51bc22e8795 100644
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 generic-y += bugs.h
+generic-y += compat.h
 generic-y += device.h
 generic-y += div64.h
 generic-y += emergency-restart.h
arch/arm/include/asm/Kbuild +1 -0
index 873e3c189279..1d66db9c9db5 100644
@@ -1,3 +1,4 @@
+generic-y += compat.h
 generic-y += current.h
 generic-y += early_ioremap.h
 generic-y += emergency-restart.h
arch/c6x/include/asm/Kbuild +1 -0
index fd4c840de837..24037486317c 100644
@@ -1,6 +1,7 @@
 generic-y += atomic.h
 generic-y += barrier.h
 generic-y += bugs.h
+generic-y += compat.h
 generic-y += current.h
 generic-y += device.h
 generic-y += div64.h
arch/h8300/include/asm/Kbuild +1 -0
index 14bac06b7116..a5d0b2991f47 100644
@@ -3,6 +3,7 @@ generic-y += barrier.h
 generic-y += bugs.h
 generic-y += cacheflush.h
 generic-y += checksum.h
+generic-y += compat.h
 generic-y += current.h
 generic-y += delay.h
 generic-y += device.h
arch/hexagon/include/asm/Kbuild +1 -0
index e9743f689fb8..dd2fd9c0d292 100644
@@ -2,6 +2,7 @@
 generic-y += barrier.h
 generic-y += bug.h
 generic-y += bugs.h
+generic-y += compat.h
 generic-y += current.h
 generic-y += device.h
 generic-y += div64.h
arch/ia64/include/asm/Kbuild +1 -0
index 6dd867873364..557bbc8ba9f5 100644
@@ -1,3 +1,4 @@
+generic-y += compat.h
 generic-y += exec.h
 generic-y += irq_work.h
 generic-y += mcs_spinlock.h
arch/m68k/include/asm/Kbuild +1 -0
index 88a9d27df1ac..4d8d68c4e3dd 100644
@@ -1,4 +1,5 @@
 generic-y += barrier.h
+generic-y += compat.h
 generic-y += device.h
 generic-y += emergency-restart.h
 generic-y += exec.h
arch/microblaze/include/asm/Kbuild +1 -0
index 3c80a5a308ed..fe6a6c6e5003 100644
@@ -2,6 +2,7 @@ generic-y += barrier.h
 generic-y += bitops.h
 generic-y += bug.h
 generic-y += bugs.h
+generic-y += compat.h
 generic-y += device.h
 generic-y += div64.h
 generic-y += emergency-restart.h
arch/nios2/include/asm/Kbuild +1 -0
index d232da2cbb38..64ed3d656956 100644
@@ -4,6 +4,7 @@ generic-y += bitops.h
 generic-y += bug.h
 generic-y += bugs.h
 generic-y += cmpxchg.h
+generic-y += compat.h
 generic-y += current.h
 generic-y += device.h
 generic-y += div64.h
arch/openrisc/include/asm/Kbuild +1 -0
index f05c722a21f8..65964d390b10 100644
@@ -2,6 +2,7 @@ generic-y += barrier.h
 generic-y += bug.h
 generic-y += bugs.h
 generic-y += checksum.h
+generic-y += compat.h
 generic-y += current.h
 generic-y += device.h
 generic-y += div64.h
arch/sh/include/asm/Kbuild +1 -0
index 1efcce74997b..46dd82ab2c29 100644
@@ -1,3 +1,4 @@
+generic-y += compat.h
 generic-y += current.h
 generic-y += delay.h
 generic-y += div64.h
arch/um/include/asm/Kbuild +1 -0
index bb5a196c3061..b10dde6cb793 100644
@@ -1,6 +1,7 @@
 generic-y += barrier.h
 generic-y += bpf_perf_event.h
 generic-y += bug.h
+generic-y += compat.h
 generic-y += current.h
 generic-y += delay.h
 generic-y += device.h
arch/unicore32/include/asm/Kbuild +1 -0
index 6f70c76c81fc..bfc7abe77905 100644
@@ -1,5 +1,6 @@
 generic-y += atomic.h
 generic-y += bugs.h
+generic-y += compat.h
 generic-y += current.h
 generic-y += device.h
 generic-y += div64.h
arch/xtensa/include/asm/Kbuild +1 -0
index 436b20337168..e5e1e61c538c 100644
@@ -1,4 +1,5 @@
 generic-y += bug.h
+generic-y += compat.h
 generic-y += device.h
 generic-y += div64.h
 generic-y += dma-contiguous.h
include/asm-generic/compat.h new file +3 -0
new file mode 100644
index 000000000000..28819451b6d1
@@ -0,0 +1,3 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+/* This is an empty stub for 32-bit-only architectures */
include/linux/compat.h +2 -1
index e291096dc937..94291c3e67dc 100644
@@ -17,8 +17,9 @@
 #include <linux/aio_abi.h> /* for aio_context_t */
 #include <linux/unistd.h>
 
-#ifdef CONFIG_COMPAT
 #include <asm/compat.h>
+
+#ifdef CONFIG_COMPAT
 #include <asm/siginfo.h>
 #include <asm/signal.h>
 #endif