# [PATCH] notes.c: don't call 'return' in a void function

3 messages from 2010-03-18 to 2010-03-18. Participants: Brandon Casey, Johan Herland.
Thread: https://gitlist.dev/t/23064

## Brandon Casey, 2010-03-18 14:50

Subject: [PATCH] notes.c: don't call 'return' in a void function
Message-ID: <m6P-Qdljqt7xCgOUC581DdkndLOwc9aVqzGi_vEsC8UeEeGnpREXOnx-fSQIkTfaqsh9HzzlXIM@cipher.nrlssc.navy.mil>
URL: https://gitlist.dev/e/m6P-Qdljqt7xCgOUC581DdkndLOwc9aVqzGi_vEsC8UeEeGnpREXOnx-fSQIkTfaqsh9HzzlXIM%40cipher.nrlssc.navy.mil

```
From: Brandon Casey <drafnel@gmail.com>


Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 notes.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/notes.c b/notes.c
index a4f9926..07941b7 100644
--- a/notes.c
+++ b/notes.c
@@ -893,7 +893,7 @@ void remove_note(struct notes_tree *t, const unsigned char *object_sha1)
 	assert(t->initialized);
 	hashcpy(l.key_sha1, object_sha1);
 	hashclr(l.val_sha1);
-	return note_tree_remove(t, t->root, 0, &l);
+	note_tree_remove(t, t->root, 0, &l);
 }
 
 const unsigned char *get_note(struct notes_tree *t,
-- 
1.6.6.2

```

## Brandon Casey, 2010-03-18 15:03

Subject: [PATCH] notes.c: remove inappropriate call to return
Message-ID: <FMCfttz0yXy1PiW0rQs7llBXL-J_qvqMmKHhFzRD_pqpDVu1DBh0TUAi68oer0RcT3kMvGDNHiQ@cipher.nrlssc.navy.mil>
URL: https://gitlist.dev/e/FMCfttz0yXy1PiW0rQs7llBXL-J_qvqMmKHhFzRD_pqpDVu1DBh0TUAi68oer0RcT3kMvGDNHiQ%40cipher.nrlssc.navy.mil
In-Reply-To: <m6P-Qdljqt7xCgOUC581DdkndLOwc9aVqzGi_vEsC8UeEeGnpREXOnx-fSQIkTfaqsh9HzzlXIM@cipher.nrlssc.navy.mil>

```
From: Brandon Casey <drafnel@gmail.com>


Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---


Heh, I guess it's ok to call 'return' in a function returning
void, but it shouldn't be passed an argument. :)

-brandon


 notes.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/notes.c b/notes.c
index a4f9926..07941b7 100644
--- a/notes.c
+++ b/notes.c
@@ -893,7 +893,7 @@ void remove_note(struct notes_tree *t, const unsigned char *object_sha1)
 	assert(t->initialized);
 	hashcpy(l.key_sha1, object_sha1);
 	hashclr(l.val_sha1);
-	return note_tree_remove(t, t->root, 0, &l);
+	note_tree_remove(t, t->root, 0, &l);
 }
 
 const unsigned char *get_note(struct notes_tree *t,
-- 
1.6.6.2

```

## Johan Herland, 2010-03-18 15:37

Subject: Re: [PATCH] notes.c: remove inappropriate call to return
Message-ID: <201003181637.35168.johan@herland.net>
URL: https://gitlist.dev/e/201003181637.35168.johan%40herland.net
In-Reply-To: <FMCfttz0yXy1PiW0rQs7llBXL-J_qvqMmKHhFzRD_pqpDVu1DBh0TUAi68oer0RcT3kMvGDNHiQ@cipher.nrlssc.navy.mil>

```
On Thursday 18 March 2010, Brandon Casey wrote:
> From: Brandon Casey <drafnel@gmail.com>
>
>
> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
> ---
>
>
> Heh, I guess it's ok to call 'return' in a function returning
> void, but it shouldn't be passed an argument. :)
>
> -brandon
>
>
>  notes.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/notes.c b/notes.c
> index a4f9926..07941b7 100644
> --- a/notes.c
> +++ b/notes.c
> @@ -893,7 +893,7 @@ void remove_note(struct notes_tree *t, const
> unsigned char *object_sha1) assert(t->initialized);
>  	hashcpy(l.key_sha1, object_sha1);
>  	hashclr(l.val_sha1);
> -	return note_tree_remove(t, t->root, 0, &l);
> +	note_tree_remove(t, t->root, 0, &l);
>  }
>
>  const unsigned char *get_note(struct notes_tree *t,

Yes, I noticed this during a recent code review in some related code, 
but I haven't yet got around to posting a cleanup patch.

Acked-by: Johan Herland <johan@herland.net>


...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

```
