LKML Archive on 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
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ 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	[flat|nested] 11+ 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
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 11+ 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	[flat|nested] 11+ 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
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 11+ 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	[flat|nested] 11+ 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
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 11+ 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	[flat|nested] 11+ 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
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ 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	[flat|nested] 11+ 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
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 11+ 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	[flat|nested] 11+ 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: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
  7 siblings, 0 replies; 11+ 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] 11+ 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
                   ` (5 preceding siblings ...)
  2008-10-30 11:40 ` [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces Takashi Iwai
@ 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
  7 siblings, 0 replies; 11+ 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	[flat|nested] 11+ 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
                   ` (6 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
  7 siblings, 1 reply; 11+ 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	[flat|nested] 11+ 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; 11+ 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] 11+ 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; 11+ 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] 11+ messages in thread

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

Thread overview: 11+ 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: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 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).