diff options
Diffstat (limited to 'net/irda')
-rw-r--r-- | net/irda/af_irda.c | 24 | ||||
-rw-r--r-- | net/irda/irda_device.c | 1 | ||||
-rw-r--r-- | net/irda/iriap.c | 2 | ||||
-rw-r--r-- | net/irda/irias_object.c | 12 | ||||
-rw-r--r-- | net/irda/irnet/irnet.h | 1 |
5 files changed, 20 insertions, 20 deletions
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 6f92f9c6299..75944564866 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c @@ -43,6 +43,7 @@ ********************************************************************/ #include <linux/config.h> +#include <linux/capability.h> #include <linux/module.h> #include <linux/types.h> #include <linux/socket.h> @@ -62,12 +63,12 @@ static int irda_create(struct socket *sock, int protocol); -static struct proto_ops irda_stream_ops; -static struct proto_ops irda_seqpacket_ops; -static struct proto_ops irda_dgram_ops; +static const struct proto_ops irda_stream_ops; +static const struct proto_ops irda_seqpacket_ops; +static const struct proto_ops irda_dgram_ops; #ifdef CONFIG_IRDA_ULTRA -static struct proto_ops irda_ultra_ops; +static const struct proto_ops irda_ultra_ops; #define ULTRA_MAX_DATA 382 #endif /* CONFIG_IRDA_ULTRA */ @@ -1438,8 +1439,9 @@ static int irda_recvmsg_stream(struct kiocb *iocb, struct socket *sock, /* * POSIX 1003.1g mandates this order. */ - if (sk->sk_err) - ret = sock_error(sk); + ret = sock_error(sk); + if (ret) + break; else if (sk->sk_shutdown & RCV_SHUTDOWN) ; else if (noblock) @@ -1821,7 +1823,7 @@ static int irda_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) return -EINVAL; default: IRDA_DEBUG(1, "%s(), doing device ioctl!\n", __FUNCTION__); - return dev_ioctl(cmd, (void __user *) arg); + return -ENOIOCTLCMD; } /*NOTREACHED*/ @@ -2463,7 +2465,7 @@ static struct net_proto_family irda_family_ops = { .owner = THIS_MODULE, }; -static struct proto_ops SOCKOPS_WRAPPED(irda_stream_ops) = { +static const struct proto_ops SOCKOPS_WRAPPED(irda_stream_ops) = { .family = PF_IRDA, .owner = THIS_MODULE, .release = irda_release, @@ -2484,7 +2486,7 @@ static struct proto_ops SOCKOPS_WRAPPED(irda_stream_ops) = { .sendpage = sock_no_sendpage, }; -static struct proto_ops SOCKOPS_WRAPPED(irda_seqpacket_ops) = { +static const struct proto_ops SOCKOPS_WRAPPED(irda_seqpacket_ops) = { .family = PF_IRDA, .owner = THIS_MODULE, .release = irda_release, @@ -2505,7 +2507,7 @@ static struct proto_ops SOCKOPS_WRAPPED(irda_seqpacket_ops) = { .sendpage = sock_no_sendpage, }; -static struct proto_ops SOCKOPS_WRAPPED(irda_dgram_ops) = { +static const struct proto_ops SOCKOPS_WRAPPED(irda_dgram_ops) = { .family = PF_IRDA, .owner = THIS_MODULE, .release = irda_release, @@ -2527,7 +2529,7 @@ static struct proto_ops SOCKOPS_WRAPPED(irda_dgram_ops) = { }; #ifdef CONFIG_IRDA_ULTRA -static struct proto_ops SOCKOPS_WRAPPED(irda_ultra_ops) = { +static const struct proto_ops SOCKOPS_WRAPPED(irda_ultra_ops) = { .family = PF_IRDA, .owner = THIS_MODULE, .release = irda_release, diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c index 70543d89438..890bac0d4a5 100644 --- a/net/irda/irda_device.c +++ b/net/irda/irda_device.c @@ -33,6 +33,7 @@ #include <linux/string.h> #include <linux/proc_fs.h> #include <linux/skbuff.h> +#include <linux/capability.h> #include <linux/if.h> #include <linux/if_ether.h> #include <linux/if_arp.h> diff --git a/net/irda/iriap.c b/net/irda/iriap.c index b8bb78af8b8..254f9074690 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c @@ -364,7 +364,7 @@ static void iriap_disconnect_request(struct iriap_cb *self) /* * Function iriap_getvaluebyclass (addr, name, attr) * - * Retreive all values from attribute in all objects with given class + * Retrieve all values from attribute in all objects with given class * name */ int iriap_getvaluebyclass_request(struct iriap_cb *self, diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c index 75f2666e863..c6d169fbdce 100644 --- a/net/irda/irias_object.c +++ b/net/irda/irias_object.c @@ -82,8 +82,7 @@ struct ias_object *irias_new_object( char *name, int id) IRDA_DEBUG( 4, "%s()\n", __FUNCTION__); - obj = (struct ias_object *) kmalloc(sizeof(struct ias_object), - GFP_ATOMIC); + obj = kmalloc(sizeof(struct ias_object), GFP_ATOMIC); if (obj == NULL) { IRDA_WARNING("%s(), Unable to allocate object!\n", __FUNCTION__); @@ -348,8 +347,7 @@ void irias_add_integer_attrib(struct ias_object *obj, char *name, int value, IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;); IRDA_ASSERT(name != NULL, return;); - attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib), - GFP_ATOMIC); + attrib = kmalloc(sizeof(struct ias_attrib), GFP_ATOMIC); if (attrib == NULL) { IRDA_WARNING("%s: Unable to allocate attribute!\n", __FUNCTION__); @@ -385,8 +383,7 @@ void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets, IRDA_ASSERT(name != NULL, return;); IRDA_ASSERT(octets != NULL, return;); - attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib), - GFP_ATOMIC); + attrib = kmalloc(sizeof(struct ias_attrib), GFP_ATOMIC); if (attrib == NULL) { IRDA_WARNING("%s: Unable to allocate attribute!\n", __FUNCTION__); @@ -420,8 +417,7 @@ void irias_add_string_attrib(struct ias_object *obj, char *name, char *value, IRDA_ASSERT(name != NULL, return;); IRDA_ASSERT(value != NULL, return;); - attrib = (struct ias_attrib *) kmalloc(sizeof( struct ias_attrib), - GFP_ATOMIC); + attrib = kmalloc(sizeof( struct ias_attrib), GFP_ATOMIC); if (attrib == NULL) { IRDA_WARNING("%s: Unable to allocate attribute!\n", __FUNCTION__); diff --git a/net/irda/irnet/irnet.h b/net/irda/irnet/irnet.h index b391cb3893d..e4fe1e80029 100644 --- a/net/irda/irnet/irnet.h +++ b/net/irda/irnet/irnet.h @@ -248,6 +248,7 @@ #include <linux/netdevice.h> #include <linux/miscdevice.h> #include <linux/poll.h> +#include <linux/capability.h> #include <linux/config.h> #include <linux/ctype.h> /* isspace() */ #include <asm/uaccess.h> |