From patchwork Fri Nov 7 01:53:13 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harvey Harrison X-Patchwork-Id: 7649 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 3AD89DDE1E for ; Fri, 7 Nov 2008 12:53:42 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751052AbYKGBxR (ORCPT ); Thu, 6 Nov 2008 20:53:17 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750975AbYKGBxR (ORCPT ); Thu, 6 Nov 2008 20:53:17 -0500 Received: from rv-out-0506.google.com ([209.85.198.226]:55997 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750757AbYKGBxQ (ORCPT ); Thu, 6 Nov 2008 20:53:16 -0500 Received: by rv-out-0506.google.com with SMTP id k40so1065800rvb.1 for ; Thu, 06 Nov 2008 17:53:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=q7G/4gxVpSqz1QcmJ8nWBwTrSk5PXyUsBKu4SvBOctI=; b=m3KOou43lnTiBhge2kHer5W6RdMPAYOHfRhv4t/5xBBw3MnSVvKsmY5T37RP/NLzc/ jbkX/1SeCBZ2+9gUIvcX6ilKg+yrVKiZH+kBOO8kBmccLq8OL5Dw0uSWXZWyQpQzxjgT KUqwO94mOWiT71w/3dJ8hEMRzkwuWp8S9xH2Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; b=HBr17FKJcIJfggmJ5YNG3r87K87aMJjQ8eOFYgBAS/cCv36Opa6Te7cw3Hg9/fQAY7 FEbpxy/OaNJWfqojIQdfkToIp1lmNUfJyhiAOy1w92jqYB6yE1tteHBr+nQbdvbpuKqO aJAmKE3Kupv0k2qiUT0rUhUJH2Ii3irClZCrs= Received: by 10.140.132.3 with SMTP id f3mr1598277rvd.56.1226022795359; Thu, 06 Nov 2008 17:53:15 -0800 (PST) Received: from ?192.168.1.100? (216-19-190-48.dyn.novuscom.net [216.19.190.48]) by mx.google.com with ESMTPS id g22sm3206177rvb.8.2008.11.06.17.53.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 06 Nov 2008 17:53:15 -0800 (PST) Subject: [PATCH] phonet: sparse annotations of protocol, remove forward declaration From: Harvey Harrison To: Remi Denis-Courmont Cc: linux-netdev , David Miller Date: Thu, 06 Nov 2008 17:53:13 -0800 Message-Id: <1226022793.5482.1.camel@brick> Mime-Version: 1.0 X-Mailer: Evolution 2.24.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org net/phonet/af_phonet.c:38:36: error: marked inline, but without a definition net/phonet/pep-gprs.c:63:10: warning: incorrect type in return expression (different base types) net/phonet/pep-gprs.c:63:10: expected int net/phonet/pep-gprs.c:63:10: got restricted __be16 [usertype] net/phonet/pep-gprs.c:65:10: warning: incorrect type in return expression (different base types) net/phonet/pep-gprs.c:65:10: expected int net/phonet/pep-gprs.c:65:10: got restricted __be16 [usertype] net/phonet/pep-gprs.c:124:16: warning: incorrect type in assignment (different base types) net/phonet/pep-gprs.c:124:16: expected restricted __be16 [usertype] protocol net/phonet/pep-gprs.c:124:16: got unsigned short [unsigned] [usertype] protocol Signed-off-by: Harvey Harrison --- net/phonet/af_phonet.c | 11 +++++------ net/phonet/pep-gprs.c | 8 ++++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c index defeb7a..f400ff1 100644 --- a/net/phonet/af_phonet.c +++ b/net/phonet/af_phonet.c @@ -35,7 +35,11 @@ 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); + +static inline void phonet_proto_put(struct phonet_protocol *pp) +{ + module_put(pp->prot->owner); +} /* protocol family functions */ @@ -428,11 +432,6 @@ static struct phonet_protocol *phonet_proto_get(int protocol) 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) { diff --git a/net/phonet/pep-gprs.c b/net/phonet/pep-gprs.c index 9978afb..a432407 100644 --- a/net/phonet/pep-gprs.c +++ b/net/phonet/pep-gprs.c @@ -49,14 +49,14 @@ struct gprs_dev { unsigned tx_max; }; -static int gprs_type_trans(struct sk_buff *skb) +static __be16 gprs_type_trans(struct sk_buff *skb) { const u8 *pvfc; u8 buf; pvfc = skb_header_pointer(skb, 0, 1, &buf); if (!pvfc) - return 0; + return htons(0); /* Look at IP version field */ switch (*pvfc >> 4) { case 4: @@ -64,7 +64,7 @@ static int gprs_type_trans(struct sk_buff *skb) case 6: return htons(ETH_P_IPV6); } - return 0; + return htons(0); } /* @@ -84,7 +84,7 @@ static void gprs_state_change(struct sock *sk) static int gprs_recv(struct gprs_dev *dev, struct sk_buff *skb) { int err = 0; - u16 protocol = gprs_type_trans(skb); + __be16 protocol = gprs_type_trans(skb); if (!protocol) { err = -EINVAL;