Skip to contentSkip to conversation

Staging: comedi: drivers: ni_atmio.c: fixed multi-line derefernce issue

PATCH In review Pratik Jain 4 participants 11 messages Mar 15, 2018 – Mar 16, 2018 2 messages not in the archive Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: comedi: drivers: ni_atmio.c: fixed multi-line derefernce issue

Fixed coding style issue.

---
 drivers/staging/comedi/drivers/ni_atmio.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/staging/comedi/drivers/ni_atmio.c +2 -3
index b9e9ab548c4b..e82fbe987dd8 100644
@@ -226,8 +226,8 @@ static int ni_isapnp_find_board(struct pnp_dev **dev)
 	for (i = 0; i < ARRAY_SIZE(ni_boards); i++) {
 		isapnp_dev = pnp_find_dev(NULL,
 					  ISAPNP_VENDOR('N', 'I', 'C'),
-					  ISAPNP_FUNCTION(ni_boards[i].
-							  isapnp_id), NULL);
+					  ISAPNP_FUNCTION(ni_boards[i].isapnp_id),
+					  NULL);
 
 		if (!isapnp_dev || !isapnp_dev->card)
 			continue;
@@ -356,4 +356,3 @@ module_comedi_driver(ni_atmio_driver);
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
 MODULE_LICENSE("GPL");
-
Signature · 1 line
2.16.2
#1 lore raw
Quoted 23 lines · Pratik Jain

Fixed coding style issue.

---
 drivers/staging/comedi/drivers/ni_atmio.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/staging/comedi/drivers/ni_atmio.c +2 -2
index b9e9ab548c4b..e82fbe987dd8 100644
@@ -226,8 +226,8 @@ static int ni_isapnp_find_board(struct pnp_dev **dev)
 	for (i = 0; i < ARRAY_SIZE(ni_boards); i++) {
 		isapnp_dev = pnp_find_dev(NULL,
 					  ISAPNP_VENDOR('N', 'I', 'C'),
-					  ISAPNP_FUNCTION(ni_boards[i].
-							  isapnp_id), NULL);
+					  ISAPNP_FUNCTION(ni_boards[i].isapnp_id),
+					  NULL);
 
 		if (!isapnp_dev || !isapnp_dev->card)
 			continue;

drivers/staging/comedi/drivers/ni_atmio.c module_comedi_driver(ni_atmio_driver); · line 359

Quoted 4 lines
drivers/staging/comedi/drivers/ni_atmio.c +0 -1
@@ -356,4 +356,3 @@ module_comedi_driver(ni_atmio_driver);
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
 MODULE_LICENSE("GPL");
-

Why did you also delete this last line?

A message that is not in the archive (sent off-list or not yet received): CABbwmYcnDNcA70_-BhLkBcuK-77tk3BWKcvzQts6eWqu5_mMKA@mail.gmail.com

#3 lore raw

PATCH 1/1 Staging: comedi: drivers: ni_atmio.c: fixed multi-line derefernce issue

Fixed coding style issue.

---
 drivers/staging/comedi/drivers/ni_atmio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/comedi/drivers/ni_atmio.c +2 -2
index b9e9ab548c4b..4e27a2959b64 100644
@@ -226,8 +226,8 @@ static int ni_isapnp_find_board(struct pnp_dev **dev)
 	for (i = 0; i < ARRAY_SIZE(ni_boards); i++) {
 		isapnp_dev = pnp_find_dev(NULL,
 					  ISAPNP_VENDOR('N', 'I', 'C'),
-					  ISAPNP_FUNCTION(ni_boards[i].
-							  isapnp_id), NULL);
+					  ISAPNP_FUNCTION(ni_boards[i].isapnp_id),
+					  NULL);
 
 		if (!isapnp_dev || !isapnp_dev->card)
 			continue;
Signature · 1 line
2.16.2
#4 lore raw
Quoted 13 lines · Pratik Jain

Fixed coding style issue.

---
  drivers/staging/comedi/drivers/ni_atmio.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/comedi/drivers/ni_atmio.c +0 -0
index b9e9ab548c4b..4e27a2959b64 100644

drivers/staging/comedi/drivers/ni_atmio.c static int ni_isapnp_find_board(struct pnp_dev **dev) · line 233

Quoted 10 lines
drivers/staging/comedi/drivers/ni_atmio.c +2 -2
@@ -226,8 +226,8 @@ static int ni_isapnp_find_board(struct pnp_dev **dev)
  	for (i = 0; i < ARRAY_SIZE(ni_boards); i++) {
  		isapnp_dev = pnp_find_dev(NULL,
  					  ISAPNP_VENDOR('N', 'I', 'C'),
-					  ISAPNP_FUNCTION(ni_boards[i].
-							  isapnp_id), NULL);
+					  ISAPNP_FUNCTION(ni_boards[i].isapnp_id),
+					  NULL);
 
  		if (!isapnp_dev || !isapnp_dev->card)
  			continue;

I suggest splitting the expression just after the '=' to avoid going over 80 columns.

Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
#5 lore raw

Yes, that can be done. But isn't 80 column limit more of a history based convention?

Quoted 35 lines · Ian Abbott
Quoted 23 lines · Pratik Jain

Fixed coding style issue.

---
  drivers/staging/comedi/drivers/ni_atmio.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/comedi/drivers/ni_atmio.c +2 -2
index b9e9ab548c4b..4e27a2959b64 100644
@@ -226,8 +226,8 @@ static int ni_isapnp_find_board(struct pnp_dev **dev)
        for (i = 0; i < ARRAY_SIZE(ni_boards); i++) {
                isapnp_dev = pnp_find_dev(NULL,
                                          ISAPNP_VENDOR('N', 'I', 'C'),
-                                         ISAPNP_FUNCTION(ni_boards[i].
-                                                         isapnp_id),
 NULL);
+                                         ISAPNP_FUNCTION(ni_boards[i].
 isapnp_id),
+                                         NULL);
                if (!isapnp_dev || !isapnp_dev->card)
Quoted 3 lines
                        continue;

I suggest splitting the expression just after the '=' to avoid going over 80 columns.

--
-=( Ian Abbott @ MEV Ltd. E-mail: <[email protected]> )=-
-=( Web: http://www.mev.co.uk/ )=-

#6 lore raw
In reply to Ian Abbott

Yes that can be done. But isn't 80 column limit more of a historical convention?

Quoted 30 lines · Ian Abbott
Quoted 12 lines · Pratik Jain

Fixed coding style issue.

---
  drivers/staging/comedi/drivers/ni_atmio.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/comedi/drivers/ni_atmio.c +0 -0
index b9e9ab548c4b..4e27a2959b64 100644

drivers/staging/comedi/drivers/ni_atmio.c static int ni_isapnp_find_board(struct pnp_dev **dev) · line 233

Quoted 10 lines
drivers/staging/comedi/drivers/ni_atmio.c +2 -2
@@ -226,8 +226,8 @@ static int ni_isapnp_find_board(struct pnp_dev **dev)
  	for (i = 0; i < ARRAY_SIZE(ni_boards); i++) {
  		isapnp_dev = pnp_find_dev(NULL,
  					  ISAPNP_VENDOR('N', 'I', 'C'),
-					  ISAPNP_FUNCTION(ni_boards[i].
-							  isapnp_id), NULL);
+					  ISAPNP_FUNCTION(ni_boards[i].isapnp_id),
+					  NULL);
  		if (!isapnp_dev || !isapnp_dev->card)
  			continue;
 

I suggest splitting the expression just after the '=' to avoid going over 80 columns.

Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
#8 lore raw

PATCH 1/1 Staging: comedi: drivers: ni_atmio.c: fixed multi-line derefernce issue

Fixed coding style issue.

---
 drivers/staging/comedi/drivers/ni_atmio.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/staging/comedi/drivers/ni_atmio.c +5 -4
index b9e9ab548c4b..2b7bfe0dd7f3 100644
@@ -224,10 +224,11 @@ static int ni_isapnp_find_board(struct pnp_dev **dev)
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(ni_boards); i++) {
-		isapnp_dev = pnp_find_dev(NULL,
-					  ISAPNP_VENDOR('N', 'I', 'C'),
-					  ISAPNP_FUNCTION(ni_boards[i].
-							  isapnp_id), NULL);
+		isapnp_dev =
+			pnp_find_dev(NULL,
+				     ISAPNP_VENDOR('N', 'I', 'C'),
+				     ISAPNP_FUNCTION(ni_boards[i].isapnp_id),
+				     NULL);
 
 		if (!isapnp_dev || !isapnp_dev->card)
 			continue;
Signature · 1 line
2.16.2
Reviewed-by on v1 1/1
#9 lore raw
Quoted 18 lines · Pratik Jain

Fixed coding style issue.

---
  drivers/staging/comedi/drivers/ni_atmio.c | 9 +++++----
  1 file changed, 5 insertions(+), 4 deletions(-)
drivers/staging/comedi/drivers/ni_atmio.c +0 -2
index b9e9ab548c4b..2b7bfe0dd7f3 100644
@@ -224,10 +224,11 @@ static int ni_isapnp_find_board(struct pnp_dev **dev)
  	int i;
 
  	for (i = 0; i < ARRAY_SIZE(ni_boards); i++) {
-		isapnp_dev = pnp_find_dev(NULL,
-					  ISAPNP_VENDOR('N', 'I', 'C'),

drivers/staging/comedi/drivers/ni_atmio.c static int ni_isapnp_find_board(struct pnp_dev **dev) · line 234

Quoted 10 lines
drivers/staging/comedi/drivers/ni_atmio.c +5 -2
-					  ISAPNP_FUNCTION(ni_boards[i].
-							  isapnp_id), NULL);
+		isapnp_dev =
+			pnp_find_dev(NULL,
+				     ISAPNP_VENDOR('N', 'I', 'C'),
+				     ISAPNP_FUNCTION(ni_boards[i].isapnp_id),
+				     NULL);
 
  		if (!isapnp_dev || !isapnp_dev->card)
  			continue;

Looks good, thanks!

Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

A message that is not in the archive (sent off-list or not yet received): [email protected]

#11 lore raw

Resending the email because it was sent only to Greg.

Context:
In my previous patch, I had removed an extra newline at the end of the code.

My Reply:
It was unintentional, but does it violate any coding or other standard?

#12 lore raw
Quoted 10 lines · Pratik Jain

Resending the email because it was sent only to Greg.

Context:
In my previous patch, I had removed an extra newline at the end of the code.

My Reply:
It was unintentional, but does it violate any coding or other standard?

No, but don't do random unrelated changes.

regards,
dan carpenter