Skip to contentSkip to conversation

staging: lustre: ptlrpc: add missing include directive

PATCH In review Ioan-Adrian Ratiu 3 participants 5 messages Aug 14, 2015 – Aug 15, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lustre: ptlrpc: add missing include directive

Without including ptlrpc_internal.h, GCC gives prototype warnings "pack_generic.c:642:5: warning: no previous prototype for ..." and sparse also complains "pack_generic.c:642:5: warning: symbol 'lustre_unpack_req_ptlrpc_body' was not declared. ..."

---
 drivers/staging/lustre/lustre/ptlrpc/pack_generic.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +2 -0
index 2787bfd..84937ad 100644
@@ -52,6 +52,8 @@
 #include "../include/obd_cksum.h"
 #include "../include/lustre/ll_fiemap.h"
 
+#include "ptlrpc_internal.h"
+
 static inline int lustre_msg_hdr_size_v2(int count)
 {
 	return cfs_size_round(offsetof(struct lustre_msg_v2,
Signature · 1 line
2.1.4
maintainer
#1 lore raw
Quoted 2 lines · Ioan-Adrian Ratiu

Without including ptlrpc_internal.h, GCC gives prototype warnings "pack_generic.c:642:5: warning: no previous prototype for ..."

It does? What version of gcc give you that, I don't see that here.

#2 lore raw
Quoted 6 lines · On Fri, 14 Aug 2015 18:50:24 -0700 Greg KH <[email protected]> wrote:
Quoted 2 lines · Ioan-Adrian Ratiu

Without including ptlrpc_internal.h, GCC gives prototype warnings "pack_generic.c:642:5: warning: no previous prototype for ..."

It does? What version of gcc give you that, I don't see that here.

Yes, but it's a non-default warning (-Wmissing-prototypes)

$ gcc --version
gcc (Gentoo 4.9.3 p1.0, pie-0.6.2) 4.9.3

When testing the above patch I've used Ubuntu Vivid Vervet's gcc (also 4.9 I think, I don't have access to that machine right now).

To see the warn I'm adding "ccflags-y := -Wmissing-prototypes" to a Makefile then "make SUBDIRS=..."

#3 lore raw

Hello!

Quoted 5 lines · Ioan-Adrian Ratiu
Quoted 3 lines
Quoted 2 lines

Without including ptlrpc_internal.h, GCC gives prototype warnings "pack_generic.c:642:5: warning: no previous prototype for ..."

It does? What version of gcc give you that, I don't see that here.

Yes, but it's a non-default warning (-Wmissing-prototypes)

Quoted 8 lines
$ gcc --version
gcc (Gentoo 4.9.3 p1.0, pie-0.6.2) 4.9.3

When testing the above patch I've used Ubuntu Vivid Vervet's gcc (also 4.9 I think, I don't have access to that machine right now).

To see the warn I'm adding "ccflags-y := -Wmissing-prototypes" to a Makefile then "make SUBDIRS=…"

Duh, so essentially it tells you that you have a non-static function that lacks a previously defined prototype, but because it's non-static, it's likely used elsewhere and the prototype might get out of sync with the actual function definition?

I guess it's no big deal to include the ptlrpc_internal.h there to catch potential problems like that.

Thanks.

Bye,
Oleg

maintainer
#4 lore raw
In reply to Ioan-Adrian Ratiu
Quoted 11 lines · Ioan-Adrian Ratiu
Quoted 6 lines · On Fri, 14 Aug 2015 18:50:24 -0700 Greg KH <[email protected]> wrote:
Quoted 2 lines · Ioan-Adrian Ratiu

Without including ptlrpc_internal.h, GCC gives prototype warnings "pack_generic.c:642:5: warning: no previous prototype for ..."

It does? What version of gcc give you that, I don't see that here.

Yes, but it's a non-default warning (-Wmissing-prototypes)

Then you should say that, otherwise you have us worrying something is really wrong with our build/compiler versions...

I've taken this patch, but next time please be more specific.

thanks,

greg k-h