From patchwork Mon Nov 17 10:03:20 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Dobriyan X-Patchwork-Id: 9132 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 4461BDDDF5 for ; Mon, 17 Nov 2008 20:59:50 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752086AbYKQJ7q (ORCPT ); Mon, 17 Nov 2008 04:59:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752018AbYKQJ7p (ORCPT ); Mon, 17 Nov 2008 04:59:45 -0500 Received: from ug-out-1314.google.com ([66.249.92.172]:48657 "EHLO ug-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751618AbYKQJ7o (ORCPT ); Mon, 17 Nov 2008 04:59:44 -0500 Received: by ug-out-1314.google.com with SMTP id 39so355615ugf.37 for ; Mon, 17 Nov 2008 01:59:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=CQRD9U28XqKVhnAEV0LGtjoigpzYVYhfp1krNtv+y58=; b=JBKINYqbuYpsihteIhvt1HoTZ44FrO/zEtW1vrjDhG0SVdkjahS83IooeV7WcHewiu 5Gi/SSmEadVGG19BF2yBBVw7W4Rgl4CeoqJYI9REgg7FdFgUAzvwewnD3k1yGd+sVL4I IMS4uSZlHSEsX1pPQtcCN3IHRngcXrC4svnPA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=ccnagBMUaV+T/AKW362JYB43JBhukQMkXgWQ4tZDHmK4od6EWaQg1UuMn2kT8+EVB3 dxtVAUDwWkT2BNw9ghSvF2xcbd/LVHcnj+HbF8rhPONwKL9pPvb8H2/w4PqDWiWqDMb2 vKGyn3EqK859oc7SmLsNHCGroyPHwnW8aQKmw= Received: by 10.66.221.19 with SMTP id t19mr1172893ugg.69.1226915983027; Mon, 17 Nov 2008 01:59:43 -0800 (PST) Received: from localhost (gw.zunet.ru [217.67.117.64]) by mx.google.com with ESMTPS id 31sm3765071ugg.34.2008.11.17.01.59.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 17 Nov 2008 01:59:42 -0800 (PST) Date: Mon, 17 Nov 2008 13:03:20 +0300 From: Alexey Dobriyan To: davem@davemloft.net Cc: netdev@vger.kernel.org, remi.denis-courmont@nokia.com Subject: [PATCH] phonet: fix compilation with gcc-3.4 Message-ID: <20081117100320.GB10586@x200.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- net/phonet/af_phonet.c | 52 ++++++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 28 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/net/phonet/af_phonet.c +++ b/net/phonet/af_phonet.c @@ -33,9 +33,30 @@ #include #include -static struct net_proto_family phonet_proto_family; -static struct phonet_protocol *phonet_proto_get(int protocol); -static inline void phonet_proto_put(struct phonet_protocol *pp); +/* Transport protocol registration */ +static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly; +static DEFINE_SPINLOCK(proto_tab_lock); + +static struct phonet_protocol *phonet_proto_get(int protocol) +{ + struct phonet_protocol *pp; + + if (protocol >= PHONET_NPROTO) + return NULL; + + spin_lock(&proto_tab_lock); + pp = proto_tab[protocol]; + if (pp && !try_module_get(pp->prot->owner)) + pp = NULL; + spin_unlock(&proto_tab_lock); + + return pp; +} + +static inline void phonet_proto_put(struct phonet_protocol *pp) +{ + module_put(pp->prot->owner); +} /* protocol family functions */ @@ -375,10 +396,6 @@ static struct packet_type phonet_packet_type = { .func = phonet_rcv, }; -/* Transport protocol registration */ -static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly; -static DEFINE_SPINLOCK(proto_tab_lock); - int __init_or_module phonet_proto_register(int protocol, struct phonet_protocol *pp) { @@ -412,27 +429,6 @@ void phonet_proto_unregister(int protocol, struct phonet_protocol *pp) } EXPORT_SYMBOL(phonet_proto_unregister); -static struct phonet_protocol *phonet_proto_get(int protocol) -{ - struct phonet_protocol *pp; - - if (protocol >= PHONET_NPROTO) - return NULL; - - spin_lock(&proto_tab_lock); - pp = proto_tab[protocol]; - if (pp && !try_module_get(pp->prot->owner)) - pp = NULL; - spin_unlock(&proto_tab_lock); - - return pp; -} - -static inline void phonet_proto_put(struct phonet_protocol *pp) -{ - module_put(pp->prot->owner); -} - /* Module registration */ static int __init phonet_init(void) {