浏览代码

[PPP]: Sparse warning fixes.

Fix a bunch of warnings in PPP and related drivers. Mostly because
sparse doesn't like it when the the function is only marked private in
the forward declaration.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Hemminger 17 年之前
父节点
当前提交
3c582b30bc
共有 5 个文件被更改,包括 8 次插入6 次删除
  1. 2 2
      drivers/net/ppp_deflate.c
  2. 1 1
      drivers/net/ppp_generic.c
  3. 1 1
      drivers/net/ppp_synctty.c
  4. 2 0
      drivers/net/pppoe.c
  5. 2 2
      drivers/net/slhc.c

+ 2 - 2
drivers/net/ppp_deflate.c

@@ -206,7 +206,7 @@ static void z_comp_reset(void *arg)
  *	Returns the length of the compressed packet, or 0 if the
  *	Returns the length of the compressed packet, or 0 if the
  *	packet is incompressible.
  *	packet is incompressible.
  */
  */
-int z_compress(void *arg, unsigned char *rptr, unsigned char *obuf,
+static int z_compress(void *arg, unsigned char *rptr, unsigned char *obuf,
 	       int isize, int osize)
 	       int isize, int osize)
 {
 {
 	struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
 	struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
@@ -435,7 +435,7 @@ static void z_decomp_reset(void *arg)
  * bug, so we return DECOMP_FATALERROR for them in order to turn off
  * bug, so we return DECOMP_FATALERROR for them in order to turn off
  * compression, even though they are detected by inspecting the input.
  * compression, even though they are detected by inspecting the input.
  */
  */
-int z_decompress(void *arg, unsigned char *ibuf, int isize,
+static int z_decompress(void *arg, unsigned char *ibuf, int isize,
 		 unsigned char *obuf, int osize)
 		 unsigned char *obuf, int osize)
 {
 {
 	struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
 	struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;

+ 1 - 1
drivers/net/ppp_generic.c

@@ -1871,7 +1871,7 @@ ppp_mp_insert(struct ppp *ppp, struct sk_buff *skb)
  * complete packet, or we get to the sequence number for a fragment
  * complete packet, or we get to the sequence number for a fragment
  * which hasn't arrived but might still do so.
  * which hasn't arrived but might still do so.
  */
  */
-struct sk_buff *
+static struct sk_buff *
 ppp_mp_reconstruct(struct ppp *ppp)
 ppp_mp_reconstruct(struct ppp *ppp)
 {
 {
 	u32 seq = ppp->nextseq;
 	u32 seq = ppp->nextseq;

+ 1 - 1
drivers/net/ppp_synctty.c

@@ -560,7 +560,7 @@ static void ppp_sync_process(unsigned long arg)
  * Procedures for encapsulation and framing.
  * Procedures for encapsulation and framing.
  */
  */
 
 
-struct sk_buff*
+static struct sk_buff*
 ppp_sync_txmunge(struct syncppp *ap, struct sk_buff *skb)
 ppp_sync_txmunge(struct syncppp *ap, struct sk_buff *skb)
 {
 {
 	int proto;
 	int proto;

+ 2 - 0
drivers/net/pppoe.c

@@ -989,6 +989,7 @@ out:
 }
 }
 
 
 static void *pppoe_seq_start(struct seq_file *seq, loff_t *pos)
 static void *pppoe_seq_start(struct seq_file *seq, loff_t *pos)
+	__acquires(pppoe_hash_lock)
 {
 {
 	loff_t l = *pos;
 	loff_t l = *pos;
 
 
@@ -1022,6 +1023,7 @@ out:
 }
 }
 
 
 static void pppoe_seq_stop(struct seq_file *seq, void *v)
 static void pppoe_seq_stop(struct seq_file *seq, void *v)
+	__releases(pppoe_hash_lock)
 {
 {
 	read_unlock_bh(&pppoe_hash_lock);
 	read_unlock_bh(&pppoe_hash_lock);
 }
 }

+ 2 - 2
drivers/net/slhc.c

@@ -174,7 +174,7 @@ put16(unsigned char *cp, unsigned short x)
 
 
 
 
 /* Encode a number */
 /* Encode a number */
-unsigned char *
+static unsigned char *
 encode(unsigned char *cp, unsigned short n)
 encode(unsigned char *cp, unsigned short n)
 {
 {
 	if(n >= 256 || n == 0){
 	if(n >= 256 || n == 0){
@@ -199,7 +199,7 @@ pull16(unsigned char **cpp)
 }
 }
 
 
 /* Decode a number */
 /* Decode a number */
-long
+static long
 decode(unsigned char **cpp)
 decode(unsigned char **cpp)
 {
 {
 	register int x;
 	register int x;