2018-12-30 16:31:21

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 0/8] reduce indentation

These patches fix cases where a subsequent statement is aligned
with the right hand side of an assignment rather than the left
hand side. This was done using the following semantic match
(http://coccinelle.lip6.fr/). It has a lot of false positives,
because Coccinelle doesn't record the difference between a space
and a tab, but these issues are easy to skip over.

// <smpl>
@r@
expression x,e;
statement S;
position p0,p1,p2;
@@
x@p0 = e@p1;
S@p2

@script:ocaml@
p0 << r.p0;
p1 << r.p1;
p2 << r.p2;
@@
if ((List.hd p0).col < (List.hd p1).col &&
(List.hd p1).col = (List.hd p2).col)
then Coccilib.print_main "" p1
// </smpl>

---

drivers/firmware/stratix10-svc.c | 12 ++++++------
drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 2 +-
drivers/iommu/msm_iommu.c | 8 ++++----
drivers/net/ethernet/amazon/ena/ena_eth_com.c | 4 ++--
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
drivers/scsi/pm8001/pm8001_sas.c | 2 +-
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 6 +++---
drivers/usb/gadget/udc/snps_udc_core.c | 17 ++++++++---------
8 files changed, 26 insertions(+), 27 deletions(-)


2018-12-30 16:31:09

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 1/8] usb: gadget: udc: reduce indentation

Delete tab aligning a statement with the right hand side of a
preceding assignment rather than the left hand side.

Found with the help of Coccinelle.

Signed-off-by: Julia Lawall <[email protected]>

---
drivers/usb/gadget/udc/snps_udc_core.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/gadget/udc/snps_udc_core.c b/drivers/usb/gadget/udc/snps_udc_core.c
index d4da47f4f6f4..3fcded31405a 100644
--- a/drivers/usb/gadget/udc/snps_udc_core.c
+++ b/drivers/usb/gadget/udc/snps_udc_core.c
@@ -947,15 +947,14 @@ static int prep_dma(struct udc_ep *ep, struct udc_request *req, gfp_t gfp)
UDC_DMA_STP_STS_BS_HOST_READY,
UDC_DMA_STP_STS_BS);

-
- /* clear NAK by writing CNAK */
- if (ep->naking) {
- tmp = readl(&ep->regs->ctl);
- tmp |= AMD_BIT(UDC_EPCTL_CNAK);
- writel(tmp, &ep->regs->ctl);
- ep->naking = 0;
- UDC_QUEUE_CNAK(ep, ep->num);
- }
+ /* clear NAK by writing CNAK */
+ if (ep->naking) {
+ tmp = readl(&ep->regs->ctl);
+ tmp |= AMD_BIT(UDC_EPCTL_CNAK);
+ writel(tmp, &ep->regs->ctl);
+ ep->naking = 0;
+ UDC_QUEUE_CNAK(ep, ep->num);
+ }

}



2018-12-30 16:31:15

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 6/8] scsi: pm80xx: reduce indentation

Delete tab aligning a statement with the right hand side of a
preceding assignment rather than the left hand side.

Found with the help of Coccinelle.

Signed-off-by: Julia Lawall <[email protected]>

---
drivers/scsi/pm8001/pm8001_sas.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
index b3be49d41375..44b630aceb12 100644
--- a/drivers/scsi/pm8001/pm8001_sas.c
+++ b/drivers/scsi/pm8001/pm8001_sas.c
@@ -657,7 +657,7 @@ static int pm8001_dev_found_notify(struct domain_device *dev)
if (dev->dev_type == SAS_SATA_DEV) {
pm8001_device->attached_phy =
dev->rphy->identify.phy_identifier;
- flag = 1; /* directly sata*/
+ flag = 1; /* directly sata*/
}
} /*register this device to HBA*/
PM8001_DISC_DBG(pm8001_ha, pm8001_printk("Found device\n"));


2018-12-30 16:31:27

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 7/8] drm/msm/dsi: reduce indentation

Delete tab aligning a statement with the right hand side of a
preceding assignment rather than the left hand side.

Found with the help of Coccinelle.

Signed-off-by: Julia Lawall <[email protected]>

---
drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
index 1760483b247e..4d8785282c6c 100644
--- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
+++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
@@ -355,7 +355,7 @@ int msm_dsi_dphy_timing_calc_v3(struct msm_dsi_dphy_timing *timing,
} else {
timing->shared_timings.clk_pre =
linear_inter(tmax, tmin, pcnt2, 0, false);
- timing->shared_timings.clk_pre_inc_by_2 = 0;
+ timing->shared_timings.clk_pre_inc_by_2 = 0;
}

timing->ta_go = 3;


2018-12-30 16:31:37

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 8/8] iommu/msm: reduce indentation

Delete tab aligning a statement with the right hand side of a
preceding assignment rather than the left hand side.

Found with the help of Coccinelle.

Signed-off-by: Julia Lawall <[email protected]>

---
drivers/iommu/msm_iommu.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c
index fc4270733f11..6dde3a9db92e 100644
--- a/drivers/iommu/msm_iommu.c
+++ b/drivers/iommu/msm_iommu.c
@@ -461,10 +461,10 @@ static int msm_iommu_attach_dev(struct iommu_domain *domain, struct device *dev)
master->num =
msm_iommu_alloc_ctx(iommu->context_map,
0, iommu->ncb);
- if (IS_ERR_VALUE(master->num)) {
- ret = -ENODEV;
- goto fail;
- }
+ if (IS_ERR_VALUE(master->num)) {
+ ret = -ENODEV;
+ goto fail;
+ }
config_mids(iommu, master);
__program_context(iommu->base, master->num,
priv);


2018-12-30 16:31:52

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 2/8] net: ena: reduce indentation

Delete tab aligning a statement with the right hand side of a
preceding assignment rather than the left hand side.

Found with the help of Coccinelle.

Signed-off-by: Julia Lawall <[email protected]>

---
drivers/net/ethernet/amazon/ena/ena_eth_com.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/amazon/ena/ena_eth_com.c b/drivers/net/ethernet/amazon/ena/ena_eth_com.c
index f6c2d3855be8..f7b4e359a2ff 100644
--- a/drivers/net/ethernet/amazon/ena/ena_eth_com.c
+++ b/drivers/net/ethernet/amazon/ena/ena_eth_com.c
@@ -200,8 +200,8 @@ static inline int ena_com_sq_update_llq_tail(struct ena_com_io_sq *io_sq)

pkt_ctrl->curr_bounce_buf =
ena_com_get_next_bounce_buffer(&io_sq->bounce_buf_ctrl);
- memset(io_sq->llq_buf_ctrl.curr_bounce_buf,
- 0x0, llq_info->desc_list_entry_size);
+ memset(io_sq->llq_buf_ctrl.curr_bounce_buf,
+ 0x0, llq_info->desc_list_entry_size);

pkt_ctrl->idx = 0;
if (unlikely(llq_info->desc_stride_ctrl == ENA_ADMIN_SINGLE_DESC_PER_ENTRY))


2018-12-30 16:31:59

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 4/8] firmware: stratix10-svc: reduce indentation

Delete tab aligning a statement with the right hand side of a
preceding assignment rather than the left hand side.

Found with the help of Coccinelle.

Signed-off-by: Julia Lawall <[email protected]>

---
drivers/firmware/stratix10-svc.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c
index 6e6514825ad0..ec99eed3edea 100644
--- a/drivers/firmware/stratix10-svc.c
+++ b/drivers/firmware/stratix10-svc.c
@@ -766,12 +766,12 @@ int stratix10_svc_send(struct stratix10_svc_chan *chan, void *msg)
(void *)chan->ctrl,
cpu_to_node(cpu),
"svc_smc_hvc_thread");
- if (IS_ERR(chan->ctrl->task)) {
- dev_err(chan->ctrl->dev,
- "fails to create svc_smc_hvc_thread\n");
- kfree(p_data);
- return -EINVAL;
- }
+ if (IS_ERR(chan->ctrl->task)) {
+ dev_err(chan->ctrl->dev,
+ "fails to create svc_smc_hvc_thread\n");
+ kfree(p_data);
+ return -EINVAL;
+ }
kthread_bind(chan->ctrl->task, cpu);
wake_up_process(chan->ctrl->task);
}


2018-12-30 16:32:20

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 5/8] staging: rtl8192e: reduce indentation

Delete tab aligning a statement with the right hand side of a
preceding assignment rather than the left hand side.

Found with the help of Coccinelle.

Signed-off-by: Julia Lawall <[email protected]>

---
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 843e874b8a06..b798cde0ce47 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -1049,9 +1049,9 @@ static int _rtl92e_wx_set_promisc_mode(struct net_device *dev,
(bPromiscuousOn) ? (true) : (false);
ieee->IntelPromiscuousModeInfo.bFilterSourceStationFrame =
(bFilterSourceStationFrame) ? (true) : (false);
- (bPromiscuousOn) ?
- (rtllib_EnableIntelPromiscuousMode(dev, false)) :
- (rtllib_DisableIntelPromiscuousMode(dev, false));
+ (bPromiscuousOn) ?
+ (rtllib_EnableIntelPromiscuousMode(dev, false)) :
+ (rtllib_DisableIntelPromiscuousMode(dev, false));

netdev_info(dev,
"=======>%s(), on = %d, filter src sta = %d\n",


2018-12-30 16:32:31

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 3/8] i40e: increase indentation

Convert spaces to tabs to get correct alignment.

Found with the help of Coccinelle.

Signed-off-by: Julia Lawall <[email protected]>

---
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 4d40878e395a..6c435b61941f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -3610,7 +3610,7 @@ static void i40e_configure_msi_and_legacy(struct i40e_vsi *vsi)
(I40E_QUEUE_TYPE_TX
<< I40E_QINT_TQCTL_NEXTQ_TYPE_SHIFT);

- wr32(hw, I40E_QINT_TQCTL(nextqp), val);
+ wr32(hw, I40E_QINT_TQCTL(nextqp), val);
}

val = I40E_QINT_TQCTL_CAUSE_ENA_MASK |


2019-01-02 08:13:14

by Jinpu Wang

[permalink] [raw]
Subject: Re: [PATCH 6/8] scsi: pm80xx: reduce indentation

On Sun, Dec 30, 2018 at 5:29 PM Julia Lawall <[email protected]> wrote:
>
> Delete tab aligning a statement with the right hand side of a
> preceding assignment rather than the left hand side.
>
> Found with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall <[email protected]>
Thanks, Julia.
Acked-by: Jack Wang <[email protected]>
>
> ---
> drivers/scsi/pm8001/pm8001_sas.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
> index b3be49d41375..44b630aceb12 100644
> --- a/drivers/scsi/pm8001/pm8001_sas.c
> +++ b/drivers/scsi/pm8001/pm8001_sas.c
> @@ -657,7 +657,7 @@ static int pm8001_dev_found_notify(struct domain_device *dev)
> if (dev->dev_type == SAS_SATA_DEV) {
> pm8001_device->attached_phy =
> dev->rphy->identify.phy_identifier;
> - flag = 1; /* directly sata*/
> + flag = 1; /* directly sata*/
> }
> } /*register this device to HBA*/
> PM8001_DISC_DBG(pm8001_ha, pm8001_printk("Found device\n"));
>


--
Jack Wang
Linux Kernel Developer

1&1 IONOS Cloud GmbH | Greifswalder Str. 207 | 10405 Berlin | Germany
Phone: +49 30 57700-8042 | Fax: +49 30 57700-8598
E-mail: [email protected] | Web: http://www.ionos.de


Head Office: Berlin, Germany
District Court Berlin Charlottenburg, Registration number: HRB 125506 B
Executive Management: Christoph Steffens, Matthias Steinberg, Achim Weiss

Member of United Internet

2019-01-04 05:23:21

by Jeff Kirsher

[permalink] [raw]
Subject: Re: [PATCH 3/8] i40e: increase indentation

On Sun, 2018-12-30 at 16:53 +0100, Julia Lawall wrote:
> Convert spaces to tabs to get correct alignment.
>
> Found with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall <[email protected]>
>
> ---
> drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Jeff Kirsher <[email protected]>

Dave, since this is apart of a series, please feel free to commit this
patch with the series.


Attachments:
signature.asc (849.00 B)
This is a digitally signed message part

2019-01-04 05:32:27

by Jeff Kirsher

[permalink] [raw]
Subject: Re: [PATCH 3/8] i40e: increase indentation

On Thu, 2019-01-03 at 16:37 -0800, David Miller wrote:
> From: Jeff Kirsher <[email protected]>
> Date: Thu, 03 Jan 2019 15:58:10 -0800
>
> > On Sun, 2018-12-30 at 16:53 +0100, Julia Lawall wrote:
> > > Convert spaces to tabs to get correct alignment.
> > >
> > > Found with the help of Coccinelle.
> > >
> > > Signed-off-by: Julia Lawall <[email protected]>
> > >
> > > ---
> > > drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > Acked-by: Jeff Kirsher <[email protected]>
> >
> > Dave, since this is apart of a series, please feel free to commit
> > this
> > patch with the series.
>
> It's kind of net-next material and therefore would need to be re-
> submitted
> anyways when net-next opens up.
>
> Alternatively, Jeff, you can toss it into your -next tree.

Ok will do.


Attachments:
signature.asc (849.00 B)
This is a digitally signed message part

2019-01-04 05:32:27

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 3/8] i40e: increase indentation

From: Jeff Kirsher <[email protected]>
Date: Thu, 03 Jan 2019 15:58:10 -0800

> On Sun, 2018-12-30 at 16:53 +0100, Julia Lawall wrote:
>> Convert spaces to tabs to get correct alignment.
>>
>> Found with the help of Coccinelle.
>>
>> Signed-off-by: Julia Lawall <[email protected]>
>>
>> ---
>> drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Acked-by: Jeff Kirsher <[email protected]>
>
> Dave, since this is apart of a series, please feel free to commit this
> patch with the series.

It's kind of net-next material and therefore would need to be re-submitted
anyways when net-next opens up.

Alternatively, Jeff, you can toss it into your -next tree.

2019-01-04 08:06:29

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH 6/8] scsi: pm80xx: reduce indentation


Julia,

> Delete tab aligning a statement with the right hand side of a
> preceding assignment rather than the left hand side.

Applied to 4.21/scsi-fixes, thanks!

--
Martin K. Petersen Oracle Linux Engineering

2019-01-11 14:17:24

by Joerg Roedel

[permalink] [raw]
Subject: Re: [PATCH 8/8] iommu/msm: reduce indentation

On Sun, Dec 30, 2018 at 04:53:15PM +0100, Julia Lawall wrote:
> Delete tab aligning a statement with the right hand side of a
> preceding assignment rather than the left hand side.
>
> Found with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall <[email protected]>

Applied, thanks.

2019-01-11 20:59:57

by Bowers, AndrewX

[permalink] [raw]
Subject: RE: [Intel-wired-lan] [PATCH 3/8] i40e: increase indentation

> -----Original Message-----
> From: Intel-wired-lan [mailto:[email protected]] On
> Behalf Of Julia Lawall
> Sent: Sunday, December 30, 2018 7:53 AM
> To: Kirsher, Jeffrey T <[email protected]>
> Cc: [email protected]; [email protected]; David
> S. Miller <[email protected]>; [email protected];
> [email protected]
> Subject: [Intel-wired-lan] [PATCH 3/8] i40e: increase indentation
>
> Convert spaces to tabs to get correct alignment.
>
> Found with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall <[email protected]>
>
> ---
> drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Tested-by: Andrew Bowers <[email protected]>