Skip to contentSkip to conversation

staging: octeon: Fix return description for functions

PATCH In review Cristina Moraru 3 participants 4 messages Oct 6, 2015 – Oct 8, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: octeon: Fix return description for functions

Clarify return description for functions

---
 drivers/staging/octeon/ethernet.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/octeon/ethernet.c +4 -4
index a63488e..13ee25d 100644
@@ -173,7 +173,7 @@ static void cvm_oct_configure_common_hw(void)
  *
  * @work_queue_entry: Work queue entry to free
  *
- * Returns Zero on success, Negative on failure.
+ * Returns 0 on success or a negative error code.
  */
 int cvm_oct_free_work(void *work_queue_entry)
 {
@@ -248,7 +248,7 @@ static struct net_device_stats *cvm_oct_common_get_stats(struct net_device *dev)
  * @dev:     Device to change
  * @new_mtu: The new MTU
  *
- * Returns Zero on success
+ * Returns 0 on success or a negative error code.
  */
 static int cvm_oct_common_change_mtu(struct net_device *dev, int new_mtu)
 {
@@ -411,7 +411,7 @@ static int cvm_oct_set_mac_filter(struct net_device *dev)
  * @dev:    The device in question.
  * @addr:   Socket address.
  *
- * Returns Zero on success
+ * Returns 0 on success or a negative error code.
  */
 static int cvm_oct_common_set_mac_address(struct net_device *dev, void *addr)
 {
@@ -426,7 +426,7 @@ static int cvm_oct_common_set_mac_address(struct net_device *dev, void *addr)
  * cvm_oct_common_init - per network device initialization
  * @dev:    Device to initialize
  *
- * Returns Zero on success
+ * Returns 0 on success or a negative error code.
  */
 int cvm_oct_common_init(struct net_device *dev)
 {
Signature · 1 line
1.9.1
#1 lore raw
Quoted 12 lines · Cristina Moraru

Clarify return description for functions

---
 drivers/staging/octeon/ethernet.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/octeon/ethernet.c +0 -0
index a63488e..13ee25d 100644

drivers/staging/octeon/ethernet.c static void cvm_oct_configure_common_hw(void) · line 176

Quoted 5 lines
drivers/staging/octeon/ethernet.c +1 -1
@@ -173,7 +173,7 @@ static void cvm_oct_configure_common_hw(void)
  *
  * @work_queue_entry: Work queue entry to free
  *
- * Returns Zero on success, Negative on failure.
+ * Returns 0 on success or a negative error code.

Is this really true? I see only one return in this function, and it is a return 0.

julia

Quoted 22 lines
drivers/staging/octeon/ethernet.c +2 -2
  */
 int cvm_oct_free_work(void *work_queue_entry)
 {
@@ -248,7 +248,7 @@ static struct net_device_stats *cvm_oct_common_get_stats(struct net_device *dev)
  * @dev:     Device to change
  * @new_mtu: The new MTU
  *
- * Returns Zero on success
+ * Returns 0 on success or a negative error code.
  */
 static int cvm_oct_common_change_mtu(struct net_device *dev, int new_mtu)
 {
@@ -411,7 +411,7 @@ static int cvm_oct_set_mac_filter(struct net_device *dev)
  * @dev:    The device in question.
  * @addr:   Socket address.
  *
- * Returns Zero on success
+ * Returns 0 on success or a negative error code.
  */
 static int cvm_oct_common_set_mac_address(struct net_device *dev, void *addr)
 {

drivers/staging/octeon/ethernet.c static int cvm_oct_common_set_mac_address(struct net_device *dev, void *addr) · line 431

Quoted 7 lines
drivers/staging/octeon/ethernet.c +1 -1
@@ -426,7 +426,7 @@ static int cvm_oct_common_set_mac_address(struct net_device *dev, void *addr)
  * cvm_oct_common_init - per network device initialization
  * @dev:    Device to initialize
  *
- * Returns Zero on success
+ * Returns 0 on success or a negative error code.
  */
 int cvm_oct_common_init(struct net_device *dev)

This function also seems to contain only a return 0.

julia

Quoted 11 lines
drivers/staging/octeon/ethernet.c +0 -1
 {
--

1.9.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 post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1444168297-90793-1-git-send-email-cristina.moraru09%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw

That's true. I will correct them.

2015-10-08 10:22 GMT+03:00 Julia Lawall <[email protected]>:

Quoted 81 lines · Cristina Moraru

Review

Quoted 9 lines

Clarify return description for functions

---
 drivers/staging/octeon/ethernet.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/staging/octeon/ethernet.c

drivers/staging/octeon/ethernet.c static void cvm_oct_configure_common_hw(void) · line 176

Quoted 9 lines

index a63488e..13ee25d 100644

drivers/staging/octeon/ethernet.c +1 -1
@@ -173,7 +173,7 @@ static void cvm_oct_configure_common_hw(void)
  *
  * @work_queue_entry: Work queue entry to free
  *
- * Returns Zero on success, Negative on failure.
+ * Returns 0 on success or a negative error code.

Is this really true? I see only one return in this function, and it is a return 0.

julia

drivers/staging/octeon/ethernet.c static struct net_device_stats

Quoted 4 lines
drivers/staging/octeon/ethernet.c +0 -0
  */
 int cvm_oct_free_work(void *work_queue_entry)
 {
@@ -248,7 +248,7 @@ static struct net_device_stats

*cvm_oct_common_get_stats(struct net_device *dev)

drivers/staging/octeon/ethernet.c static struct net_device_stats *cvm_oct_common_get_stats(struct net_device *dev)

Quoted 7 lines
drivers/staging/octeon/ethernet.c +1 -1
  * @dev:     Device to change
  * @new_mtu: The new MTU
  *
- * Returns Zero on success
+ * Returns 0 on success or a negative error code.
  */
 static int cvm_oct_common_change_mtu(struct net_device *dev, int

new_mtu)

drivers/staging/octeon/ethernet.c static int cvm_oct_set_mac_filter(struct net_device

Quoted 2 lines
drivers/staging/octeon/ethernet.c +0 -0
 {
@@ -411,7 +411,7 @@ static int cvm_oct_set_mac_filter(struct net_device

*dev)

drivers/staging/octeon/ethernet.c static int cvm_oct_set_mac_filter(struct net_device *dev)

Quoted 7 lines
drivers/staging/octeon/ethernet.c +1 -1
  * @dev:    The device in question.
  * @addr:   Socket address.
  *
- * Returns Zero on success
+ * Returns 0 on success or a negative error code.
  */
 static int cvm_oct_common_set_mac_address(struct net_device *dev, void

*addr)

drivers/staging/octeon/ethernet.c static int cvm_oct_common_set_mac_address(struct

Quoted 2 lines
drivers/staging/octeon/ethernet.c +0 -0
 {
@@ -426,7 +426,7 @@ static int cvm_oct_common_set_mac_address(struct

net_device *dev, void *addr)

drivers/staging/octeon/ethernet.c static int cvm_oct_common_set_mac_address(struct net_device *dev, void *addr) · line 431

Quoted 7 lines
drivers/staging/octeon/ethernet.c +1 -1
  * cvm_oct_common_init - per network device initialization
  * @dev:    Device to initialize
  *
- * Returns Zero on success
+ * Returns 0 on success or a negative error code.
  */
 int cvm_oct_common_init(struct net_device *dev)

This function also seems to contain only a return 0.

julia

Quoted 6 lines
drivers/staging/octeon/ethernet.c +0 -1
 {
--

1.9.1

--
You received this message because you are subscribed to the Google

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it, send

an email to [email protected].

Quoted 2 lines

To post to this group, send email to [email protected]. To view this discussion on the web visit

https://groups.google.com/d/msgid/outreachy-kernel/1444168297-90793-1-git-send-email-cristina.moraru09%40gmail.com
.

Quoted 2 lines

For more options, visit https://groups.google.com/d/optout.

#3 lore raw
Quoted 1 line · On Thursday 08 October 2015 17:01:05 Cristina-Gabriela Moraru wrote:

That's true. I will correct them.

Please avoid top-posting

Quoted 25 lines

2015-10-08 10:22 GMT+03:00 Julia Lawall <[email protected]>:

Quoted 23 lines · Cristina Moraru

Review

Quoted 9 lines

Clarify return description for functions

---
 drivers/staging/octeon/ethernet.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/staging/octeon/ethernet.c

drivers/staging/octeon/ethernet.c static void cvm_oct_configure_common_hw(void) · line 176

Quoted 9 lines

index a63488e..13ee25d 100644

drivers/staging/octeon/ethernet.c +1 -1
@@ -173,7 +173,7 @@ static void cvm_oct_configure_common_hw(void)
  *
  * @work_queue_entry: Work queue entry to free
  *
- * Returns Zero on success, Negative on failure.
+ * Returns 0 on success or a negative error code.

Is this really true? I see only one return in this function, and it is a return 0.

If a function always returns 0, it may actually be best to change the return type to 'void'.

Arnd