linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Staging: gdm724x: LTE: Fix trailing open parenthesis code style issue.
@ 2018-02-16 21:40 Quytelda Kahja
  2018-02-19  9:15 ` Dan Carpenter
  2018-02-19 17:05 ` [PATCH] Staging: gdm724x: LTE: Fix trailing open parenthesis code style issue Greg KH
  0 siblings, 2 replies; 16+ messages in thread
From: Quytelda Kahja @ 2018-02-16 21:40 UTC (permalink / raw)
  To: gregkh, tulup, stephen; +Cc: devel, linux-kernel, Quytelda Kahja

Fix a coding style problem causing warnings from checkpatch.pl.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/gdm724x/gdm_lte.c | 50 ++++++++++++++++++++++-----------------
 1 file changed, 28 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/gdm724x/gdm_lte.c b/drivers/staging/gdm724x/gdm_lte.c
index 0527b0d1c1d0..ff3fed9c4a81 100644
--- a/drivers/staging/gdm724x/gdm_lte.c
+++ b/drivers/staging/gdm724x/gdm_lte.c
@@ -204,9 +204,12 @@ static __sum16 icmp6_checksum(struct ipv6hdr *ipv6, u16 *ptr, int len)
 	pseudo_header.ph.ph_nxt = ipv6->nexthdr;
 
 	w = (u16 *)&pseudo_header;
-	for (i = 0; i < ARRAY_SIZE(pseudo_header.pa); i++)
-		sum = csum_add(sum, csum_unfold(
-					(__force __sum16)pseudo_header.pa[i]));
+	for (i = 0; i < ARRAY_SIZE(pseudo_header.pa); i++) {
+		__wsum tmp_sum;
+
+		tmp_sum = csum_unfold((__force __sum16)pseudo_header.pa[i]);
+		sum = csum_add(sum, tmp_sum);
+	}
 
 	w = ptr;
 	while (len > 1) {
@@ -510,18 +513,18 @@ static int gdm_lte_event_send(struct net_device *dev, char *buf, int len)
 {
 	struct nic *nic = netdev_priv(dev);
 	struct hci_packet *hci = (struct hci_packet *)buf;
+	struct gdm_endian *phy_endian;
 	int idx;
+	u16 cpu;
 	int ret;
 
 	ret = sscanf(dev->name, "lte%d", &idx);
 	if (ret != 1)
 		return -EINVAL;
 
-	return netlink_send(lte_event.sock, idx, 0, buf,
-			    gdm_dev16_to_cpu(
-				    nic->phy_dev->get_endian(
-					    nic->phy_dev->priv_dev), hci->len)
-			    + HCI_HEADER_SIZE);
+	phy_endian = nic->phy_dev->get_endian(nic->phy_dev->priv_dev);
+	cpu = gdm_dev16_to_cpu(phy_endian, hci->len);
+	return netlink_send(lte_event.sock, idx, 0, buf, cpu + HCI_HEADER_SIZE);
 }
 
 static void gdm_lte_event_rcv(struct net_device *dev, u16 type,
@@ -728,17 +731,21 @@ static void gdm_lte_pdn_table(struct net_device *dev, char *buf, int len)
 {
 	struct nic *nic = netdev_priv(dev);
 	struct hci_pdn_table_ind *pdn_table = (struct hci_pdn_table_ind *)buf;
+	struct gdm_endian *dft_endian;
+	struct gdm_endian *nic_endian;
 
 	if (pdn_table->activate) {
 		nic->pdn_table.activate = pdn_table->activate;
-		nic->pdn_table.dft_eps_id = gdm_dev32_to_cpu(
-						nic->phy_dev->get_endian(
-							nic->phy_dev->priv_dev),
-						pdn_table->dft_eps_id);
-		nic->pdn_table.nic_type = gdm_dev32_to_cpu(
-						nic->phy_dev->get_endian(
-							nic->phy_dev->priv_dev),
-						pdn_table->nic_type);
+
+		dft_endian = nic->phy_dev->get_endian(nic->phy_dev->priv_dev);
+		nic_endian = nic->phy_dev->get_endian(nic->phy_dev->priv_dev);
+
+		nic->pdn_table.dft_eps_id =
+			gdm_dev32_to_cpu(dft_endian,
+					 pdn_table->dft_eps_id);
+		nic->pdn_table.nic_type =
+			gdm_dev32_to_cpu(nic_endian,
+					 pdn_table->nic_type);
 
 		netdev_info(dev, "pdn activated, nic_type=0x%x\n",
 			    nic->pdn_table.nic_type);
@@ -896,12 +903,11 @@ int register_lte_device(struct phy_dev *phy_dev,
 		nic->phy_dev = phy_dev;
 		nic->nic_id = index;
 
-		form_mac_address(
-				net->dev_addr,
-				nic->src_mac_addr,
-				nic->dest_mac_addr,
-				mac_address,
-				index);
+		form_mac_address(net->dev_addr,
+				 nic->src_mac_addr,
+				 nic->dest_mac_addr,
+				 mac_address,
+				 index);
 
 		SET_NETDEV_DEV(net, dev);
 		SET_NETDEV_DEVTYPE(net, &wwan_type);
-- 
2.16.1

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-02-23 23:46 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-16 21:40 [PATCH] Staging: gdm724x: LTE: Fix trailing open parenthesis code style issue Quytelda Kahja
2018-02-19  9:15 ` Dan Carpenter
2018-02-21 10:20   ` [PATCH] Staging: gdm724x: LTE: Fix trailing open parentheses Quytelda Kahja
2018-02-21 10:43     ` Dan Carpenter
2018-02-21 13:12       ` [PATCH 1/2] Staging: gdm724x: Simplify the struct gdm_endian to a variable Quytelda Kahja
2018-02-21 13:12         ` [PATCH 2/2] Staging: gdm724x: LTE: Refactor gdm_lte_pdn_table() Quytelda Kahja
2018-02-21 13:21         ` [PATCH 1/2] Staging: gdm724x: Simplify the struct gdm_endian to a variable Dan Carpenter
2018-02-22 14:02         ` Greg KH
2018-02-23  1:16           ` Quytelda Kahja
2018-02-23  1:30             ` [PATCH 1/4] Staging: gdm724x: LTE: Fix trailing open parentheses Quytelda Kahja
2018-02-23  1:32             ` [PATCH 2/4] Staging: gdm724x: hci: Changed camel-case to snake-case Quytelda Kahja
2018-02-23  1:33               ` [PATCH 3/4] Staging: gdm724x: Simplify the struct gdm_endian to a variable Quytelda Kahja
2018-02-23  1:33               ` [PATCH 4/4] Staging: gdm724x: LTE: Refactor gdm_lte_pdn_table() Quytelda Kahja
2018-02-23  8:15               ` [PATCH 2/4] Staging: gdm724x: hci: Changed camel-case to snake-case Greg KH
2018-02-23 23:46                 ` [PATCH] staging: gdm724x: hci: Remove unused struct sdu_header Quytelda Kahja
2018-02-19 17:05 ` [PATCH] Staging: gdm724x: LTE: Fix trailing open parenthesis code style issue Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).