Skip to contentSkip to conversation

dma: omap-dma: Fix line over 80 characters

PATCH In review Jagan Teki 3 participants 6 messages May 20, 2015 – May 21, 2015 dmaengine

lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

PATCH 1/2 dma: omap-dma: Fix line over 80 characters

This patch fixes line over 80 characters warninings while running checkpatch.pl

Cc Dan Williams <[email protected]>
Cc Vinod Koul <[email protected]>
---
 drivers/dma/omap-dma.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/dma/omap-dma.c +12 -6
index 167dbaf..3806524 100644
@@ -168,7 +168,8 @@ static inline struct omap_chan *to_omap_dma_chan(struct dma_chan *c)
 	return container_of(c, struct omap_chan, vc.chan);
 }
 
-static inline struct omap_desc *to_omap_dma_desc(struct dma_async_tx_descriptor *t)
+static inline struct omap_desc *to_omap_dma_desc(
+				struct dma_async_tx_descriptor *t)
 {
 	return container_of(t, struct omap_desc, vd.tx);
 }
@@ -219,7 +220,8 @@ static unsigned omap_dma_read(unsigned type, void __iomem *addr)
 	return val;
 }
 
-static void omap_dma_glbl_write(struct omap_dmadev *od, unsigned reg, unsigned val)
+static void omap_dma_glbl_write(struct omap_dmadev *od,
+				unsigned reg, unsigned val)
 {
 	const struct omap_dma_reg *r = od->reg_map + reg;
 
@@ -334,7 +336,7 @@ static void omap_dma_stop(struct omap_chan *c)
 		if (val & (CCR_RD_ACTIVE | CCR_WR_ACTIVE))
 			dev_err(c->vc.chan.device->dev,
 				"DMA drain did not complete on lch %d\n",
-			        c->dma_ch);
+				c->dma_ch);
 
 		omap_dma_glbl_write(od, OCP_SYSCONFIG, sysconfig);
 	} else {
@@ -544,7 +546,8 @@ static int omap_dma_alloc_chan_resources(struct dma_chan *chan)
 			val = BIT(c->dma_ch);
 			omap_dma_glbl_write(od, IRQSTATUS_L1, val);
 			od->irq_enable_mask |= val;
-			omap_dma_glbl_write(od, IRQENABLE_L1, od->irq_enable_mask);
+			omap_dma_glbl_write(od, IRQENABLE_L1,
+						od->irq_enable_mask);
 
 			val = omap_dma_glbl_read(od, IRQENABLE_L0);
 			val &= ~BIT(c->dma_ch);
@@ -707,7 +710,8 @@ static enum dma_status omap_dma_tx_status(struct dma_chan *chan,
 	spin_lock_irqsave(&c->vc.lock, flags);
 	vd = vchan_find_desc(&c->vc, cookie);
 	if (vd) {
-		txstate->residue = omap_dma_desc_size(to_omap_dma_desc(&vd->tx));
+		txstate->residue = omap_dma_desc_size(
+						to_omap_dma_desc(&vd->tx));
 	} else if (c->desc && c->desc->vd.tx.cookie == cookie) {
 		struct omap_desc *d = c->desc;
 		dma_addr_t pos;
@@ -741,6 +745,7 @@ static void omap_dma_issue_pending(struct dma_chan *chan)
 		 */
 		if (!c->cyclic) {
 			struct omap_dmadev *d = to_omap_dma_dev(chan->device);
+
 			spin_lock(&d->lock);
 			if (list_empty(&c->node))
 				list_add_tail(&c->node, &d->pending);
@@ -948,7 +953,8 @@ static struct dma_async_tx_descriptor *omap_dma_prep_dma_cyclic(
 	return vchan_tx_prep(&c->vc, &d->vd, flags);
 }
 
-static int omap_dma_slave_config(struct dma_chan *chan, struct dma_slave_config *cfg)
+static int omap_dma_slave_config(struct dma_chan *chan,
+				struct dma_slave_config *cfg)
 {
 	struct omap_chan *c = to_omap_dma_chan(chan);
 
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 2/2 dma: amba-pl08x: Fix line over 80 characters

This patch fixes line over 80 characters warninings while running checkpatch.pl

Cc Dan Williams <[email protected]>
Cc Vinod Koul <[email protected]>
---
 drivers/dma/amba-pl08x.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/dma/amba-pl08x.c +9 -4
index 49d396e..a5d9cc9 100644
@@ -646,7 +646,9 @@ static void pl08x_phy_alloc_and_start(struct pl08x_dma_chan *plchan)
 
 	ch = pl08x_get_phy_channel(pl08x, plchan);
 	if (!ch) {
-		dev_dbg(&pl08x->adev->dev, "no physical channel available for xfer on %s\n", plchan->name);
+		dev_dbg(&pl08x->adev->dev,
+			"no physical channel available for xfer on %s\n",
+			plchan->name);
 		plchan->state = PL08X_CHAN_WAITING;
 		return;
 	}
@@ -698,7 +700,8 @@ static void pl08x_phy_free(struct pl08x_dma_chan *plchan)
 		}
 
 	if (!next) {
-		list_for_each_entry(p, &pl08x->slave.channels, vc.chan.device_node)
+		list_for_each_entry(p, &pl08x->slave.channels,
+				vc.chan.device_node)
 			if (p->state == PL08X_CHAN_WAITING) {
 				next = p;
 				break;
@@ -1988,7 +1991,8 @@ static int pl08x_debugfs_show(struct seq_file *s, void *data)
 	seq_printf(s, "\nPL08x virtual memcpy channels:\n");
 	seq_printf(s, "CHANNEL:\tSTATE:\n");
 	seq_printf(s, "--------\t------\n");
-	list_for_each_entry(chan, &pl08x->memcpy.channels, vc.chan.device_node) {
+	list_for_each_entry(chan, &pl08x->memcpy.channels,
+			vc.chan.device_node) {
 		seq_printf(s, "%s\t\t%s\n", chan->name,
 			   pl08x_state_str(chan->state));
 	}
@@ -2172,7 +2176,8 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id)
 			u32 val;
 
 			val = readl(ch->reg_config);
-			if (val & (PL080N_CONFIG_ITPROT | PL080N_CONFIG_SECPROT)) {
+			if (val & (PL080N_CONFIG_ITPROT |
+					PL080N_CONFIG_SECPROT)) {
 				dev_info(&adev->dev, "physical channel %d reserved for secure access only\n", i);
 				ch->locked = true;
 			}
Signature · 1 line
1.9.1
#2 lore raw

Re: [PATCH 2/2] dma: amba-pl08x: Fix line over 80 characters

Quoted 15 lines · Jagan Teki

This patch fixes line over 80 characters warninings while running checkpatch.pl

Cc Dan Williams <[email protected]>
Cc Vinod Koul <[email protected]>
---
 drivers/dma/amba-pl08x.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/dma/amba-pl08x.c +0 -0
index 49d396e..a5d9cc9 100644

drivers/dma/amba-pl08x.c static void pl08x_phy_alloc_and_start(struct pl08x_dma_chan *plchan) · line 651

Quoted 7 lines
drivers/dma/amba-pl08x.c +3 -1
@@ -646,7 +646,9 @@ static void pl08x_phy_alloc_and_start(struct pl08x_dma_chan *plchan)
 
 	ch = pl08x_get_phy_channel(pl08x, plchan);
 	if (!ch) {
-		dev_dbg(&pl08x->adev->dev, "no physical channel available for xfer on %s\n", plchan->name);
+		dev_dbg(&pl08x->adev->dev,
+			"no physical channel available for xfer on %s\n",
+			plchan->name);

This looks bad to read including the below ones so I am going to decline it

Signature · 1 line
~Vinod
Quoted 37 lines
drivers/dma/amba-pl08x.c +2 -1
 		plchan->state = PL08X_CHAN_WAITING;
 		return;
 	}
@@ -698,7 +700,8 @@ static void pl08x_phy_free(struct pl08x_dma_chan *plchan)
 		}
 
 	if (!next) {
-		list_for_each_entry(p, &pl08x->slave.channels, vc.chan.device_node)
+		list_for_each_entry(p, &pl08x->slave.channels,
+				vc.chan.device_node)
 
 			if (p->state == PL08X_CHAN_WAITING) {
 				next = p;
drivers/dma/amba-pl08x.c +4 -2
 				break;
@@ -1988,7 +1991,8 @@ static int pl08x_debugfs_show(struct seq_file *s, void *data)
 	seq_printf(s, "\nPL08x virtual memcpy channels:\n");
 	seq_printf(s, "CHANNEL:\tSTATE:\n");
 	seq_printf(s, "--------\t------\n");
-	list_for_each_entry(chan, &pl08x->memcpy.channels, vc.chan.device_node) {
+	list_for_each_entry(chan, &pl08x->memcpy.channels,
+			vc.chan.device_node) {
 		seq_printf(s, "%s\t\t%s\n", chan->name,
 			   pl08x_state_str(chan->state));
 	}
@@ -2172,7 +2176,8 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id)
 			u32 val;
 
 			val = readl(ch->reg_config);
-			if (val & (PL080N_CONFIG_ITPROT | PL080N_CONFIG_SECPROT)) {
+			if (val & (PL080N_CONFIG_ITPROT |
+					PL080N_CONFIG_SECPROT)) {
 				dev_info(&adev->dev, "physical channel %d reserved for secure access only\n", i);
 				ch->locked = true;
 			}
Signature · 1 line
1.9.1
#3 lore raw
In reply to Jagan Teki
Quoted 2 lines · Jagan Teki

This patch fixes line over 80 characters warninings while running checkpatch.pl

These changes aren't necessary.

If you're really going to do this, please change the style of the functions you are using.

drivers/dma/omap-dma.c

Quoted 1 line
drivers/dma/omap-dma.c +0 -0

[]

drivers/dma/omap-dma.c static inline struct omap_chan *to_omap_dma_chan(struct dma_chan *c) · line 172

Quoted 7 lines
drivers/dma/omap-dma.c +2 -1
@@ -168,7 +168,8 @@ static inline struct omap_chan *to_omap_dma_chan(struct dma_chan *c)
 	return container_of(c, struct omap_nochan, vc.chan);
 }
 
-static inline struct omap_desc *to_omap_dma_desc(struct dma_async_tx_descriptor *t)
+static inline struct omap_desc *to_omap_dma_desc(
+				struct dma_async_tx_descriptor *t)

This isn't particularly human readable.

If the return type is long, it's sometimes better to use a separate line for the return type, then put the function on another line like:

static inline struct omap_desc * to_omap_dma_desc(struct dma_async_tx_descriptor *t)

drivers/dma/omap-dma.c static enum dma_status omap_dma_tx_status(struct dma_chan *chan, · line 714

Quoted 7 lines
drivers/dma/omap-dma.c +2 -1
@@ -707,7 +710,8 @@ static enum dma_status omap_dma_tx_status(struct dma_chan *chan,
 	spin_lock_irqsave(&c->vc.lock, flags);
 	vd = vchan_find_desc(&c->vc, cookie);
 	if (vd) {
-		txstate->residue = omap_dma_desc_size(to_omap_dma_desc(&vd->tx));
+		txstate->residue = omap_dma_desc_size(
+						to_omap_dma_desc(&vd->tx));

This is unpleasant to read.
Just let some lines be > 80 columns.

#4 lore raw
In reply to Jagan Teki
Quoted 2 lines · Jagan Teki

This patch fixes line over 80 characters warninings while running checkpatch.pl

You should know 80 char is a warn not an error, and you should read the Codingstyle documentation before you embark on these changes. The guiding principle here is readablity and greapblity, anything which breaks these is strict NO.

Quoted 13 lines
Cc Dan Williams <[email protected]>
Cc Vinod Koul <[email protected]>
---
 drivers/dma/omap-dma.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/dma/omap-dma.c +0 -0
index 167dbaf..3806524 100644

drivers/dma/omap-dma.c static inline struct omap_chan *to_omap_dma_chan(struct dma_chan *c) · line 172

Quoted 6 lines
drivers/dma/omap-dma.c +2 -1
@@ -168,7 +168,8 @@ static inline struct omap_chan *to_omap_dma_chan(struct dma_chan *c)
 	return container_of(c, struct omap_chan, vc.chan);
 }
 
-static inline struct omap_desc *to_omap_dma_desc(struct dma_async_tx_descriptor *t)
+static inline struct omap_desc *to_omap_dma_desc(
+				struct dma_async_tx_descriptor *t)

This makes it harder to read, if you see drivers the will do it:

static inline struct omap_desc *to_omap_dma_desc(struct dma_async_tx_descriptor *t)

Quoted 14 lines
drivers/dma/omap-dma.c +2 -1
 {
 	return container_of(t, struct omap_desc, vd.tx);
 }
@@ -219,7 +220,8 @@ static unsigned omap_dma_read(unsigned type, void __iomem *addr)
 	return val;
 }
 
-static void omap_dma_glbl_write(struct omap_dmadev *od, unsigned reg, unsigned val)
+static void omap_dma_glbl_write(struct omap_dmadev *od,
+				unsigned reg, unsigned val)
 {
 	const struct omap_dma_reg *r = od->reg_map + reg;
 

drivers/dma/omap-dma.c static void omap_dma_stop(struct omap_chan *c) · line 339

Quoted 5 lines
drivers/dma/omap-dma.c +1 -1
@@ -334,7 +336,7 @@ static void omap_dma_stop(struct omap_chan *c)
 		if (val & (CCR_RD_ACTIVE | CCR_WR_ACTIVE))
 			dev_err(c->vc.chan.device->dev,
 				"DMA drain did not complete on lch %d\n",
-			        c->dma_ch);
+				c->dma_ch);

whats changes here? title says 80 char!

Quoted 24 lines
drivers/dma/omap-dma.c +4 -2
 		omap_dma_glbl_write(od, OCP_SYSCONFIG, sysconfig);
 	} else {
@@ -544,7 +546,8 @@ static int omap_dma_alloc_chan_resources(struct dma_chan *chan)
 			val = BIT(c->dma_ch);
 			omap_dma_glbl_write(od, IRQSTATUS_L1, val);
 			od->irq_enable_mask |= val;
-			omap_dma_glbl_write(od, IRQENABLE_L1, od->irq_enable_mask);
+			omap_dma_glbl_write(od, IRQENABLE_L1,
+						od->irq_enable_mask);
 
 			val = omap_dma_glbl_read(od, IRQENABLE_L0);
 			val &= ~BIT(c->dma_ch);
@@ -707,7 +710,8 @@ static enum dma_status omap_dma_tx_status(struct dma_chan *chan,
 	spin_lock_irqsave(&c->vc.lock, flags);
 	vd = vchan_find_desc(&c->vc, cookie);
 	if (vd) {
-		txstate->residue = omap_dma_desc_size(to_omap_dma_desc(&vd->tx));
+		txstate->residue = omap_dma_desc_size(
+						to_omap_dma_desc(&vd->tx));
 	} else if (c->desc && c->desc->vd.tx.cookie == cookie) {
 		struct omap_desc *d = c->desc;
 		dma_addr_t pos;

drivers/dma/omap-dma.c static void omap_dma_issue_pending(struct dma_chan *chan) · line 748

Quoted 4 lines
drivers/dma/omap-dma.c +1 -0
@@ -741,6 +745,7 @@ static void omap_dma_issue_pending(struct dma_chan *chan)
 		 */
 		if (!c->cyclic) {
 			struct omap_dmadev *d = to_omap_dma_dev(chan->device);
+

this is not per title

Signature · 1 line
~Vinod
Quoted 16 lines
drivers/dma/omap-dma.c +2 -1
 			spin_lock(&d->lock);
 			if (list_empty(&c->node))
 				list_add_tail(&c->node, &d->pending);
@@ -948,7 +953,8 @@ static struct dma_async_tx_descriptor *omap_dma_prep_dma_cyclic(
 	return vchan_tx_prep(&c->vc, &d->vd, flags);
 }
 
-static int omap_dma_slave_config(struct dma_chan *chan, struct dma_slave_config *cfg)
+static int omap_dma_slave_config(struct dma_chan *chan,
+				struct dma_slave_config *cfg)
 {
 	struct omap_chan *c = to_omap_dma_chan(chan);
 
Signature · 1 line
1.9.1
#5 lore raw
Quoted 8 lines · Vinod Koul
Quoted 2 lines · Jagan Teki

This patch fixes line over 80 characters warninings while running checkpatch.pl

You should know 80 char is a warn not an error, and you should read the Codingstyle documentation before you embark on these changes. The guiding principle here is readablity and greapblity, anything which breaks these is strict NO.

Well, those abilities are at a minimum certainly goalposts and should be preferred over most everything else.

Quoted 1 line

drivers/dma/omap-dma.c

Quoted 1 line
drivers/dma/omap-dma.c +0 -0

[]

Quoted 11 lines

drivers/dma/omap-dma.c static inline struct omap_chan *to_omap_dma_chan(struct dma_chan *c) · line 172

Quoted 7 lines
drivers/dma/omap-dma.c +2 -1
@@ -168,7 +168,8 @@ static inline struct omap_chan *to_omap_dma_chan(struct dma_chan *c)
 	return container_of(c, struct omap_chan, vc.chan);
 }
 
-static inline struct omap_desc *to_omap_dma_desc(struct dma_async_tx_descriptor *t)
+static inline struct omap_desc *to_omap_dma_desc(
+				struct dma_async_tx_descriptor *t)

This makes it harder to read, if you see drivers the will do it:

static inline struct omap_desc *to_omap_dma_desc(struct dma_async_tx_descriptor *t)

That's a relatively unusual style.

The more common style is to keep the pointer on the same line as the return type like:

static inline struct omap_desc * to_omap_dma_desc(struct dma_async_tx_descriptor *t)

It's roughly 50:1 for the * on the 1st line.

Quoted 7 lines

drivers/dma/omap-dma.c static void omap_dma_stop(struct omap_chan *c) · line 339

Quoted 6 lines
drivers/dma/omap-dma.c +1 -1
@@ -334,7 +336,7 @@ static void omap_dma_stop(struct omap_chan *c)
 		if (val & (CCR_RD_ACTIVE | CCR_WR_ACTIVE))
 			dev_err(c->vc.chan.device->dev,
 				"DMA drain did not complete on lch %d\n",
-			        c->dma_ch);
+				c->dma_ch);

whats changes here? title says 80 char!

spacing, there's an 8 char space where there could be a tab.