summaryrefslogtreecommitdiffstats
path: root/drivers/net/caif
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/caif')
-rw-r--r--drivers/net/caif/caif_hsi.c14
-rw-r--r--drivers/net/caif/caif_serial.c4
-rw-r--r--drivers/net/caif/caif_spi.c4
-rw-r--r--drivers/net/caif/caif_virtio.c2
4 files changed, 9 insertions, 15 deletions
diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c
index 71a7c3b44fdd..438966bf51c2 100644
--- a/drivers/net/caif/caif_hsi.c
+++ b/drivers/net/caif/caif_hsi.c
@@ -426,7 +426,6 @@ static int cfhsi_rx_desc(struct cfhsi_desc *desc, struct cfhsi *cfhsi)
/* Check for embedded CAIF frame. */
if (desc->offset) {
struct sk_buff *skb;
- u8 *dst = NULL;
int len = 0;
pfrm = ((u8 *)desc) + desc->offset;
@@ -454,8 +453,7 @@ static int cfhsi_rx_desc(struct cfhsi_desc *desc, struct cfhsi *cfhsi)
}
caif_assert(skb != NULL);
- dst = skb_put(skb, len);
- memcpy(dst, pfrm, len);
+ skb_put_data(skb, pfrm, len);
skb->protocol = htons(ETH_P_CAIF);
skb_reset_mac_header(skb);
@@ -556,7 +554,6 @@ static int cfhsi_rx_pld(struct cfhsi_desc *desc, struct cfhsi *cfhsi)
/* Parse payload. */
while (nfrms < CFHSI_MAX_PKTS && *plen) {
struct sk_buff *skb;
- u8 *dst = NULL;
u8 *pcffrm = NULL;
int len;
@@ -585,8 +582,7 @@ static int cfhsi_rx_pld(struct cfhsi_desc *desc, struct cfhsi *cfhsi)
}
caif_assert(skb != NULL);
- dst = skb_put(skb, len);
- memcpy(dst, pcffrm, len);
+ skb_put_data(skb, pcffrm, len);
skb->protocol = htons(ETH_P_CAIF);
skb_reset_mac_header(skb);
@@ -1356,7 +1352,8 @@ static void cfhsi_netlink_parms(struct nlattr *data[], struct cfhsi *cfhsi)
}
static int caif_hsi_changelink(struct net_device *dev, struct nlattr *tb[],
- struct nlattr *data[])
+ struct nlattr *data[],
+ struct netlink_ext_ack *extack)
{
cfhsi_netlink_parms(data, netdev_priv(dev));
netdev_state_change(dev);
@@ -1403,7 +1400,8 @@ static int caif_hsi_fill_info(struct sk_buff *skb, const struct net_device *dev)
}
static int caif_hsi_newlink(struct net *src_net, struct net_device *dev,
- struct nlattr *tb[], struct nlattr *data[])
+ struct nlattr *tb[], struct nlattr *data[],
+ struct netlink_ext_ack *extack)
{
struct cfhsi *cfhsi = NULL;
struct cfhsi_ops *(*get_ops)(void);
diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c
index 76e1d3545105..709838e4c062 100644
--- a/drivers/net/caif/caif_serial.c
+++ b/drivers/net/caif/caif_serial.c
@@ -171,7 +171,6 @@ static void ldisc_receive(struct tty_struct *tty, const u8 *data,
struct sk_buff *skb = NULL;
struct ser_device *ser;
int ret;
- u8 *p;
ser = tty->disc_data;
@@ -198,8 +197,7 @@ static void ldisc_receive(struct tty_struct *tty, const u8 *data,
skb = netdev_alloc_skb(ser->dev, count+1);
if (skb == NULL)
return;
- p = skb_put(skb, count);
- memcpy(p, data, count);
+ skb_put_data(skb, data, count);
skb->protocol = htons(ETH_P_CAIF);
skb_reset_mac_header(skb);
diff --git a/drivers/net/caif/caif_spi.c b/drivers/net/caif/caif_spi.c
index cb0dcc99fb4f..980eace53d44 100644
--- a/drivers/net/caif/caif_spi.c
+++ b/drivers/net/caif/caif_spi.c
@@ -526,7 +526,6 @@ int cfspi_rxfrm(struct cfspi *cfspi, u8 *buf, size_t len)
struct sk_buff *skb = NULL;
int spad = 0;
int epad = 0;
- u8 *dst = NULL;
int pkt_len = 0;
/*
@@ -548,8 +547,7 @@ int cfspi_rxfrm(struct cfspi *cfspi, u8 *buf, size_t len)
skb = netdev_alloc_skb(cfspi->ndev, pkt_len + 1);
caif_assert(skb != NULL);
- dst = skb_put(skb, pkt_len);
- memcpy(dst, src, pkt_len);
+ skb_put_data(skb, src, pkt_len);
src += pkt_len;
skb->protocol = htons(ETH_P_CAIF);
diff --git a/drivers/net/caif/caif_virtio.c b/drivers/net/caif/caif_virtio.c
index 1794ea0420b7..c3d104feee13 100644
--- a/drivers/net/caif/caif_virtio.c
+++ b/drivers/net/caif/caif_virtio.c
@@ -242,7 +242,7 @@ static struct sk_buff *cfv_alloc_and_copy_skb(int *err,
skb_reserve(skb, cfv->rx_hr + pad_len);
- memcpy(skb_put(skb, cfpkt_len), frm + cfv->rx_hr, cfpkt_len);
+ skb_put_data(skb, frm + cfv->rx_hr, cfpkt_len);
return skb;
}