Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1d3a355 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller
Browse files

[DCCP]: Fix sparse warnings

parent 8649b0d4
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -82,12 +82,13 @@ enum ccid3_options {

static int ccid3_debug;

struct dccp_tx_hist *ccid3_tx_hist;
struct dccp_rx_hist *ccid3_rx_hist;
static struct dccp_tx_hist *ccid3_tx_hist;
static struct dccp_rx_hist *ccid3_rx_hist;

static kmem_cache_t *ccid3_loss_interval_hist_slab;

static inline struct ccid3_loss_interval_hist_entry *ccid3_loss_interval_hist_entry_new(int prio)
static inline struct ccid3_loss_interval_hist_entry *
	ccid3_loss_interval_hist_entry_new(const unsigned int __nocast prio)
{
	return kmem_cache_alloc(ccid3_loss_interval_hist_slab, prio);
}
@@ -1593,7 +1594,9 @@ static void ccid3_hc_rx_insert_options(struct sock *sk, struct sk_buff *skb)
 * These are integers as per section 8 of RFC3448. We can then divide by 4 *
 * when we use it.
 */
const int ccid3_hc_rx_w[TFRC_RECV_IVAL_F_LENGTH] = { 4, 4, 4, 4, 3, 2, 1, 1, };
static const int ccid3_hc_rx_w[TFRC_RECV_IVAL_F_LENGTH] = {
	4, 4, 4, 4, 3, 2, 1, 1,
};

/*
 * args: fvalue - function value to match
@@ -1601,7 +1604,7 @@ const int ccid3_hc_rx_w[TFRC_RECV_IVAL_F_LENGTH] = { 4, 4, 4, 4, 3, 2, 1, 1, };
 *
 * both fvalue and p are multiplied by 1,000,000 to use ints
 */
u32 calcx_reverse_lookup(u32 fvalue) {
static u32 calcx_reverse_lookup(u32 fvalue) {
	int ctr = 0;
	int small;

+9 −4
Original line number Diff line number Diff line
@@ -231,19 +231,22 @@ extern void dccp_close(struct sock *sk, long timeout);
extern struct sk_buff	*dccp_make_response(struct sock *sk,
					    struct dst_entry *dst,
					    struct request_sock *req);
extern struct sk_buff	*dccp_make_reset(struct sock *sk,
					 struct dst_entry *dst,
					 enum dccp_reset_codes code);

extern int	   dccp_connect(struct sock *sk);
extern int	   dccp_disconnect(struct sock *sk, int flags);
extern int	   dccp_getsockopt(struct sock *sk, int level, int optname,
				   char *optval, int *optlen);
				   char __user *optval, int __user *optlen);
extern int	   dccp_setsockopt(struct sock *sk, int level, int optname,
				   char __user *optval, int optlen);
extern int	   dccp_ioctl(struct sock *sk, int cmd, unsigned long arg);
extern int	   dccp_sendmsg(struct kiocb *iocb, struct sock *sk,
				struct msghdr *msg, size_t size);
extern int	   dccp_recvmsg(struct kiocb *iocb, struct sock *sk,
				struct msghdr *msg, size_t len, int nonblock,
				int flags, int *addr_len);
extern int	   dccp_setsockopt(struct sock *sk, int level, int optname,
				   char *optval, int optlen);
extern void	   dccp_shutdown(struct sock *sk, int how);

extern int	   dccp_v4_checksum(const struct sk_buff *skb,
@@ -419,7 +422,9 @@ struct dccp_ackpkts {
	u8			dccpap_buf[0];
};

extern struct dccp_ackpkts *dccp_ackpkts_alloc(unsigned int len, int priority);
extern struct dccp_ackpkts *
		dccp_ackpkts_alloc(unsigned int len,
				  const unsigned int __nocast priority);
extern void dccp_ackpkts_free(struct dccp_ackpkts *ap);
extern int dccp_ackpkts_add(struct dccp_ackpkts *ap, u64 ackno, u8 state);
extern void dccp_ackpkts_check_rcv_ackno(struct dccp_ackpkts *ap,
+2 −5
Original line number Diff line number Diff line
@@ -617,9 +617,6 @@ out:
	sock_put(sk);
}

extern struct sk_buff *dccp_make_reset(struct sock *sk, struct dst_entry *dst,
				       enum dccp_reset_codes code);

int dccp_v4_send_reset(struct sock *sk, enum dccp_reset_codes code)
{
	struct sk_buff *skb;
@@ -881,7 +878,7 @@ static struct dst_entry* dccp_v4_route_skb(struct sock *sk,
	return &rt->u.dst;
}

void dccp_v4_ctl_send_reset(struct sk_buff *rxskb)
static void dccp_v4_ctl_send_reset(struct sk_buff *rxskb)
{
	int err;
	struct dccp_hdr *rxdh = dccp_hdr(rxskb), *dh;
@@ -1268,7 +1265,7 @@ static int dccp_v4_init_sock(struct sock *sk)
	return 0;
}

int dccp_v4_destroy_sock(struct sock *sk)
static int dccp_v4_destroy_sock(struct sock *sk)
{
	struct dccp_sock *dp = dccp_sk(sk);

+2 −1
Original line number Diff line number Diff line
@@ -499,7 +499,8 @@ void dccp_insert_options(struct sock *sk, struct sk_buff *skb)
	}
}

struct dccp_ackpkts *dccp_ackpkts_alloc(unsigned int len, int priority)
struct dccp_ackpkts *dccp_ackpkts_alloc(const unsigned int len,
				        const unsigned int __nocast priority)
{
	struct dccp_ackpkts *ap = kmalloc(sizeof(*ap) + len, priority);

+6 −6
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ extern struct dccp_rx_hist_entry *

static inline struct dccp_tx_hist_entry *
		dccp_tx_hist_entry_new(struct dccp_tx_hist *hist,
					       const int prio)
				       const unsigned int __nocast prio)
{
	struct dccp_tx_hist_entry *entry = kmem_cache_alloc(hist->dccptxh_slab,
							    prio);
@@ -130,7 +130,7 @@ static inline struct dccp_rx_hist_entry *
		     dccp_rx_hist_entry_new(struct dccp_rx_hist *hist,
				     	    const u32 ndp, 
					    const struct sk_buff *skb,
						    const int prio)
					    const unsigned int __nocast prio)
{
	struct dccp_rx_hist_entry *entry = kmem_cache_alloc(hist->dccprxh_slab,
							    prio);
Loading