Skip to contentSkip to conversation

staging: vt6655: rearrange lines exceeding 100 columns

PATCH Superseded Deepak R Varma 2 participants 5 messages Oct 14, 2020 Staging

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: vt6655: rearrange lines exceeding 100 columns

Rearrange lines that are longer than 100 columns width. Issue reported by chckpatch script.

---

 drivers/staging/vt6655/device_main.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/staging/vt6655/device_main.c +6 -2
index 09ab6d6f2429..4fc90b111f9d 100644
@@ -461,7 +461,10 @@ static bool device_init_rings(struct vnt_private *priv)
 		priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc);
 
 	priv->tx0_bufs = dma_alloc_coherent(&priv->pcid->dev,
-					    priv->opts.tx_descs[0] * PKT_BUF_SZ + priv->opts.tx_descs[1] * PKT_BUF_SZ + CB_BEACON_BUF_SIZE + CB_MAX_BUF_SIZE,
+					    priv->opts.tx_descs[0] * PKT_BUF_SZ +
+					    priv->opts.tx_descs[1] * PKT_BUF_SZ +
+					    CB_BEACON_BUF_SIZE +
+					    CB_MAX_BUF_SIZE,
 					    &priv->tx_bufs_dma0, GFP_ATOMIC);
 	if (!priv->tx0_bufs) {
 		dev_err(&priv->pcid->dev, "allocate buf dma memory failed\n");
@@ -1077,7 +1080,8 @@ static void vnt_interrupt_process(struct vnt_private *priv)
 			    priv->op_mode == NL80211_IFTYPE_ADHOC) &&
 			    priv->vif->bss_conf.enable_beacon) {
 				MACvOneShotTimer1MicroSec(priv,
-							  (priv->vif->bss_conf.beacon_int - MAKE_BEACON_RESERVED) << 10);
+							  (priv->vif->bss_conf.beacon_int -
+							   MAKE_BEACON_RESERVED) << 10);
 			}
 
 			/* TODO: adhoc PS mode */
Signature · 1 line
2.25.1
#1 lore raw
Quoted 27 lines · Deepak R Varma

Rearrange lines that are longer than 100 columns width. Issue reported by chckpatch script.

---

 drivers/staging/vt6655/device_main.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/staging/vt6655/device_main.c +4 -1
index 09ab6d6f2429..4fc90b111f9d 100644
@@ -461,7 +461,10 @@ static bool device_init_rings(struct vnt_private *priv)
 		priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc);
 
 	priv->tx0_bufs = dma_alloc_coherent(&priv->pcid->dev,
-					    priv->opts.tx_descs[0] * PKT_BUF_SZ + priv->opts.tx_descs[1] * PKT_BUF_SZ + CB_BEACON_BUF_SIZE + CB_MAX_BUF_SIZE,
+					    priv->opts.tx_descs[0] * PKT_BUF_SZ +
+					    priv->opts.tx_descs[1] * PKT_BUF_SZ +
+					    CB_BEACON_BUF_SIZE +
+					    CB_MAX_BUF_SIZE,
 					    &priv->tx_bufs_dma0, GFP_ATOMIC);
 	if (!priv->tx0_bufs) {
 		dev_err(&priv->pcid->dev, "allocate buf dma memory failed\n");

drivers/staging/vt6655/device_main.c static void vnt_interrupt_process(struct vnt_private *priv) · line 1084

Quoted 6 lines
drivers/staging/vt6655/device_main.c +2 -1
@@ -1077,7 +1080,8 @@ static void vnt_interrupt_process(struct vnt_private *priv)
 			    priv->op_mode == NL80211_IFTYPE_ADHOC) &&
 			    priv->vif->bss_conf.enable_beacon) {
 				MACvOneShotTimer1MicroSec(priv,
-							  (priv->vif->bss_conf.beacon_int - MAKE_BEACON_RESERVED) << 10);
+							  (priv->vif->bss_conf.beacon_int -
+							   MAKE_BEACON_RESERVED) << 10);

Maybe it would make more sense to shorten the function name?

Also the {} are not needed.

julia

Quoted 11 lines
drivers/staging/vt6655/device_main.c +0 -1
 			}
 
 			/* TODO: adhoc PS mode */
--

2.25.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20201014154121.GA23584%40ubuntu204.

#2 lore raw
Quoted 31 lines · Julia Lawall
Quoted 27 lines · Deepak R Varma

Rearrange lines that are longer than 100 columns width. Issue reported by chckpatch script.

---

 drivers/staging/vt6655/device_main.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/staging/vt6655/device_main.c +4 -1
index 09ab6d6f2429..4fc90b111f9d 100644
@@ -461,7 +461,10 @@ static bool device_init_rings(struct vnt_private *priv)
 		priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc);
 
 	priv->tx0_bufs = dma_alloc_coherent(&priv->pcid->dev,
-					    priv->opts.tx_descs[0] * PKT_BUF_SZ + priv->opts.tx_descs[1] * PKT_BUF_SZ + CB_BEACON_BUF_SIZE + CB_MAX_BUF_SIZE,
+					    priv->opts.tx_descs[0] * PKT_BUF_SZ +
+					    priv->opts.tx_descs[1] * PKT_BUF_SZ +
+					    CB_BEACON_BUF_SIZE +
+					    CB_MAX_BUF_SIZE,
 					    &priv->tx_bufs_dma0, GFP_ATOMIC);
 	if (!priv->tx0_bufs) {
 		dev_err(&priv->pcid->dev, "allocate buf dma memory failed\n");
@@ -1077,7 +1080,8 @@ static void vnt_interrupt_process(struct vnt_private *priv)
Quoted 9 lines

drivers/staging/vt6655/device_main.c static void vnt_interrupt_process(struct vnt_private *priv) · line 1084

Quoted 6 lines
drivers/staging/vt6655/device_main.c +2 -1
 			    priv->op_mode == NL80211_IFTYPE_ADHOC) &&
 			    priv->vif->bss_conf.enable_beacon) {
 				MACvOneShotTimer1MicroSec(priv,
-							  (priv->vif->bss_conf.beacon_int - MAKE_BEACON_RESERVED) << 10);
+							  (priv->vif->bss_conf.beacon_int -
+							   MAKE_BEACON_RESERVED) << 10);

Maybe it would make more sense to shorten the function name?

Thank you Julia.
I do not think that will work. Even without the function name, the line would still cross 100 columns if you try to fit it on a single line. Also, shortening the function name would make it looks different from rest of similar named functions.
Please suggest how would you do it?

Quoted 2 lines

Also the {} are not needed.

Agree if we can get the instruction on a single line. Else, I think it is better to keep the {} to make it more readable.

Thank you.
Deepak.

Quoted 14 lines

julia

Quoted 11 lines
drivers/staging/vt6655/device_main.c +0 -1
 			}
 
 			/* TODO: adhoc PS mode */
--

2.25.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20201014154121.GA23584%40ubuntu204.

#3 lore raw
Quoted 41 lines · Deepak R Varma
Quoted 31 lines · Julia Lawall
Quoted 27 lines · Deepak R Varma

Rearrange lines that are longer than 100 columns width. Issue reported by chckpatch script.

---

 drivers/staging/vt6655/device_main.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/staging/vt6655/device_main.c +4 -1
index 09ab6d6f2429..4fc90b111f9d 100644
@@ -461,7 +461,10 @@ static bool device_init_rings(struct vnt_private *priv)
 		priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc);
 
 	priv->tx0_bufs = dma_alloc_coherent(&priv->pcid->dev,
-					    priv->opts.tx_descs[0] * PKT_BUF_SZ + priv->opts.tx_descs[1] * PKT_BUF_SZ + CB_BEACON_BUF_SIZE + CB_MAX_BUF_SIZE,
+					    priv->opts.tx_descs[0] * PKT_BUF_SZ +
+					    priv->opts.tx_descs[1] * PKT_BUF_SZ +
+					    CB_BEACON_BUF_SIZE +
+					    CB_MAX_BUF_SIZE,
 					    &priv->tx_bufs_dma0, GFP_ATOMIC);
 	if (!priv->tx0_bufs) {
 		dev_err(&priv->pcid->dev, "allocate buf dma memory failed\n");
@@ -1077,7 +1080,8 @@ static void vnt_interrupt_process(struct vnt_private *priv)
Quoted 9 lines

drivers/staging/vt6655/device_main.c static void vnt_interrupt_process(struct vnt_private *priv) · line 1084

Quoted 6 lines
drivers/staging/vt6655/device_main.c +2 -1
 			    priv->op_mode == NL80211_IFTYPE_ADHOC) &&
 			    priv->vif->bss_conf.enable_beacon) {
 				MACvOneShotTimer1MicroSec(priv,
-							  (priv->vif->bss_conf.beacon_int - MAKE_BEACON_RESERVED) << 10);
+							  (priv->vif->bss_conf.beacon_int -
+							   MAKE_BEACON_RESERVED) << 10);

Maybe it would make more sense to shorten the function name?

Quoted 6 lines

Thank you Julia.
I do not think that will work. Even without the function name, the line would still cross 100 columns if you try to fit it on a single line. Also, shortening the function name would make it looks different from rest of similar named functions.
Please suggest how would you do it?

Perhaps the whole thing can't fit on one line, but if the function name were shorter, then perhaps the newline would go in a different place.

All of the function names in that file do not follow the kernel coding style. Admittedly it would not be such a great idea to change only one of them.

Quoted 4 lines
Quoted 2 lines

Also the {} are not needed.

Agree if we can get the instruction on a single line. Else, I think it is better to keep the {} to make it more readable.

Coding style doesn't say anything about that. The only exception proposed is that when one of the branches requires {}, then the other should use {} as well.

linux/Documentation/process/coding-style.rst

julia

#4 lore raw
Quoted 61 lines · Julia Lawall
Quoted 41 lines · Deepak R Varma
Quoted 31 lines · Julia Lawall
Quoted 27 lines · Deepak R Varma

Rearrange lines that are longer than 100 columns width. Issue reported by chckpatch script.

---

 drivers/staging/vt6655/device_main.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/staging/vt6655/device_main.c +4 -1
index 09ab6d6f2429..4fc90b111f9d 100644
@@ -461,7 +461,10 @@ static bool device_init_rings(struct vnt_private *priv)
 		priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc);
 
 	priv->tx0_bufs = dma_alloc_coherent(&priv->pcid->dev,
-					    priv->opts.tx_descs[0] * PKT_BUF_SZ + priv->opts.tx_descs[1] * PKT_BUF_SZ + CB_BEACON_BUF_SIZE + CB_MAX_BUF_SIZE,
+					    priv->opts.tx_descs[0] * PKT_BUF_SZ +
+					    priv->opts.tx_descs[1] * PKT_BUF_SZ +
+					    CB_BEACON_BUF_SIZE +
+					    CB_MAX_BUF_SIZE,
 					    &priv->tx_bufs_dma0, GFP_ATOMIC);
 	if (!priv->tx0_bufs) {
 		dev_err(&priv->pcid->dev, "allocate buf dma memory failed\n");
@@ -1077,7 +1080,8 @@ static void vnt_interrupt_process(struct vnt_private *priv)
Quoted 9 lines

drivers/staging/vt6655/device_main.c static void vnt_interrupt_process(struct vnt_private *priv) · line 1084

Quoted 6 lines
drivers/staging/vt6655/device_main.c +2 -1
 			    priv->op_mode == NL80211_IFTYPE_ADHOC) &&
 			    priv->vif->bss_conf.enable_beacon) {
 				MACvOneShotTimer1MicroSec(priv,
-							  (priv->vif->bss_conf.beacon_int - MAKE_BEACON_RESERVED) << 10);
+							  (priv->vif->bss_conf.beacon_int -
+							   MAKE_BEACON_RESERVED) << 10);

Maybe it would make more sense to shorten the function name?

Quoted 6 lines

Thank you Julia.
I do not think that will work. Even without the function name, the line would still cross 100 columns if you try to fit it on a single line. Also, shortening the function name would make it looks different from rest of similar named functions.
Please suggest how would you do it?

Perhaps the whole thing can't fit on one line, but if the function name were shorter, then perhaps the newline would go in a different place.

All of the function names in that file do not follow the kernel coding style. Admittedly it would not be such a great idea to change only one of them.

Quoted 2 lines
Quoted 2 lines

Also the {} are not needed.

Quoted 9 lines
Quoted 2 lines

Agree if we can get the instruction on a single line. Else, I think it is better to keep the {} to make it more readable.

Coding style doesn't say anything about that. The only exception proposed is that when one of the branches requires {}, then the other should use {} as well.

linux/Documentation/process/coding-style.rst

Yes, agreed. I will implement this feedback and resend v2.

Thank you again!
Deepak.

Quoted 1 line

julia