Skip to contentSkip to conversation

staging: greybus Addressed minor styling issues

PATCH Superseded Ioannis Valasakis 2 participants 8 messages Nov 2, 2018

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover staging: greybus Addressed minor styling issues

Changes in v2:
- Ammend commit messages per recommendation of julia
- Correct typo on type per note from gregkh

Ioannis Valasakis (5):
staging: greybus Align parameters to parentheses
staging: greybus Shorten comparison to NULL
staging: greybus Add a blank line after declaration
staging: greybus Fix SPDX identifier
staging: greybus Align arguments with parentheses

 drivers/staging/greybus/control.h | 5 +++--
 drivers/staging/greybus/core.c    | 6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)
Signature · 1 line
2.19.1
#1 lore raw

PATCH v2 1/5 staging: greybus Align parameters to parentheses

Align parameters to the right side of the left parentheses Reported by checkpatch.

---
 drivers/staging/greybus/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/greybus/core.c +3 -3
index dafa430d176e..d28773e06838 100644
@@ -28,7 +28,7 @@ int greybus_disabled(void)
 EXPORT_SYMBOL_GPL(greybus_disabled);
 
 static bool greybus_match_one_id(struct gb_bundle *bundle,
-				     const struct greybus_bundle_id *id)
+				 const struct greybus_bundle_id *id)
 {
 	if ((id->match_flags & GREYBUS_ID_MATCH_VENDOR) &&
 	    (id->vendor != bundle->intf->vendor_id))
@@ -48,7 +48,7 @@ static bool greybus_match_one_id(struct gb_bundle *bundle,
 static const struct greybus_bundle_id *
 greybus_match_id(struct gb_bundle *bundle, const struct greybus_bundle_id *id)
 {
-	if (id == NULL)
+	if (!id == NULL)
 		return NULL;
 
 	for (; id->vendor || id->product || id->class || id->driver_info;
@@ -266,7 +266,7 @@ static int greybus_remove(struct device *dev)
 }
 
 int greybus_register_driver(struct greybus_driver *driver, struct module *owner,
-		const char *mod_name)
+			    const char *mod_name)
 {
 	int retval;
 
Signature · 1 line
2.19.1
#2 lore raw

Re: [Outreachy kernel] [PATCH v2 1/5] staging: greybus Align parameters to parentheses

Quoted 27 lines · Ioannis Valasakis

Align parameters to the right side of the left parentheses Reported by checkpatch.

---
drivers/staging/greybus/core.c | 6 +++---

1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/greybus/core.c +1 -1
index dafa430d176e..d28773e06838 100644
@@ -28,7 +28,7 @@ int greybus_disabled(void)
 EXPORT_SYMBOL_GPL(greybus_disabled);
 
 static bool greybus_match_one_id(struct gb_bundle *bundle,
-				     const struct greybus_bundle_id *id)
+				 const struct greybus_bundle_id *id)
 {
 	if ((id->match_flags & GREYBUS_ID_MATCH_VENDOR) &&
 	    (id->vendor != bundle->intf->vendor_id))
@@ -48,7 +48,7 @@ static bool greybus_match_one_id(struct gb_bundle *bundle,

static const struct greybus_bundle_id *
greybus_match_id(struct gb_bundle *bundle, const struct greybus_bundle_id *id) {

drivers/staging/greybus/core.c +1 -1
-	if (id == NULL)
+	if (!id == NULL)
Quoted 1 line
		return NULL;

This change doesn't look right. It also doesn't do what the commit log says this commit does.

--
Thanks,
Sasha

#3 lore raw

Re: [Outreachy kernel] [PATCH v2 1/5] staging: greybus Align parameters to parentheses

Quoted 33 lines · Sasha Levin
Quoted 27 lines · Ioannis Valasakis

Align parameters to the right side of the left parentheses Reported by checkpatch.

---
drivers/staging/greybus/core.c | 6 +++---

1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/greybus/core.c +1 -1
index dafa430d176e..d28773e06838 100644
@@ -28,7 +28,7 @@ int greybus_disabled(void)
 EXPORT_SYMBOL_GPL(greybus_disabled);
 
 static bool greybus_match_one_id(struct gb_bundle *bundle,
-				     const struct greybus_bundle_id *id)
+				 const struct greybus_bundle_id *id)
 {
 	if ((id->match_flags & GREYBUS_ID_MATCH_VENDOR) &&
 	    (id->vendor != bundle->intf->vendor_id))
@@ -48,7 +48,7 @@ static bool greybus_match_one_id(struct gb_bundle *bundle,

static const struct greybus_bundle_id *
greybus_match_id(struct gb_bundle *bundle, const struct greybus_bundle_id *id) {

drivers/staging/greybus/core.c +1 -1
-	if (id == NULL)
+	if (!id == NULL)
Quoted 1 line
		return NULL;

This change doesn't look right. It also doesn't do what the commit log says this commit does.

Quoted 3 lines

--
Thanks,
Sasha

Indeed, I am sending a correction to this patch.

Signature · 2 lines
ta
ioannis
#4 lore raw

PATCH v2 2/5 staging: greybus Shorten comparison to NULL

In reply to Ioannis Valasakis

Shorten the comparison to NULL by using ! to make a NULL test Reported by checkpatch.

---
 drivers/staging/greybus/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/core.c +1 -1
index d28773e06838..d6b0d49130c0 100644
@@ -48,7 +48,7 @@ static bool greybus_match_one_id(struct gb_bundle *bundle,
 static const struct greybus_bundle_id *
 greybus_match_id(struct gb_bundle *bundle, const struct greybus_bundle_id *id)
 {
-	if (!id == NULL)
+	if (!id)
 		return NULL;
 
 	for (; id->vendor || id->product || id->class || id->driver_info;
Signature · 1 line
2.19.1
#5 lore raw

PATCH v2 3/5 staging: greybus Add a blank line after declaration

In reply to Ioannis Valasakis

Add a blank line after the struct declaration
Reported by checkpatch.

---
 drivers/staging/greybus/control.h | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/greybus/control.h +1 -0
index 643ddb9e0f92..9c453e0b1b33 100644
@@ -24,6 +24,7 @@ struct gb_control {
 	char *vendor_string;
 	char *product_string;
 };
+
 #define to_gb_control(d) container_of(d, struct gb_control, dev)
 
 struct gb_control *gb_control_create(struct gb_interface *intf);
Signature · 1 line
2.19.1
#6 lore raw

PATCH v2 4/5 staging: greybus Fix SPDX identifier

In reply to Ioannis Valasakis

Fix the SPDX identifier as by replacing with standard C comment the file
Reported by checkpatch

---
 drivers/staging/greybus/control.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/control.h +1 -1
index 9c453e0b1b33..ebb7a2ee17dc 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Greybus CPort control protocol
  *
Signature · 1 line
2.19.1
#7 lore raw

PATCH v2 5/5 staging: greybus Align arguments with parentheses

In reply to Ioannis Valasakis

Align arguments with the right side of the open left parentheses Reported by checkpatch.

---
 drivers/staging/greybus/control.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/control.h +1 -1
index ebb7a2ee17dc..5a45d55349a1 100644
@@ -41,7 +41,7 @@ int gb_control_get_bundle_versions(struct gb_control *control);
 int gb_control_connected_operation(struct gb_control *control, u16 cport_id);
 int gb_control_disconnected_operation(struct gb_control *control, u16 cport_id);
 int gb_control_disconnecting_operation(struct gb_control *control,
-					u16 cport_id);
+				       u16 cport_id);
 int gb_control_mode_switch_operation(struct gb_control *control);
 void gb_control_mode_switch_prepare(struct gb_control *control);
 void gb_control_mode_switch_complete(struct gb_control *control);
Signature · 1 line
2.19.1