phonet: fix compilation with gcc-3.4

CC [M] net/phonet/af_phonet.o
net/phonet/af_phonet.c: In function `pn_socket_create':
net/phonet/af_phonet.c:38: sorry, unimplemented: inlining failed in call to 'phonet_proto_put': function body not available
net/phonet/af_phonet.c:99: sorry, unimplemented: called from here
make[3]: *** [net/phonet/af_phonet.o] Error 1

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Alexey Dobriyan and committed by David S. Miller 566521d6 79aefa45

+24 -28
+24 -28
net/phonet/af_phonet.c
··· 33 33 #include <net/phonet/phonet.h> 34 34 #include <net/phonet/pn_dev.h> 35 35 36 - static struct net_proto_family phonet_proto_family; 37 - static struct phonet_protocol *phonet_proto_get(int protocol); 38 - static inline void phonet_proto_put(struct phonet_protocol *pp); 36 + /* Transport protocol registration */ 37 + static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly; 38 + static DEFINE_SPINLOCK(proto_tab_lock); 39 + 40 + static struct phonet_protocol *phonet_proto_get(int protocol) 41 + { 42 + struct phonet_protocol *pp; 43 + 44 + if (protocol >= PHONET_NPROTO) 45 + return NULL; 46 + 47 + spin_lock(&proto_tab_lock); 48 + pp = proto_tab[protocol]; 49 + if (pp && !try_module_get(pp->prot->owner)) 50 + pp = NULL; 51 + spin_unlock(&proto_tab_lock); 52 + 53 + return pp; 54 + } 55 + 56 + static inline void phonet_proto_put(struct phonet_protocol *pp) 57 + { 58 + module_put(pp->prot->owner); 59 + } 39 60 40 61 /* protocol family functions */ 41 62 ··· 396 375 .func = phonet_rcv, 397 376 }; 398 377 399 - /* Transport protocol registration */ 400 - static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly; 401 - static DEFINE_SPINLOCK(proto_tab_lock); 402 - 403 378 int __init_or_module phonet_proto_register(int protocol, 404 379 struct phonet_protocol *pp) 405 380 { ··· 428 411 proto_unregister(pp->prot); 429 412 } 430 413 EXPORT_SYMBOL(phonet_proto_unregister); 431 - 432 - static struct phonet_protocol *phonet_proto_get(int protocol) 433 - { 434 - struct phonet_protocol *pp; 435 - 436 - if (protocol >= PHONET_NPROTO) 437 - return NULL; 438 - 439 - spin_lock(&proto_tab_lock); 440 - pp = proto_tab[protocol]; 441 - if (pp && !try_module_get(pp->prot->owner)) 442 - pp = NULL; 443 - spin_unlock(&proto_tab_lock); 444 - 445 - return pp; 446 - } 447 - 448 - static inline void phonet_proto_put(struct phonet_protocol *pp) 449 - { 450 - module_put(pp->prot->owner); 451 - } 452 414 453 415 /* Module registration */ 454 416 static int __init phonet_init(void)