diff options
Diffstat (limited to 'drivers/net/sipc')
-rw-r--r-- | drivers/net/sipc/miscdev.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/net/sipc/miscdev.c b/drivers/net/sipc/miscdev.c index daee12e9d9ef..0add04117686 100644 --- a/drivers/net/sipc/miscdev.c +++ b/drivers/net/sipc/miscdev.c @@ -1,10 +1,9 @@ // SPDX-License-Identifier: GPL-2.0+ -// -// Samsung IPC v4.x misc device userspace -// interface. -// -// Copyright (C) 2018 Simon Shields <simon@lineageos.org> -// +/* Samsung IPC v4.x misc device userspace + * interface. + * + * Copyright (C) 2018 Simon Shields <simon@lineageos.org> + */ #include <dt-bindings/net/samsung_ipc.h> #include <linux/fs.h> #include <linux/miscdevice.h> @@ -78,7 +77,7 @@ static unsigned int sipc_misc_poll(struct file *filp, struct poll_table_struct * } static ssize_t sipc_misc_write(struct file *filp, const char __user *buf, - size_t count, loff_t *ppos) + size_t count, loff_t *ppos) { struct sipc_io_channel *chan = misc_to_chan(filp->private_data); struct sk_buff *skb; @@ -91,10 +90,8 @@ static ssize_t sipc_misc_write(struct file *filp, const char __user *buf, + count + sizeof(HDLC_END); skb = alloc_skb(frame_len, GFP_KERNEL); - if (!skb) { - dev_err(chan->sipc->dev, "Failed to allocate skb\n"); + if (!skb) return -ENOMEM; - } if (chan->format != SAMSUNG_IPC_FORMAT_RAMDUMP) { data = skb_put(skb, sizeof(HDLC_START)); @@ -137,7 +134,7 @@ static ssize_t sipc_misc_write(struct file *filp, const char __user *buf, } static ssize_t sipc_misc_read(struct file *filp, char *buf, size_t count, - loff_t *f_pos) + loff_t *f_pos) { struct sipc_io_channel *chan = misc_to_chan(filp->private_data); struct sk_buff *skb; @@ -150,7 +147,9 @@ static ssize_t sipc_misc_read(struct file *filp, char *buf, size_t count, } if (skb->len > count) { - dev_err(chan->sipc->dev, "Read buffer not big enough for whole packet (%d)\n", skb->len); + dev_err(chan->sipc->dev, + "Read buffer not big enough for whole packet (%d)\n", + skb->len); dev_kfree_skb_any(skb); return -EFAULT; } |