Skip to content

Commit

Permalink
[DCCP]: Fix sparse warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Arnaldo Carvalho de Melo authored and David S. Miller committed Aug 29, 2005
1 parent 8649b0d commit a1d3a35
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 24 deletions.
13 changes: 8 additions & 5 deletions net/dccp/ccids/ccid3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -1593,15 +1594,17 @@ 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
* returns: p closest to that value
*
* 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;

Expand Down
13 changes: 9 additions & 4 deletions net/dccp/dccp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 2 additions & 5 deletions net/dccp/ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,6 @@ void dccp_v4_err(struct sk_buff *skb, u32 info)
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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion net/dccp/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
12 changes: 6 additions & 6 deletions net/dccp/packet_history.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ extern struct dccp_rx_hist_entry *
dccp_rx_hist_find_data_packet(const struct list_head *list);

static inline struct dccp_tx_hist_entry *
dccp_tx_hist_entry_new(struct dccp_tx_hist *hist,
const int prio)
dccp_tx_hist_entry_new(struct dccp_tx_hist *hist,
const unsigned int __nocast prio)
{
struct dccp_tx_hist_entry *entry = kmem_cache_alloc(hist->dccptxh_slab,
prio);
Expand Down Expand Up @@ -127,10 +127,10 @@ static inline struct dccp_tx_hist_entry *
}

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)
dccp_rx_hist_entry_new(struct dccp_rx_hist *hist,
const u32 ndp,
const struct sk_buff *skb,
const unsigned int __nocast prio)
{
struct dccp_rx_hist_entry *entry = kmem_cache_alloc(hist->dccprxh_slab,
prio);
Expand Down
8 changes: 5 additions & 3 deletions net/dccp/proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ int dccp_ioctl(struct sock *sk, int cmd, unsigned long arg)
}

int dccp_setsockopt(struct sock *sk, int level, int optname,
char *optval, int optlen)
char __user *optval, int optlen)
{
dccp_pr_debug("entry\n");

Expand All @@ -158,7 +158,7 @@ int dccp_setsockopt(struct sock *sk, int level, int optname,
}

int dccp_getsockopt(struct sock *sk, int level, int optname,
char *optval, int *optlen)
char __user *optval, int __user *optlen)
{
dccp_pr_debug("entry\n");

Expand Down Expand Up @@ -439,7 +439,7 @@ void dccp_shutdown(struct sock *sk, int how)
dccp_pr_debug("entry\n");
}

struct proto_ops inet_dccp_ops = {
static struct proto_ops inet_dccp_ops = {
.family = PF_INET,
.owner = THIS_MODULE,
.release = inet_release,
Expand Down Expand Up @@ -539,9 +539,11 @@ static int thash_entries;
module_param(thash_entries, int, 0444);
MODULE_PARM_DESC(thash_entries, "Number of ehash buckets");

#ifdef CONFIG_IP_DCCP_DEBUG
int dccp_debug;
module_param(dccp_debug, int, 0444);
MODULE_PARM_DESC(dccp_debug, "Enable debug messages");
#endif

static int __init dccp_init(void)
{
Expand Down

0 comments on commit a1d3a35

Please sign in to comment.