All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Remove double semicolons
@ 2009-12-03  4:14 John Daiker
  2009-12-03  4:56 ` Joe Perches
  0 siblings, 1 reply; 6+ messages in thread
From: John Daiker @ 2009-12-03  4:14 UTC (permalink / raw)
  To: linux-wireless; +Cc: samuel.ortiz, yi.zhu, John Daiker

This patches eliminates a few double semicolons in the IWMC3200 driver.

Signed-off-by: John Daiker <daikerjohn@gmail.com>
---
 drivers/net/wireless/iwmc3200wifi/rx.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/iwmc3200wifi/rx.c b/drivers/net/wireless/iwmc3200wifi/rx.c
index 72c27a3..5e3cf5e 100644
--- a/drivers/net/wireless/iwmc3200wifi/rx.c
+++ b/drivers/net/wireless/iwmc3200wifi/rx.c
@@ -874,28 +874,28 @@ static int iwm_mlme_mgt_frame(struct iwm_priv *iwm, u8 *buf,
 		    le16_to_cpu(mgt_frame->len));
 
 	if (ieee80211_is_assoc_req(mgt->frame_control)) {
-		ie = mgt->u.assoc_req.variable;;
+		ie = mgt->u.assoc_req.variable;
 		iwm->req_ie_len =
 				le16_to_cpu(mgt_frame->len) - (ie - (u8 *)mgt);
 		kfree(iwm->req_ie);
 		iwm->req_ie = kmemdup(mgt->u.assoc_req.variable,
 				      iwm->req_ie_len, GFP_KERNEL);
 	} else if (ieee80211_is_reassoc_req(mgt->frame_control)) {
-		ie = mgt->u.reassoc_req.variable;;
+		ie = mgt->u.reassoc_req.variable;
 		iwm->req_ie_len =
 				le16_to_cpu(mgt_frame->len) - (ie - (u8 *)mgt);
 		kfree(iwm->req_ie);
 		iwm->req_ie = kmemdup(mgt->u.reassoc_req.variable,
 				      iwm->req_ie_len, GFP_KERNEL);
 	} else if (ieee80211_is_assoc_resp(mgt->frame_control)) {
-		ie = mgt->u.assoc_resp.variable;;
+		ie = mgt->u.assoc_resp.variable;
 		iwm->resp_ie_len =
 				le16_to_cpu(mgt_frame->len) - (ie - (u8 *)mgt);
 		kfree(iwm->resp_ie);
 		iwm->resp_ie = kmemdup(mgt->u.assoc_resp.variable,
 				       iwm->resp_ie_len, GFP_KERNEL);
 	} else if (ieee80211_is_reassoc_resp(mgt->frame_control)) {
-		ie = mgt->u.reassoc_resp.variable;;
+		ie = mgt->u.reassoc_resp.variable;
 		iwm->resp_ie_len =
 				le16_to_cpu(mgt_frame->len) - (ie - (u8 *)mgt);
 		kfree(iwm->resp_ie);
-- 
1.6.3.3


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

* Re: [PATCH] Remove double semicolons
  2009-12-03  4:14 [PATCH] Remove double semicolons John Daiker
@ 2009-12-03  4:56 ` Joe Perches
  2009-12-03  5:36   ` Zhu Yi
  0 siblings, 1 reply; 6+ messages in thread
From: Joe Perches @ 2009-12-03  4:56 UTC (permalink / raw)
  To: John Daiker; +Cc: linux-wireless, samuel.ortiz, yi.zhu

On Wed, 2009-12-02 at 20:14 -0800, John Daiker wrote:
> This patches eliminates a few double semicolons in the IWMC3200 driver.

How about this instead:

Avoid an offset calculation for each management frame.
Determine the offset at compile time.

Signed-off-by: Joe Perches <joe@perches.com>

 drivers/net/wireless/iwmc3200wifi/rx.c |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/iwmc3200wifi/rx.c b/drivers/net/wireless/iwmc3200wifi/rx.c
index bdb1d7e..097144a 100644
--- a/drivers/net/wireless/iwmc3200wifi/rx.c
+++ b/drivers/net/wireless/iwmc3200wifi/rx.c
@@ -868,36 +868,35 @@ static int iwm_mlme_mgt_frame(struct iwm_priv *iwm, u8 *buf,
 	struct iwm_umac_notif_mgt_frame *mgt_frame =
 			(struct iwm_umac_notif_mgt_frame *)buf;
 	struct ieee80211_mgmt *mgt = (struct ieee80211_mgmt *)mgt_frame->frame;
-	u8 *ie;
 
 	IWM_HEXDUMP(iwm, DBG, MLME, "MGT: ", mgt_frame->frame,
 		    le16_to_cpu(mgt_frame->len));
 
 	if (ieee80211_is_assoc_req(mgt->frame_control)) {
-		ie = mgt->u.assoc_req.variable;;
-		iwm->req_ie_len =
-				le16_to_cpu(mgt_frame->len) - (ie - (u8 *)mgt);
+		iwm->req_ie_len = le16_to_cpu(mgt_frame->len)
+				  - offsetof(struct ieee80211_mgmt,
+					     u.assoc_req.variable);
 		kfree(iwm->req_ie);
 		iwm->req_ie = kmemdup(mgt->u.assoc_req.variable,
 				      iwm->req_ie_len, GFP_KERNEL);
 	} else if (ieee80211_is_reassoc_req(mgt->frame_control)) {
-		ie = mgt->u.reassoc_req.variable;;
-		iwm->req_ie_len =
-				le16_to_cpu(mgt_frame->len) - (ie - (u8 *)mgt);
+		iwm->req_ie_len = le16_to_cpu(mgt_frame->len)
+				  - offsetof(struct ieee80211_mgmt,
+					     u.reassoc_req.variable);
 		kfree(iwm->req_ie);
 		iwm->req_ie = kmemdup(mgt->u.reassoc_req.variable,
 				      iwm->req_ie_len, GFP_KERNEL);
 	} else if (ieee80211_is_assoc_resp(mgt->frame_control)) {
-		ie = mgt->u.assoc_resp.variable;;
-		iwm->resp_ie_len =
-				le16_to_cpu(mgt_frame->len) - (ie - (u8 *)mgt);
+		iwm->resp_ie_len = le16_to_cpu(mgt_frame->len)
+				   - offsetof(struct ieee80211_mgmt,
+					      u.assoc_resp.variable);
 		kfree(iwm->resp_ie);
 		iwm->resp_ie = kmemdup(mgt->u.assoc_resp.variable,
 				       iwm->resp_ie_len, GFP_KERNEL);
 	} else if (ieee80211_is_reassoc_resp(mgt->frame_control)) {
-		ie = mgt->u.reassoc_resp.variable;;
-		iwm->resp_ie_len =
-				le16_to_cpu(mgt_frame->len) - (ie - (u8 *)mgt);
+		iwm->resp_ie_len = le16_to_cpu(mgt_frame->len)
+				   - offsetof(struct ieee80211_mgmt,
+					      u.reassoc_resp.variable);
 		kfree(iwm->resp_ie);
 		iwm->resp_ie = kmemdup(mgt->u.reassoc_resp.variable,
 				       iwm->resp_ie_len, GFP_KERNEL);



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

* Re: [PATCH] Remove double semicolons
  2009-12-03  4:56 ` Joe Perches
@ 2009-12-03  5:36   ` Zhu Yi
  0 siblings, 0 replies; 6+ messages in thread
From: Zhu Yi @ 2009-12-03  5:36 UTC (permalink / raw)
  To: Joe Perches; +Cc: John Daiker, linux-wireless@vger.kernel.org, Ortiz, Samuel

On Thu, 2009-12-03 at 12:56 +0800, Joe Perches wrote:
> On Wed, 2009-12-02 at 20:14 -0800, John Daiker wrote:
> > This patches eliminates a few double semicolons in the IWMC3200
> driver.
> 
> How about this instead:
> 
> Avoid an offset calculation for each management frame.
> Determine the offset at compile time.
> 
> Signed-off-by: Joe Perches <joe@perches.com> 

Acked-by: Zhu Yi <yi.zhu@intel.com>

Thanks,
-yi


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

* [PATCH] remove double semicolons
@ 2015-12-02 21:02 Stephen Hemminger
  2015-12-03  9:53 ` Bruce Richardson
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2015-12-02 21:02 UTC (permalink / raw)
  To: dev

Trivial cleanup

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/e1000/igb_pf.c        | 2 +-
 drivers/net/xenvirt/rte_xen_lib.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c
index 26c2960..1d00dda 100644
--- a/drivers/net/e1000/igb_pf.c
+++ b/drivers/net/e1000/igb_pf.c
@@ -229,7 +229,7 @@ set_rx_mode(struct rte_eth_dev *dev)
 
 	/* set all bits that we expect to always be set */
 	fctrl &= ~E1000_RCTL_SBP; /* disable store-bad-packets */
-	fctrl |= E1000_RCTL_BAM;;
+	fctrl |= E1000_RCTL_BAM;
 
 	/* clear the bits we are changing the status of */
 	fctrl &= ~(E1000_RCTL_UPE | E1000_RCTL_MPE);
diff --git a/drivers/net/xenvirt/rte_xen_lib.c b/drivers/net/xenvirt/rte_xen_lib.c
index 5900b53..3e97c1a 100644
--- a/drivers/net/xenvirt/rte_xen_lib.c
+++ b/drivers/net/xenvirt/rte_xen_lib.c
@@ -362,7 +362,7 @@ grant_node_create(uint32_t pg_num, uint32_t *gref_arr, phys_addr_t *pa_arr, char
 	uint32_t pg_shift;
 	void *ptr = NULL;
 	uint32_t count, entries_per_pg;
-	uint32_t i, j = 0, k = 0;;
+	uint32_t i, j = 0, k = 0;
 	uint32_t *gref_tmp;
 	int first = 1;
 	char tmp_str[PATH_MAX] = {0};
-- 
2.1.4

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

* Re: [PATCH] remove double semicolons
  2015-12-02 21:02 [PATCH] remove " Stephen Hemminger
@ 2015-12-03  9:53 ` Bruce Richardson
  2015-12-07  3:23   ` Thomas Monjalon
  0 siblings, 1 reply; 6+ messages in thread
From: Bruce Richardson @ 2015-12-03  9:53 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

On Wed, Dec 02, 2015 at 01:02:32PM -0800, Stephen Hemminger wrote:
> Trivial cleanup
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

* Re: [PATCH] remove double semicolons
  2015-12-03  9:53 ` Bruce Richardson
@ 2015-12-07  3:23   ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2015-12-07  3:23 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

2015-12-03 09:53, Bruce Richardson:
> On Wed, Dec 02, 2015 at 01:02:32PM -0800, Stephen Hemminger wrote:
> > Trivial cleanup
> > 
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks

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

end of thread, other threads:[~2015-12-07  3:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-03  4:14 [PATCH] Remove double semicolons John Daiker
2009-12-03  4:56 ` Joe Perches
2009-12-03  5:36   ` Zhu Yi
  -- strict thread matches above, loose matches on Subject: below --
2015-12-02 21:02 [PATCH] remove " Stephen Hemminger
2015-12-03  9:53 ` Bruce Richardson
2015-12-07  3:23   ` Thomas Monjalon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.