All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces
@ 2008-10-30 11:09 Ilpo Järvinen
  2008-10-30 11:11 ` [PATCH 02/10] consolemap: indentation & braces disagree - reindent Ilpo Järvinen
                   ` (9 more replies)
  0 siblings, 10 replies; 17+ messages in thread
From: Ilpo Järvinen @ 2008-10-30 11:09 UTC (permalink / raw)
  To: perex, tiwai; +Cc: LKML, Andrew Morton

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1162 bytes --]


Neither has any significance currently to the flow
because err is checked for the same condition before
the place of disagreement.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 sound/pci/ice1712/ice1712.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index 5b44238..58d7cda 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -2688,12 +2688,13 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
 		return err;
 	}
 
-	if (ice_has_con_ac97(ice))
+	if (ice_has_con_ac97(ice)) {
 		err = snd_ice1712_pcm(ice, pcm_dev++, NULL);
 		if (err < 0) {
 			snd_card_free(card);
 			return err;
 		}
+	}
 
 	err = snd_ice1712_ac97_mixer(ice);
 	if (err < 0) {
@@ -2715,12 +2716,13 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
 		}
 	}
 
-	if (ice_has_con_ac97(ice))
+	if (ice_has_con_ac97(ice)) {
 		err = snd_ice1712_pcm_ds(ice, pcm_dev++, NULL);
 		if (err < 0) {
 			snd_card_free(card);
 			return err;
 		}
+	}
 
 	if (!c->no_mpu401) {
 		err = snd_mpu401_uart_new(card, 0, MPU401_HW_ICE1712,
-- 
1.5.2.2

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

* [PATCH 02/10] consolemap: indentation & braces disagree - reindent
  2008-10-30 11:09 [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces Ilpo Järvinen
@ 2008-10-30 11:11 ` Ilpo Järvinen
  2008-10-30 11:32 ` [PATCH 03/10] misdn: indentation & braces disagree - add braces Ilpo Järvinen
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Ilpo Järvinen @ 2008-10-30 11:11 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML

[-- Attachment #1: Type: TEXT/PLAIN, Size: 634 bytes --]


I hope I got this one correctly.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 drivers/char/consolemap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/consolemap.c b/drivers/char/consolemap.c
index 4246b8e..45d3e80 100644
--- a/drivers/char/consolemap.c
+++ b/drivers/char/consolemap.c
@@ -554,7 +554,7 @@ int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list)
 		__get_user(fontpos, &list->fontpos);
 		if ((err1 = con_insert_unipair(p, unicode,fontpos)) != 0)
 			err = err1;
-			list++;
+		list++;
 	}
 	
 	if (con_unify_unimap(vc, p))
-- 
1.5.2.2

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

* [PATCH 03/10] misdn: indentation & braces disagree - add braces
  2008-10-30 11:09 [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces Ilpo Järvinen
  2008-10-30 11:11 ` [PATCH 02/10] consolemap: indentation & braces disagree - reindent Ilpo Järvinen
@ 2008-10-30 11:32 ` Ilpo Järvinen
  2008-10-30 11:34 ` [PATCH 04/10] misdn: one handmade ARRAY_SIZE converted Ilpo Järvinen
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Ilpo Järvinen @ 2008-10-30 11:32 UTC (permalink / raw)
  To: kkeil; +Cc: LKML, Andrew Morton

[-- Attachment #1: Type: TEXT/PLAIN, Size: 872 bytes --]


Nothing is broken because of this - currently.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 drivers/isdn/mISDN/dsp_cmx.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/isdn/mISDN/dsp_cmx.c b/drivers/isdn/mISDN/dsp_cmx.c
index c2f51cc..f503eb1 100644
--- a/drivers/isdn/mISDN/dsp_cmx.c
+++ b/drivers/isdn/mISDN/dsp_cmx.c
@@ -1855,7 +1855,7 @@ dsp_cmx_hdlc(struct dsp *dsp, struct sk_buff *skb)
 		/* in case of hardware (echo) */
 		if (dsp->pcm_slot_tx >= 0)
 			return;
-		if (dsp->echo)
+		if (dsp->echo) {
 			nskb = skb_clone(skb, GFP_ATOMIC);
 			if (nskb) {
 				hh = mISDN_HEAD_P(nskb);
@@ -1864,6 +1864,7 @@ dsp_cmx_hdlc(struct dsp *dsp, struct sk_buff *skb)
 				skb_queue_tail(&dsp->sendq, nskb);
 				schedule_work(&dsp->workq);
 			}
+		}
 		return;
 	}
 	/* in case of hardware conference */
-- 
1.5.2.2

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

* [PATCH 04/10] misdn: one handmade ARRAY_SIZE converted
  2008-10-30 11:09 [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces Ilpo Järvinen
  2008-10-30 11:11 ` [PATCH 02/10] consolemap: indentation & braces disagree - reindent Ilpo Järvinen
  2008-10-30 11:32 ` [PATCH 03/10] misdn: indentation & braces disagree - add braces Ilpo Järvinen
@ 2008-10-30 11:34 ` Ilpo Järvinen
  2008-10-30 11:35 ` [PATCH 05/10] misdn: indentation and braces disagree - add braces Ilpo Järvinen
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Ilpo Järvinen @ 2008-10-30 11:34 UTC (permalink / raw)
  To: kkeil; +Cc: LKML, Andrew Morton

[-- Attachment #1: Type: TEXT/PLAIN, Size: 764 bytes --]

Defined as:

static struct device_attribute element_attributes[] = {

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 drivers/isdn/mISDN/dsp_pipeline.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/isdn/mISDN/dsp_pipeline.c b/drivers/isdn/mISDN/dsp_pipeline.c
index 850260a..45bff0a 100644
--- a/drivers/isdn/mISDN/dsp_pipeline.c
+++ b/drivers/isdn/mISDN/dsp_pipeline.c
@@ -99,8 +99,7 @@ int mISDN_dsp_element_register(struct mISDN_dsp_element *elem)
 		goto err1;
 	}
 
-	for (i = 0; i < (sizeof(element_attributes)
-		/ sizeof(struct device_attribute)); ++i)
+	for (i = 0; i < ARRAY_SIZE(element_attributes); ++i)
 		ret = device_create_file(&entry->dev,
 				&element_attributes[i]);
 		if (ret) {
-- 
1.5.2.2

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

* [PATCH 05/10] misdn: indentation and braces disagree - add braces
  2008-10-30 11:09 [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces Ilpo Järvinen
                   ` (2 preceding siblings ...)
  2008-10-30 11:34 ` [PATCH 04/10] misdn: one handmade ARRAY_SIZE converted Ilpo Järvinen
@ 2008-10-30 11:35 ` Ilpo Järvinen
  2008-10-30 11:39 ` [PATCH 07/10] rdma/nes: reindent mis-indented spinlocks Ilpo Järvinen
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Ilpo Järvinen @ 2008-10-30 11:35 UTC (permalink / raw)
  To: kkeil; +Cc: LKML, Andrew Morton

[-- Attachment #1: Type: TEXT/PLAIN, Size: 936 bytes --]


This is not buggy due to plain luck as there is only one
entry currently in the element_attributes.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 drivers/isdn/mISDN/dsp_pipeline.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/isdn/mISDN/dsp_pipeline.c b/drivers/isdn/mISDN/dsp_pipeline.c
index 45bff0a..3e3d895 100644
--- a/drivers/isdn/mISDN/dsp_pipeline.c
+++ b/drivers/isdn/mISDN/dsp_pipeline.c
@@ -99,7 +99,7 @@ int mISDN_dsp_element_register(struct mISDN_dsp_element *elem)
 		goto err1;
 	}
 
-	for (i = 0; i < ARRAY_SIZE(element_attributes); ++i)
+	for (i = 0; i < ARRAY_SIZE(element_attributes); ++i) {
 		ret = device_create_file(&entry->dev,
 				&element_attributes[i]);
 		if (ret) {
@@ -107,6 +107,7 @@ int mISDN_dsp_element_register(struct mISDN_dsp_element *elem)
 				__func__);
 			goto err2;
 		}
+	}
 
 	list_add_tail(&entry->list, &dsp_elements);
 
-- 
1.5.2.2

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

* [PATCH 07/10] rdma/nes: reindent mis-indented spinlocks
  2008-10-30 11:09 [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces Ilpo Järvinen
                   ` (3 preceding siblings ...)
  2008-10-30 11:35 ` [PATCH 05/10] misdn: indentation and braces disagree - add braces Ilpo Järvinen
@ 2008-10-30 11:39 ` Ilpo Järvinen
  2008-11-03  5:34   ` Roland Dreier
  2008-10-30 11:40 ` [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces Takashi Iwai
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 17+ messages in thread
From: Ilpo Järvinen @ 2008-10-30 11:39 UTC (permalink / raw)
  To: rolandd; +Cc: general, LKML

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2960 bytes --]


Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 drivers/infiniband/hw/nes/nes_verbs.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
index 932e56f..ffdd141 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -220,14 +220,14 @@ static int nes_bind_mw(struct ib_qp *ibqp, struct ib_mw *ibmw,
 	if (nesqp->ibqp_state > IB_QPS_RTS)
 		return -EINVAL;
 
-		spin_lock_irqsave(&nesqp->lock, flags);
+	spin_lock_irqsave(&nesqp->lock, flags);
 
 	head = nesqp->hwqp.sq_head;
 	qsize = nesqp->hwqp.sq_tail;
 
 	/* Check for SQ overflow */
 	if (((head + (2 * qsize) - nesqp->hwqp.sq_tail) % qsize) == (qsize - 1)) {
-			spin_unlock_irqrestore(&nesqp->lock, flags);
+		spin_unlock_irqrestore(&nesqp->lock, flags);
 		return -EINVAL;
 	}
 
@@ -269,7 +269,7 @@ static int nes_bind_mw(struct ib_qp *ibqp, struct ib_mw *ibmw,
 	nes_write32(nesdev->regs+NES_WQE_ALLOC,
 			(1 << 24) | 0x00800000 | nesqp->hwqp.qp_id);
 
-		spin_unlock_irqrestore(&nesqp->lock, flags);
+	spin_unlock_irqrestore(&nesqp->lock, flags);
 
 	return 0;
 }
@@ -3212,7 +3212,7 @@ static int nes_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
 	if (nesqp->ibqp_state > IB_QPS_RTS)
 		return -EINVAL;
 
-		spin_lock_irqsave(&nesqp->lock, flags);
+	spin_lock_irqsave(&nesqp->lock, flags);
 
 	head = nesqp->hwqp.sq_head;
 
@@ -3337,7 +3337,7 @@ static int nes_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
 				(counter << 24) | 0x00800000 | nesqp->hwqp.qp_id);
 	}
 
-		spin_unlock_irqrestore(&nesqp->lock, flags);
+	spin_unlock_irqrestore(&nesqp->lock, flags);
 
 	if (err)
 		*bad_wr = ib_wr;
@@ -3368,7 +3368,7 @@ static int nes_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr,
 	if (nesqp->ibqp_state > IB_QPS_RTS)
 		return -EINVAL;
 
-		spin_lock_irqsave(&nesqp->lock, flags);
+	spin_lock_irqsave(&nesqp->lock, flags);
 
 	head = nesqp->hwqp.rq_head;
 
@@ -3421,7 +3421,7 @@ static int nes_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr,
 		nes_write32(nesdev->regs+NES_WQE_ALLOC, (counter<<24) | nesqp->hwqp.qp_id);
 	}
 
-		spin_unlock_irqrestore(&nesqp->lock, flags);
+	spin_unlock_irqrestore(&nesqp->lock, flags);
 
 	if (err)
 		*bad_wr = ib_wr;
@@ -3453,7 +3453,7 @@ static int nes_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *entry)
 
 	nes_debug(NES_DBG_CQ, "\n");
 
-		spin_lock_irqsave(&nescq->lock, flags);
+	spin_lock_irqsave(&nescq->lock, flags);
 
 	head = nescq->hw_cq.cq_head;
 	cq_size = nescq->hw_cq.cq_size;
@@ -3562,7 +3562,7 @@ static int nes_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *entry)
 	nes_debug(NES_DBG_CQ, "Reporting %u completions for CQ%u.\n",
 			cqe_count, nescq->hw_cq.cq_number);
 
-		spin_unlock_irqrestore(&nescq->lock, flags);
+	spin_unlock_irqrestore(&nescq->lock, flags);
 
 	return cqe_count;
 }
-- 
1.5.2.2

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

* Re: [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces
  2008-10-30 11:09 [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces Ilpo Järvinen
                   ` (4 preceding siblings ...)
  2008-10-30 11:39 ` [PATCH 07/10] rdma/nes: reindent mis-indented spinlocks Ilpo Järvinen
@ 2008-10-30 11:40 ` Takashi Iwai
  2008-10-30 11:41 ` [PATCH 08/10] ath9k: add block braces to match indentation Ilpo Järvinen
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Takashi Iwai @ 2008-10-30 11:40 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: perex, LKML, Andrew Morton

At Thu, 30 Oct 2008 13:09:55 +0200 (EET),
=?ISO-8859-1?Q?Ilpo_J=E4rvinen?= wrote:
> 
> Neither has any significance currently to the flow
> because err is checked for the same condition before
> the place of disagreement.
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>

Doh, that must come from the last coding-style fix patch.
Applied now and will be in the next pull request.

Thanks!

Takashi


> ---
>  sound/pci/ice1712/ice1712.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
> index 5b44238..58d7cda 100644
> --- a/sound/pci/ice1712/ice1712.c
> +++ b/sound/pci/ice1712/ice1712.c
> @@ -2688,12 +2688,13 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
>  		return err;
>  	}
>  
> -	if (ice_has_con_ac97(ice))
> +	if (ice_has_con_ac97(ice)) {
>  		err = snd_ice1712_pcm(ice, pcm_dev++, NULL);
>  		if (err < 0) {
>  			snd_card_free(card);
>  			return err;
>  		}
> +	}
>  
>  	err = snd_ice1712_ac97_mixer(ice);
>  	if (err < 0) {
> @@ -2715,12 +2716,13 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
>  		}
>  	}
>  
> -	if (ice_has_con_ac97(ice))
> +	if (ice_has_con_ac97(ice)) {
>  		err = snd_ice1712_pcm_ds(ice, pcm_dev++, NULL);
>  		if (err < 0) {
>  			snd_card_free(card);
>  			return err;
>  		}
> +	}
>  
>  	if (!c->no_mpu401) {
>  		err = snd_mpu401_uart_new(card, 0, MPU401_HW_ICE1712,
> -- 
> 1.5.2.2

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

* [PATCH 08/10] ath9k: add block braces to match indentation
  2008-10-30 11:09 [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces Ilpo Järvinen
                   ` (5 preceding siblings ...)
  2008-10-30 11:40 ` [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces Takashi Iwai
@ 2008-10-30 11:41 ` Ilpo Järvinen
  2008-10-30 11:45   ` Johannes Berg
  2008-10-30 11:43 ` [PATCH 09/10] b43legacy: reindent misleading statement Ilpo Järvinen
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 17+ messages in thread
From: Ilpo Järvinen @ 2008-10-30 11:41 UTC (permalink / raw)
  To: linville, lrodriguez; +Cc: linux-wireless

[-- Attachment #1: Type: TEXT/PLAIN, Size: 930 bytes --]


This isn't a behavior problem as is, and fixing indentation
inconsistency either way would be fine (reindent or braces).

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 drivers/net/wireless/ath9k/main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index f05f584..0f67b1b 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -467,9 +467,10 @@ void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
 	if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK ||
 		tx_info->flags & IEEE80211_TX_STAT_TX_FILTERED) {
 		/* free driver's private data area of tx_info */
-		if (tx_info->driver_data[0] != NULL)
+		if (tx_info->driver_data[0] != NULL) {
 			kfree(tx_info->driver_data[0]);
 			tx_info->driver_data[0] = NULL;
+		}
 	}
 
 	if (tx_status->flags & ATH_TX_BAR) {
-- 
1.5.2.2

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

* [PATCH 09/10] b43legacy: reindent misleading statement
  2008-10-30 11:09 [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces Ilpo Järvinen
                   ` (6 preceding siblings ...)
  2008-10-30 11:41 ` [PATCH 08/10] ath9k: add block braces to match indentation Ilpo Järvinen
@ 2008-10-30 11:43 ` Ilpo Järvinen
  2008-10-30 23:45   ` Larry Finger
  2008-10-30 11:47 ` [PATCH 10/10] arcmsr: add missing braces to multistatement if block Ilpo Järvinen
  2008-10-30 11:56 ` [PATCH 06/10] usbtmc: indent & braces disagree, something else is desired Ilpo Järvinen
  9 siblings, 1 reply; 17+ messages in thread
From: Ilpo Järvinen @ 2008-10-30 11:43 UTC (permalink / raw)
  To: linville, Larry.Finger; +Cc: linux-wireless

[-- Attachment #1: Type: TEXT/PLAIN, Size: 711 bytes --]


Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 drivers/net/wireless/b43legacy/dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c
index fb6819e..786e028 100644
--- a/drivers/net/wireless/b43legacy/dma.c
+++ b/drivers/net/wireless/b43legacy/dma.c
@@ -919,7 +919,7 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev,
 			if (!ring->txhdr_cache)
 				goto err_kfree_meta;
 
-				dma_test = ssb_dma_map_single(dev->dev,
+			dma_test = ssb_dma_map_single(dev->dev,
 					ring->txhdr_cache,
 					sizeof(struct b43legacy_txhdr_fw3),
 					DMA_TO_DEVICE);
-- 
1.5.2.2

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

* Re: [PATCH 08/10] ath9k: add block braces to match indentation
  2008-10-30 11:41 ` [PATCH 08/10] ath9k: add block braces to match indentation Ilpo Järvinen
@ 2008-10-30 11:45   ` Johannes Berg
  2008-10-30 12:15     ` Ilpo Järvinen
       [not found]     ` <18697.50365.638598.302055@localhost.localdomain>
  0 siblings, 2 replies; 17+ messages in thread
From: Johannes Berg @ 2008-10-30 11:45 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: linville, lrodriguez, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

On Thu, 2008-10-30 at 13:41 +0200, Ilpo Järvinen wrote:
> This isn't a behavior problem as is, and fixing indentation
> inconsistency either way would be fine (reindent or braces).
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
> ---
>  drivers/net/wireless/ath9k/main.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
> index f05f584..0f67b1b 100644
> --- a/drivers/net/wireless/ath9k/main.c
> +++ b/drivers/net/wireless/ath9k/main.c
> @@ -467,9 +467,10 @@ void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
>  	if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK ||
>  		tx_info->flags & IEEE80211_TX_STAT_TX_FILTERED) {
>  		/* free driver's private data area of tx_info */
> -		if (tx_info->driver_data[0] != NULL)
> +		if (tx_info->driver_data[0] != NULL) {
>  			kfree(tx_info->driver_data[0]);
>  			tx_info->driver_data[0] = NULL;
> +		}

Since kfree(NULL) is fine, how about just removing the if? Also, this
code has been removed in a recent change in the wireless tree, I think
(the rate control revamp)

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [PATCH 10/10] arcmsr: add missing braces to multistatement if block
  2008-10-30 11:09 [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces Ilpo Järvinen
                   ` (7 preceding siblings ...)
  2008-10-30 11:43 ` [PATCH 09/10] b43legacy: reindent misleading statement Ilpo Järvinen
@ 2008-10-30 11:47 ` Ilpo Järvinen
  2008-10-30 11:56 ` [PATCH 06/10] usbtmc: indent & braces disagree, something else is desired Ilpo Järvinen
  9 siblings, 0 replies; 17+ messages in thread
From: Ilpo Järvinen @ 2008-10-30 11:47 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, LKML

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1001 bytes --]


Funny, there are plenty of the braces in case block where
one does not need them while in here they seem to be
forgotten.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 drivers/scsi/arcmsr/arcmsr_hba.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index f91f79c..b57834b 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -673,10 +673,11 @@ static void arcmsr_report_ccb_state(struct AdapterControlBlock *acb, \
 	id = ccb->pcmd->device->id;
 	lun = ccb->pcmd->device->lun;
 	if (!(flag_ccb & ARCMSR_CCBREPLY_FLAG_ERROR)) {
-		if (acb->devstate[id][lun] == ARECA_RAID_GONE)
+		if (acb->devstate[id][lun] == ARECA_RAID_GONE) {
 			acb->devstate[id][lun] = ARECA_RAID_GOOD;
 			ccb->pcmd->result = DID_OK << 16;
 			arcmsr_ccb_complete(ccb, 1);
+		}
 	} else {
 		switch (ccb->arcmsr_cdb.DeviceStatus) {
 		case ARCMSR_DEV_SELECT_TIMEOUT: {
-- 
1.5.2.2

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

* [PATCH 06/10] usbtmc: indent & braces disagree, something else is desired
  2008-10-30 11:09 [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces Ilpo Järvinen
                   ` (8 preceding siblings ...)
  2008-10-30 11:47 ` [PATCH 10/10] arcmsr: add missing braces to multistatement if block Ilpo Järvinen
@ 2008-10-30 11:56 ` Ilpo Järvinen
  2008-11-12 20:25   ` patch usb-usbtmc-indent-braces-disagree-something-else-is-desired.patch added to gregkh-2.6 tree gregkh
  9 siblings, 1 reply; 17+ messages in thread
From: Ilpo Järvinen @ 2008-10-30 11:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: LKML

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1425 bytes --]


It seems that there's rather involved way to say something
which is commonly written in a plain simple form.

Some type changes would probably be necessary to get gcc
to do bitops instead of divide but it's no worse after my
change than before I think.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 drivers/usb/class/usbtmc.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 543811f..711a9fa 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -21,6 +21,7 @@
 
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/kernel.h>
 #include <linux/fs.h>
 #include <linux/uaccess.h>
 #include <linux/kref.h>
@@ -481,7 +482,6 @@ static ssize_t usbtmc_write(struct file *filp, const char __user *buf,
 	int retval;
 	int actual;
 	unsigned long int n_bytes;
-	int n;
 	int remaining;
 	int done;
 	int this_part;
@@ -525,11 +525,8 @@ static ssize_t usbtmc_write(struct file *filp, const char __user *buf,
 			goto exit;
 		}
 
-		n_bytes = 12 + this_part;
-		if (this_part % 4)
-			n_bytes += 4 - this_part % 4;
-			for (n = 12 + this_part; n < n_bytes; n++)
-				buffer[n] = 0;
+		n_bytes = roundup(12 + this_part, 4);
+		memset(buffer + 12 + this_part, 0, n_bytes - (12 + this_part));
 
 		retval = usb_bulk_msg(data->usb_dev,
 				      usb_sndbulkpipe(data->usb_dev,
-- 
1.5.2.2

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

* Re: [PATCH 08/10] ath9k: add block braces to match indentation
  2008-10-30 11:45   ` Johannes Berg
@ 2008-10-30 12:15     ` Ilpo Järvinen
       [not found]     ` <18697.50365.638598.302055@localhost.localdomain>
  1 sibling, 0 replies; 17+ messages in thread
From: Ilpo Järvinen @ 2008-10-30 12:15 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linville, lrodriguez, linux-wireless

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1548 bytes --]

On Thu, 30 Oct 2008, Johannes Berg wrote:

> On Thu, 2008-10-30 at 13:41 +0200, Ilpo Järvinen wrote:
> > This isn't a behavior problem as is, and fixing indentation
> > inconsistency either way would be fine (reindent or braces).
> > 
> > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
> > ---
> >  drivers/net/wireless/ath9k/main.c |    3 ++-
> >  1 files changed, 2 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
> > index f05f584..0f67b1b 100644
> > --- a/drivers/net/wireless/ath9k/main.c
> > +++ b/drivers/net/wireless/ath9k/main.c
> > @@ -467,9 +467,10 @@ void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
> >  	if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK ||
> >  		tx_info->flags & IEEE80211_TX_STAT_TX_FILTERED) {
> >  		/* free driver's private data area of tx_info */
> > -		if (tx_info->driver_data[0] != NULL)
> > +		if (tx_info->driver_data[0] != NULL) {
> >  			kfree(tx_info->driver_data[0]);
> >  			tx_info->driver_data[0] = NULL;
> > +		}
> 
> Since kfree(NULL) is fine, how about just removing the if?

Agreed. I had perhaps done too many of these already when I came to this 
one and failed to notice such obviousness... :-)

> Also, this code has been removed in a recent change in the wireless 
> tree, I think (the rate control revamp)

Ok. A bit hard for me to track all the upcoming changes tree wide, I once 
did this kind of things in -next but since it had the break recently I 
didn't remember to return to it.

-- 
 i.

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

* Re: [PATCH 08/10] ath9k: add block braces to match indentation
       [not found]     ` <18697.50365.638598.302055@localhost.localdomain>
@ 2008-10-30 14:33       ` Johannes Berg
  0 siblings, 0 replies; 17+ messages in thread
From: Johannes Berg @ 2008-10-30 14:33 UTC (permalink / raw)
  To: Sujith; +Cc: Ilpo J??rvinen, linville, lrodriguez, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]

On Thu, 2008-10-30 at 19:59 +0530, Sujith wrote:
> Johannes Berg wrote:
> > > diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
> > > index f05f584..0f67b1b 100644
> > > --- a/drivers/net/wireless/ath9k/main.c
> > > +++ b/drivers/net/wireless/ath9k/main.c
> > > @@ -467,9 +467,10 @@ void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
> > >  	if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK ||
> > >  		tx_info->flags & IEEE80211_TX_STAT_TX_FILTERED) {
> > >  		/* free driver's private data area of tx_info */
> > > -		if (tx_info->driver_data[0] != NULL)
> > > +		if (tx_info->driver_data[0] != NULL) {
> > >  			kfree(tx_info->driver_data[0]);
> > >  			tx_info->driver_data[0] = NULL;
> > > +		}
> > 
> > Since kfree(NULL) is fine, how about just removing the if? Also, this
> > code has been removed in a recent change in the wireless tree, I think
> > (the rate control revamp)
> > 
> 
> Rate control hasn't been revamped yet. :)

Well, Felix's and my patch touched this code but did actually leave the
indentation strange like that. Anyway, since it will be rewritten
eventually and the strange indentation doesn't hurt right now, I think
not touching it will be simpler to avoid merge conflicts all around.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 09/10] b43legacy: reindent misleading statement
  2008-10-30 11:43 ` [PATCH 09/10] b43legacy: reindent misleading statement Ilpo Järvinen
@ 2008-10-30 23:45   ` Larry Finger
  0 siblings, 0 replies; 17+ messages in thread
From: Larry Finger @ 2008-10-30 23:45 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: linville, linux-wireless

Ilpo J=E4rvinen wrote:
> Signed-off-by: Ilpo J=E4rvinen <ilpo.jarvinen@helsinki.fi>
> ---
>  drivers/net/wireless/b43legacy/dma.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>=20

ACK.

Larry


--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 07/10] rdma/nes: reindent mis-indented spinlocks
  2008-10-30 11:39 ` [PATCH 07/10] rdma/nes: reindent mis-indented spinlocks Ilpo Järvinen
@ 2008-11-03  5:34   ` Roland Dreier
  0 siblings, 0 replies; 17+ messages in thread
From: Roland Dreier @ 2008-11-03  5:34 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: rolandd, general, LKML

thanks, applied

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

* patch usb-usbtmc-indent-braces-disagree-something-else-is-desired.patch added to gregkh-2.6 tree
  2008-10-30 11:56 ` [PATCH 06/10] usbtmc: indent & braces disagree, something else is desired Ilpo Järvinen
@ 2008-11-12 20:25   ` gregkh
  0 siblings, 0 replies; 17+ messages in thread
From: gregkh @ 2008-11-12 20:25 UTC (permalink / raw)
  To: ilpo.jarvinen, gregkh, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2203 bytes --]


This is a note to let you know that I've just added the patch titled

    Subject: USB: usbtmc: indent & braces disagree, something else is desired

to my gregkh-2.6 tree.  Its filename is

    usb-usbtmc-indent-braces-disagree-something-else-is-desired.patch

This tree can be found at 
    http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/


>From ilpo.jarvinen@helsinki.fi  Wed Nov 12 11:29:47 2008
From: "Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>
Date: Thu, 30 Oct 2008 13:56:47 +0200 (EET)
Subject: USB: usbtmc: indent & braces disagree, something else is desired
To: Greg Kroah-Hartman <gregkh@suse.de>
Cc: LKML <linux-kernel@vger.kernel.org>
Message-ID: <Pine.LNX.4.64.0810301349460.7072@wrl-59.cs.helsinki.fi>

It seems that there's rather involved way to say something
which is commonly written in a plain simple form.

Some type changes would probably be necessary to get gcc
to do bitops instead of divide but it's no worse after my
change than before I think.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/class/usbtmc.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -21,6 +21,7 @@
 
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/kernel.h>
 #include <linux/fs.h>
 #include <linux/uaccess.h>
 #include <linux/kref.h>
@@ -481,7 +482,6 @@ static ssize_t usbtmc_write(struct file 
 	int retval;
 	int actual;
 	unsigned long int n_bytes;
-	int n;
 	int remaining;
 	int done;
 	int this_part;
@@ -525,11 +525,8 @@ static ssize_t usbtmc_write(struct file 
 			goto exit;
 		}
 
-		n_bytes = 12 + this_part;
-		if (this_part % 4)
-			n_bytes += 4 - this_part % 4;
-			for (n = 12 + this_part; n < n_bytes; n++)
-				buffer[n] = 0;
+		n_bytes = roundup(12 + this_part, 4);
+		memset(buffer + 12 + this_part, 0, n_bytes - (12 + this_part));
 
 		retval = usb_bulk_msg(data->usb_dev,
 				      usb_sndbulkpipe(data->usb_dev,


Patches currently in gregkh-2.6 which might be from ilpo.jarvinen@helsinki.fi are

usb/usb-usbtmc-indent-braces-disagree-something-else-is-desired.patch

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

end of thread, other threads:[~2008-11-12 20:26 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-30 11:09 [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces Ilpo Järvinen
2008-10-30 11:11 ` [PATCH 02/10] consolemap: indentation & braces disagree - reindent Ilpo Järvinen
2008-10-30 11:32 ` [PATCH 03/10] misdn: indentation & braces disagree - add braces Ilpo Järvinen
2008-10-30 11:34 ` [PATCH 04/10] misdn: one handmade ARRAY_SIZE converted Ilpo Järvinen
2008-10-30 11:35 ` [PATCH 05/10] misdn: indentation and braces disagree - add braces Ilpo Järvinen
2008-10-30 11:39 ` [PATCH 07/10] rdma/nes: reindent mis-indented spinlocks Ilpo Järvinen
2008-11-03  5:34   ` Roland Dreier
2008-10-30 11:40 ` [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces Takashi Iwai
2008-10-30 11:41 ` [PATCH 08/10] ath9k: add block braces to match indentation Ilpo Järvinen
2008-10-30 11:45   ` Johannes Berg
2008-10-30 12:15     ` Ilpo Järvinen
     [not found]     ` <18697.50365.638598.302055@localhost.localdomain>
2008-10-30 14:33       ` Johannes Berg
2008-10-30 11:43 ` [PATCH 09/10] b43legacy: reindent misleading statement Ilpo Järvinen
2008-10-30 23:45   ` Larry Finger
2008-10-30 11:47 ` [PATCH 10/10] arcmsr: add missing braces to multistatement if block Ilpo Järvinen
2008-10-30 11:56 ` [PATCH 06/10] usbtmc: indent & braces disagree, something else is desired Ilpo Järvinen
2008-11-12 20:25   ` patch usb-usbtmc-indent-braces-disagree-something-else-is-desired.patch added to gregkh-2.6 tree gregkh

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.