[PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces - Kernel

This is a discussion on [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces - Kernel ; 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 --- 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 ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces

  1. [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces


    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
    ---
    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


  2. [PATCH 02/10] consolemap: indentation & braces disagree - reindent


    I hope I got this one correctly.

    Signed-off-by: Ilpo Järvinen
    ---
    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


  3. [PATCH 05/10] misdn: indentation and braces disagree - add braces


    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
    ---
    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


  4. [PATCH 04/10] misdn: one handmade ARRAY_SIZE converted

    Defined as:

    static struct device_attribute element_attributes[] = {

    Signed-off-by: Ilpo Järvinen
    ---
    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


  5. [PATCH 03/10] misdn: indentation & braces disagree - add braces


    Nothing is broken because of this - currently.

    Signed-off-by: Ilpo Järvinen
    ---
    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


  6. [PATCH 07/10] rdma/nes: reindent mis-indented spinlocks


    Signed-off-by: Ilpo Järvinen
    ---
    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


  7. Re: [PATCH 01/10] sound/ice1712: indentation & braces disagree - add braces

    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


    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

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  8. [PATCH 10/10] arcmsr: add missing braces to multistatement if block


    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
    ---
    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

  9. [PATCH 06/10] usbtmc: indent & braces disagree, something else is desired


    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
    ---
    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
    #include
    +#include
    #include
    #include
    #include
    @@ -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


  10. Re: [PATCH 07/10] rdma/nes: reindent mis-indented spinlocks

    thanks, applied
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread