Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b952f4df authored by yuan linyu's avatar yuan linyu Committed by David S. Miller
Browse files

net: manual clean code which call skb_put_[data:zero]

parent ad941e69
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -173,8 +173,8 @@ hycapi_register_internal(struct capi_ctr *ctrl, __u16 appl,
	}
	skb_put_data(skb, &len, sizeof(__u16));
	skb_put_data(skb, &appl, sizeof(__u16));
	memcpy(skb_put(skb, sizeof(__u8)), &_command, sizeof(_command));
	memcpy(skb_put(skb, sizeof(__u8)), &_subcommand, sizeof(_subcommand));
	skb_put_data(skb, &_command, sizeof(__u8));
	skb_put_data(skb, &_subcommand, sizeof(__u8));
	skb_put_data(skb, &MessageNumber, sizeof(__u16));
	skb_put_data(skb, &MessageBufferSize, sizeof(__u16));
	skb_put_data(skb, &(rp->level3cnt), sizeof(__u16));
@@ -281,8 +281,8 @@ static void hycapi_release_internal(struct capi_ctr *ctrl, __u16 appl)
	}
	skb_put_data(skb, &len, sizeof(__u16));
	skb_put_data(skb, &appl, sizeof(__u16));
	memcpy(skb_put(skb, sizeof(__u8)), &_command, sizeof(_command));
	memcpy(skb_put(skb, sizeof(__u8)), &_subcommand, sizeof(_subcommand));
	skb_put_data(skb, &_command, sizeof(__u8));
	skb_put_data(skb, &_subcommand, sizeof(__u8));
	skb_put_data(skb, &MessageNumber, sizeof(__u16));
	hycapi_send_message(ctrl, skb);
	hycapi_applications[appl - 1].ctrl_mask &= ~(1 << (ctrl->cnr - 1));
+1 −1
Original line number Diff line number Diff line
@@ -472,7 +472,7 @@ static int bsd_compress(void *state, struct sk_buff *skb_in, struct sk_buff *skb
		accm |= ((ent) << bitno);				\
		do	{						\
			if (skb_out && skb_tailroom(skb_out) > 0)	\
				*(u8 *)skb_put(skb_out, 1) = (u8)(accm >> 24); \
				skb_put(skb_out, (u8)(accm >> 24));	\
			accm <<= 8;					\
			bitno += 8;					\
		} while (bitno <= 24);					\
+1 −1
Original line number Diff line number Diff line
@@ -2258,7 +2258,7 @@ static void isdn_ppp_ccp_xmit_reset(struct ippp_struct *is, int proto,

	/* Now stuff remaining bytes */
	if (len) {
		p = skb_put_data(skb, data, len);
		skb_put_data(skb, data, len);
	}

	/* skb is now ready for xmit */
+1 −2
Original line number Diff line number Diff line
@@ -925,7 +925,6 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
	struct learning_pkt pkt;
	struct sk_buff *skb;
	int size = sizeof(struct learning_pkt);
	char *data;

	memset(&pkt, 0, size);
	ether_addr_copy(pkt.mac_dst, mac_addr);
@@ -936,7 +935,7 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
	if (!skb)
		return;

	data = skb_put_data(skb, &pkt, size);
	skb_put_data(skb, &pkt, size);

	skb_reset_mac_header(skb);
	skb->network_header = skb->mac_header + ETH_HLEN;
+2 −4
Original line number Diff line number Diff line
@@ -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,7 +453,7 @@ static int cfhsi_rx_desc(struct cfhsi_desc *desc, struct cfhsi *cfhsi)
		}
		caif_assert(skb != NULL);

		dst = skb_put_data(skb, pfrm, len);
		skb_put_data(skb, pfrm, len);

		skb->protocol = htons(ETH_P_CAIF);
		skb_reset_mac_header(skb);
@@ -555,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;

@@ -584,7 +582,7 @@ static int cfhsi_rx_pld(struct cfhsi_desc *desc, struct cfhsi *cfhsi)
		}
		caif_assert(skb != NULL);

		dst = skb_put_data(skb, pcffrm, len);
		skb_put_data(skb, pcffrm, len);

		skb->protocol = htons(ETH_P_CAIF);
		skb_reset_mac_header(skb);
Loading