Remove unneeded stddef.h includes
Subsystems (5)
cover Remove unneeded stddef.h includes
Hi All,
These were causing openrisc build to fail when building with allyesconfig using a musl toolchain. Removing them doesnt seem to cause any issues.
The line removed was:
#include <stddef.h>
Perhaps what was wanted was 'linux/stddef.h' but there did seem to be any special uses so I just removed it. Also, sending these patches should help the kbuild robots verify that.
If I can get acks I will push it in with my openrisc branch. But if this should got through the net and staging paths I am happy with that.
-Stafford
Stafford Horne (2):
libceph: Remove unneeded stddef.h include
staging: vchip_shim: Remove unneeded stddef.h include
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c | 2 -- net/ceph/snapshot.c | 2 -- 2 files changed, 4 deletions(-)
Signature · 1 line
2.9.3
PATCH 1/2 libceph: Remove unneeded stddef.h include
This was causing a build failure for openrisc when using musl and gcc 5.4.0 since the file is not available in the toolchain.
It doesnt seem this is needed and removing it does not cause any build warnings for me.
--- net/ceph/snapshot.c | 2 -- 1 file changed, 2 deletions(-)
net/ceph/snapshot.c +0 -2
@@ -18,8 +18,6 @@* 02110-1301, USA. */ -#include <stddef.h> -#include <linux/types.h> #include <linux/export.h> #include <linux/ceph/libceph.h>
Signature · 1 line
2.9.3
Re: [PATCH 1/2] libceph: Remove unneeded stddef.h include
Quoted 16 lines · Stafford Horne
This was causing a build failure for openrisc when using musl and gcc 5.4.0 since the file is not available in the toolchain.
It doesnt seem this is needed and removing it does not cause any build warnings for me.
Signed-off-by Stafford Horne <[email protected]>--- net/ceph/snapshot.c | 2 -- 1 file changed, 2 deletions(-)net/ceph/snapshot.c +0
-0
net/ceph/snapshot.c line 23
Quoted 8 lines
net/ceph/snapshot.c +0
-2@@ -18,8 +18,6 @@* 02110-1301, USA. */ -#include <stddef.h> -#include <linux/types.h> #include <linux/export.h> #include <linux/ceph/libceph.h>
Applied.
Thanks,
Ilya
RE: [PATCH 1/2] libceph: Remove unneeded stddef.h include
In reply to Stafford HorneFrom: Stafford Horne
Quoted 6 lines
Sent: 05 February 2017 07:08
This was causing a build failure for openrisc when using musl and gcc 5.4.0 since the file is not available in the toolchain.It doesnt seem this is needed and removing it does not cause any build warnings for me.
Hmmm... stddef.h is part of the SuS v2.
Required to get definitions for NULL, offsetof(), ptrdiff_t and size_t.
So any system that is pretending to by unix-like ought to have one.
David
Re: [PATCH 1/2] libceph: Remove unneeded stddef.h include
Quoted 5 lines · David Laight
From: Stafford Horne
Quoted 4 lines
Sent: 05 February 2017 07:08
This was causing a build failure for openrisc when using musl and gcc 5.4.0 since the file is not available in the toolchain.
Quoted 7 lines
Quoted 2 lines
It doesnt seem this is needed and removing it does not cause any build warnings for me.
Hmmm...
stddef.his part of the SuS v2.
Required to get definitions for NULL,offsetof(),ptrdiff_tandsize_t.So any system that is pretending to by unix-like ought to have one.
Hello,
I agree, and also I can see that musl and gcc both do provide it. I am not sure why its not getting included for kernel builds, I didnt look into it much because on the other hand...
Linux also provides it in 'linux/stddef.h'. In this case vchiq_shim.c includes "vchiq_util.h".
which includes "linux/string.h"
which includes "linux/stddef.h"
So the requirement seems satisfied.
I am fine to send a patch to change the include to <linux/stddef.h> as I mentioned in the cover letter. But I dont think its really needed.
-Stafford
PATCH 2/2 staging: vchip_shim: Remove unneeded stddef.h include
In reply to Stafford HorneBuilding on openrisc musl toolchain this causes the allyesconfig build to fail.
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c:42:20:
fatal error: stddef.h: No such file or directory
Removing this causes no issues with the build.
--- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c | 2 -- 1 file changed, 2 deletions(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c +0 -2
@@ -39,8 +39,6 @@#include "vchiq_util.h" -#include <stddef.h> -#define vchiq_status_to_vchi (status) ((int32_t)status) typedef struct {
Signature · 1 line
2.9.3