Skip to content

Commit

Permalink
net: annotate ->poll() instances
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Nov 27, 2017
1 parent e6c5a7d commit ade994f
Show file tree
Hide file tree
Showing 40 changed files with 77 additions and 76 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/irda/net/af_irda.c
Original file line number Diff line number Diff line change
Expand Up @@ -1737,12 +1737,12 @@ static int irda_shutdown(struct socket *sock, int how)
/*
* Function irda_poll (file, sock, wait)
*/
static unsigned int irda_poll(struct file * file, struct socket *sock,
static __poll_t irda_poll(struct file * file, struct socket *sock,
poll_table *wait)
{
struct sock *sk = sock->sk;
struct irda_sock *self = irda_sk(sk);
unsigned int mask;
__poll_t mask;

poll_wait(file, sk_sleep(sk), wait);
mask = 0;
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/irda/net/irnet/irnet_ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,12 @@ irnet_ctrl_read(irnet_socket * ap,
* Poll : called when someone do a select on /dev/irnet.
* Just check if there are new events...
*/
static inline unsigned int
static inline __poll_t
irnet_ctrl_poll(irnet_socket * ap,
struct file * file,
poll_table * wait)
{
unsigned int mask;
__poll_t mask;

DENTER(CTRL_TRACE, "(ap=0x%p)\n", ap);

Expand Down Expand Up @@ -608,12 +608,12 @@ dev_irnet_read(struct file * file,
/*
* Poll : called when someone do a select on /dev/irnet
*/
static unsigned int
static __poll_t
dev_irnet_poll(struct file * file,
poll_table * wait)
{
irnet_socket * ap = file->private_data;
unsigned int mask;
__poll_t mask;

DENTER(FS_TRACE, "(file=0x%p, ap=0x%p)\n",
file, ap);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/irda/net/irnet/irnet_ppp.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static ssize_t
char __user *,
size_t,
loff_t *);
static unsigned int
static __poll_t
dev_irnet_poll(struct file *,
poll_table *);
static long
Expand Down
2 changes: 1 addition & 1 deletion include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -3242,7 +3242,7 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags,
int *peeked, int *off, int *err);
struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock,
int *err);
unsigned int datagram_poll(struct file *file, struct socket *sock,
__poll_t datagram_poll(struct file *file, struct socket *sock,
struct poll_table_struct *wait);
int skb_copy_datagram_iter(const struct sk_buff *from, int offset,
struct iov_iter *to, int size);
Expand Down
2 changes: 1 addition & 1 deletion include/net/bluetooth/bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ int bt_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
int flags);
int bt_sock_stream_recvmsg(struct socket *sock, struct msghdr *msg,
size_t len, int flags);
uint bt_sock_poll(struct file *file, struct socket *sock, poll_table *wait);
__poll_t bt_sock_poll(struct file *file, struct socket *sock, poll_table *wait);
int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo);
int bt_sock_wait_ready(struct sock *sk, unsigned long flags);
Expand Down
2 changes: 1 addition & 1 deletion include/net/inet_connection_sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ void inet_csk_prepare_forced_close(struct sock *sk);
/*
* LISTEN is a special case for poll..
*/
static inline unsigned int inet_csk_listen_poll(const struct sock *sk)
static inline __poll_t inet_csk_listen_poll(const struct sock *sk)
{
return !reqsk_queue_empty(&inet_csk(sk)->icsk_accept_queue) ?
(POLLIN | POLLRDNORM) : 0;
Expand Down
2 changes: 1 addition & 1 deletion include/net/iucv/af_iucv.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ struct iucv_sock_list {
atomic_t autobind_name;
};

unsigned int iucv_sock_poll(struct file *file, struct socket *sock,
__poll_t iucv_sock_poll(struct file *file, struct socket *sock,
poll_table *wait);
void iucv_sock_link(struct iucv_sock_list *l, struct sock *s);
void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s);
Expand Down
2 changes: 1 addition & 1 deletion include/net/sctp/sctp.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb);
int sctp_inet_listen(struct socket *sock, int backlog);
void sctp_write_space(struct sock *sk);
void sctp_data_ready(struct sock *sk);
unsigned int sctp_poll(struct file *file, struct socket *sock,
__poll_t sctp_poll(struct file *file, struct socket *sock,
poll_table *wait);
void sctp_sock_rfree(struct sk_buff *skb);
void sctp_copy_sock(struct sock *newsk, struct sock *sk,
Expand Down
2 changes: 1 addition & 1 deletion include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,7 @@ int sock_no_connect(struct socket *, struct sockaddr *, int, int);
int sock_no_socketpair(struct socket *, struct socket *);
int sock_no_accept(struct socket *, struct socket *, int, bool);
int sock_no_getname(struct socket *, struct sockaddr *, int *, int);
unsigned int sock_no_poll(struct file *, struct socket *,
__poll_t sock_no_poll(struct file *, struct socket *,
struct poll_table_struct *);
int sock_no_ioctl(struct socket *, unsigned int, unsigned long);
int sock_no_listen(struct socket *, int);
Expand Down
2 changes: 1 addition & 1 deletion include/net/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst);
void tcp_close(struct sock *sk, long timeout);
void tcp_init_sock(struct sock *sk);
void tcp_init_transfer(struct sock *sk, int bpf_op);
unsigned int tcp_poll(struct file *file, struct socket *sock,
__poll_t tcp_poll(struct file *file, struct socket *sock,
struct poll_table_struct *wait);
int tcp_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen);
Expand Down
2 changes: 1 addition & 1 deletion include/net/udp.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ int udp_ioctl(struct sock *sk, int cmd, unsigned long arg);
int udp_init_sock(struct sock *sk);
int __udp_disconnect(struct sock *sk, int flags);
int udp_disconnect(struct sock *sk, int flags);
unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait);
__poll_t udp_poll(struct file *file, struct socket *sock, poll_table *wait);
struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb,
netdev_features_t features,
bool is_ipv6);
Expand Down
4 changes: 2 additions & 2 deletions net/atm/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,11 +648,11 @@ int vcc_sendmsg(struct socket *sock, struct msghdr *m, size_t size)
return error;
}

unsigned int vcc_poll(struct file *file, struct socket *sock, poll_table *wait)
__poll_t vcc_poll(struct file *file, struct socket *sock, poll_table *wait)
{
struct sock *sk = sock->sk;
struct atm_vcc *vcc;
unsigned int mask;
__poll_t mask;

sock_poll_wait(file, sk_sleep(sk), wait);
mask = 0;
Expand Down
2 changes: 1 addition & 1 deletion net/atm/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int vcc_connect(struct socket *sock, int itf, short vpi, int vci);
int vcc_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
int flags);
int vcc_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len);
unsigned int vcc_poll(struct file *file, struct socket *sock, poll_table *wait);
__poll_t vcc_poll(struct file *file, struct socket *sock, poll_table *wait);
int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
int vcc_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
int vcc_setsockopt(struct socket *sock, int level, int optname,
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/icmp_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ static ssize_t batadv_socket_write(struct file *file, const char __user *buff,
return len;
}

static unsigned int batadv_socket_poll(struct file *file, poll_table *wait)
static __poll_t batadv_socket_poll(struct file *file, poll_table *wait)
{
struct batadv_socket_client *socket_client = file->private_data;

Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ static ssize_t batadv_log_read(struct file *file, char __user *buf,
return error;
}

static unsigned int batadv_log_poll(struct file *file, poll_table *wait)
static __poll_t batadv_log_poll(struct file *file, poll_table *wait)
{
struct batadv_priv *bat_priv = file->private_data;
struct batadv_priv_debug_log *debug_log = bat_priv->debug_log;
Expand Down
6 changes: 3 additions & 3 deletions net/bluetooth/af_bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ int bt_sock_stream_recvmsg(struct socket *sock, struct msghdr *msg,
}
EXPORT_SYMBOL(bt_sock_stream_recvmsg);

static inline unsigned int bt_accept_poll(struct sock *parent)
static inline __poll_t bt_accept_poll(struct sock *parent)
{
struct bt_sock *s, *n;
struct sock *sk;
Expand All @@ -437,11 +437,11 @@ static inline unsigned int bt_accept_poll(struct sock *parent)
return 0;
}

unsigned int bt_sock_poll(struct file *file, struct socket *sock,
__poll_t bt_sock_poll(struct file *file, struct socket *sock,
poll_table *wait)
{
struct sock *sk = sock->sk;
unsigned int mask = 0;
__poll_t mask = 0;

BT_DBG("sock %p, sk %p", sock, sk);

Expand Down
4 changes: 2 additions & 2 deletions net/caif/caif_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,11 +934,11 @@ static int caif_release(struct socket *sock)
}

/* Copied from af_unix.c:unix_poll(), added CAIF tx_flow handling */
static unsigned int caif_poll(struct file *file,
static __poll_t caif_poll(struct file *file,
struct socket *sock, poll_table *wait)
{
struct sock *sk = sock->sk;
unsigned int mask;
__poll_t mask;
struct caifsock *cf_sk = container_of(sk, struct caifsock, sk);

sock_poll_wait(file, sk_sleep(sk), wait);
Expand Down
4 changes: 2 additions & 2 deletions net/core/datagram.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,11 +831,11 @@ EXPORT_SYMBOL(skb_copy_and_csum_datagram_msg);
* and you use a different write policy from sock_writeable()
* then please supply your own write_space callback.
*/
unsigned int datagram_poll(struct file *file, struct socket *sock,
__poll_t datagram_poll(struct file *file, struct socket *sock,
poll_table *wait)
{
struct sock *sk = sock->sk;
unsigned int mask;
__poll_t mask;

sock_poll_wait(file, sk_sleep(sk), wait);
mask = 0;
Expand Down
2 changes: 1 addition & 1 deletion net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -2496,7 +2496,7 @@ int sock_no_getname(struct socket *sock, struct sockaddr *saddr,
}
EXPORT_SYMBOL(sock_no_getname);

unsigned int sock_no_poll(struct file *file, struct socket *sock, poll_table *pt)
__poll_t sock_no_poll(struct file *file, struct socket *sock, poll_table *pt)
{
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion net/dccp/dccp.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ int dccp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock,
int flags, int *addr_len);
void dccp_shutdown(struct sock *sk, int how);
int inet_dccp_listen(struct socket *sock, int backlog);
unsigned int dccp_poll(struct file *file, struct socket *sock,
__poll_t dccp_poll(struct file *file, struct socket *sock,
poll_table *wait);
int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
void dccp_req_err(struct sock *sk, u64 seq);
Expand Down
4 changes: 2 additions & 2 deletions net/dccp/proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,10 @@ EXPORT_SYMBOL_GPL(dccp_disconnect);
* take care of normal races (between the test and the event) and we don't
* go look at any of the socket buffers directly.
*/
unsigned int dccp_poll(struct file *file, struct socket *sock,
__poll_t dccp_poll(struct file *file, struct socket *sock,
poll_table *wait)
{
unsigned int mask;
__poll_t mask;
struct sock *sk = sock->sk;

sock_poll_wait(file, sk_sleep(sk), wait);
Expand Down
4 changes: 2 additions & 2 deletions net/decnet/af_decnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1209,11 +1209,11 @@ static int dn_getname(struct socket *sock, struct sockaddr *uaddr,int *uaddr_len
}


static unsigned int dn_poll(struct file *file, struct socket *sock, poll_table *wait)
static __poll_t dn_poll(struct file *file, struct socket *sock, poll_table *wait)
{
struct sock *sk = sock->sk;
struct dn_scp *scp = DN_SK(sk);
int mask = datagram_poll(file, sock, wait);
__poll_t mask = datagram_poll(file, sock, wait);

if (!skb_queue_empty(&scp->other_receive_queue))
mask |= POLLRDBAND;
Expand Down
4 changes: 2 additions & 2 deletions net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,9 @@ static void tcp_tx_timestamp(struct sock *sk, u16 tsflags)
* take care of normal races (between the test and the event) and we don't
* go look at any of the socket buffers directly.
*/
unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
__poll_t tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
{
unsigned int mask;
__poll_t mask;
struct sock *sk = sock->sk;
const struct tcp_sock *tp = tcp_sk(sk);
int state;
Expand Down
4 changes: 2 additions & 2 deletions net/ipv4/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2502,9 +2502,9 @@ int compat_udp_getsockopt(struct sock *sk, int level, int optname,
* but then block when reading it. Add special case code
* to work around these arguably broken applications.
*/
unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait)
__poll_t udp_poll(struct file *file, struct socket *sock, poll_table *wait)
{
unsigned int mask = datagram_poll(file, sock, wait);
__poll_t mask = datagram_poll(file, sock, wait);
struct sock *sk = sock->sk;

if (!skb_queue_empty(&udp_sk(sk)->reader_queue))
Expand Down
6 changes: 3 additions & 3 deletions net/iucv/af_iucv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,7 @@ static int iucv_sock_recvmsg(struct socket *sock, struct msghdr *msg,
return copied;
}

static inline unsigned int iucv_accept_poll(struct sock *parent)
static inline __poll_t iucv_accept_poll(struct sock *parent)
{
struct iucv_sock *isk, *n;
struct sock *sk;
Expand All @@ -1489,11 +1489,11 @@ static inline unsigned int iucv_accept_poll(struct sock *parent)
return 0;
}

unsigned int iucv_sock_poll(struct file *file, struct socket *sock,
__poll_t iucv_sock_poll(struct file *file, struct socket *sock,
poll_table *wait)
{
struct sock *sk = sock->sk;
unsigned int mask = 0;
__poll_t mask = 0;

sock_poll_wait(file, sk_sleep(sk), wait);

Expand Down
6 changes: 3 additions & 3 deletions net/nfc/llcp_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ static int llcp_sock_getname(struct socket *sock, struct sockaddr *uaddr,
return 0;
}

static inline unsigned int llcp_accept_poll(struct sock *parent)
static inline __poll_t llcp_accept_poll(struct sock *parent)
{
struct nfc_llcp_sock *llcp_sock, *parent_sock;
struct sock *sk;
Expand All @@ -549,11 +549,11 @@ static inline unsigned int llcp_accept_poll(struct sock *parent)
return 0;
}

static unsigned int llcp_sock_poll(struct file *file, struct socket *sock,
static __poll_t llcp_sock_poll(struct file *file, struct socket *sock,
poll_table *wait)
{
struct sock *sk = sock->sk;
unsigned int mask = 0;
__poll_t mask = 0;

pr_debug("%p\n", sk);

Expand Down
2 changes: 1 addition & 1 deletion net/nfc/nci/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ static ssize_t nci_uart_tty_write(struct tty_struct *tty, struct file *file,
return 0;
}

static unsigned int nci_uart_tty_poll(struct tty_struct *tty,
static __poll_t nci_uart_tty_poll(struct tty_struct *tty,
struct file *filp, poll_table *wait)
{
return 0;
Expand Down
4 changes: 2 additions & 2 deletions net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -4080,12 +4080,12 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd,
return 0;
}

static unsigned int packet_poll(struct file *file, struct socket *sock,
static __poll_t packet_poll(struct file *file, struct socket *sock,
poll_table *wait)
{
struct sock *sk = sock->sk;
struct packet_sock *po = pkt_sk(sk);
unsigned int mask = datagram_poll(file, sock, wait);
__poll_t mask = datagram_poll(file, sock, wait);

spin_lock_bh(&sk->sk_receive_queue.lock);
if (po->rx_ring.pg_vec) {
Expand Down
4 changes: 2 additions & 2 deletions net/phonet/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,12 @@ static int pn_socket_getname(struct socket *sock, struct sockaddr *addr,
return 0;
}

static unsigned int pn_socket_poll(struct file *file, struct socket *sock,
static __poll_t pn_socket_poll(struct file *file, struct socket *sock,
poll_table *wait)
{
struct sock *sk = sock->sk;
struct pep_sock *pn = pep_sk(sk);
unsigned int mask = 0;
__poll_t mask = 0;

poll_wait(file, sk_sleep(sk), wait);

Expand Down
4 changes: 2 additions & 2 deletions net/rds/af_rds.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ static int rds_getname(struct socket *sock, struct sockaddr *uaddr,
* to send to a congested destination, the system call may still fail (and
* return ENOBUFS).
*/
static unsigned int rds_poll(struct file *file, struct socket *sock,
static __poll_t rds_poll(struct file *file, struct socket *sock,
poll_table *wait)
{
struct sock *sk = sock->sk;
struct rds_sock *rs = rds_sk_to_rs(sk);
unsigned int mask = 0;
__poll_t mask = 0;
unsigned long flags;

poll_wait(file, sk_sleep(sk), wait);
Expand Down
4 changes: 2 additions & 2 deletions net/rfkill/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1139,10 +1139,10 @@ static int rfkill_fop_open(struct inode *inode, struct file *file)
return -ENOMEM;
}

static unsigned int rfkill_fop_poll(struct file *file, poll_table *wait)
static __poll_t rfkill_fop_poll(struct file *file, poll_table *wait)
{
struct rfkill_data *data = file->private_data;
unsigned int res = POLLOUT | POLLWRNORM;
__poll_t res = POLLOUT | POLLWRNORM;

poll_wait(file, &data->read_wait, wait);

Expand Down
Loading

0 comments on commit ade994f

Please sign in to comment.