* [Qemu-devel] [PATCH] util/error: Remove an unnecessary NULL check
@ 2018-12-07 16:14 Philippe Mathieu-Daudé
2018-12-07 16:22 ` Daniel P. Berrangé
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-12-07 16:14 UTC (permalink / raw)
To: Markus Armbruster, Daniel P . Berrangé
Cc: Philippe Mathieu-Daudé, qemu-devel, Eric Blake, Thomas Huth
This NULL check was required while introduced in 680d16dcb79f.
Later refactor added a NULL check in error_setv(), so this check
is now redundant.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
util/error.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/util/error.c b/util/error.c
index b5ccbd8eac..934a78e1b1 100644
--- a/util/error.c
+++ b/util/error.c
@@ -103,10 +103,6 @@ void error_setg_errno_internal(Error **errp,
va_list ap;
int saved_errno = errno;
- if (errp == NULL) {
- return;
- }
-
va_start(ap, fmt);
error_setv(errp, src, line, func, ERROR_CLASS_GENERIC_ERROR, fmt, ap,
os_errno != 0 ? strerror(os_errno) : NULL);
--
2.17.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] util/error: Remove an unnecessary NULL check
2018-12-07 16:14 [Qemu-devel] [PATCH] util/error: Remove an unnecessary NULL check Philippe Mathieu-Daudé
@ 2018-12-07 16:22 ` Daniel P. Berrangé
2018-12-07 18:01 ` Markus Armbruster
2018-12-07 18:16 ` Thomas Huth
2 siblings, 0 replies; 5+ messages in thread
From: Daniel P. Berrangé @ 2018-12-07 16:22 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Markus Armbruster, qemu-devel, Eric Blake, Thomas Huth
On Fri, Dec 07, 2018 at 05:14:47PM +0100, Philippe Mathieu-Daudé wrote:
> This NULL check was required while introduced in 680d16dcb79f.
> Later refactor added a NULL check in error_setv(), so this check
> is now redundant.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> util/error.c | 4 ----
> 1 file changed, 4 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] util/error: Remove an unnecessary NULL check
2018-12-07 16:14 [Qemu-devel] [PATCH] util/error: Remove an unnecessary NULL check Philippe Mathieu-Daudé
2018-12-07 16:22 ` Daniel P. Berrangé
@ 2018-12-07 18:01 ` Markus Armbruster
2018-12-07 18:16 ` Thomas Huth
2 siblings, 0 replies; 5+ messages in thread
From: Markus Armbruster @ 2018-12-07 18:01 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Daniel P . Berrangé, Thomas Huth, qemu-devel
Philippe Mathieu-Daudé <philmd@redhat.com> writes:
> This NULL check was required while introduced in 680d16dcb79f.
> Later refactor added a NULL check in error_setv(), so this check
> is now redundant.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] util/error: Remove an unnecessary NULL check
2018-12-07 16:14 [Qemu-devel] [PATCH] util/error: Remove an unnecessary NULL check Philippe Mathieu-Daudé
2018-12-07 16:22 ` Daniel P. Berrangé
2018-12-07 18:01 ` Markus Armbruster
@ 2018-12-07 18:16 ` Thomas Huth
2018-12-07 19:10 ` Philippe Mathieu-Daudé
2 siblings, 1 reply; 5+ messages in thread
From: Thomas Huth @ 2018-12-07 18:16 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, Markus Armbruster,
Daniel P . Berrangé
Cc: qemu-devel, Eric Blake
On 2018-12-07 17:14, Philippe Mathieu-Daudé wrote:
> This NULL check was required while introduced in 680d16dcb79f.
> Later refactor added a NULL check in error_setv(), so this check
> is now redundant.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> util/error.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/util/error.c b/util/error.c
> index b5ccbd8eac..934a78e1b1 100644
> --- a/util/error.c
> +++ b/util/error.c
> @@ -103,10 +103,6 @@ void error_setg_errno_internal(Error **errp,
> va_list ap;
> int saved_errno = errno;
Could the saved_errno now be removed, too, since err_setv does that again?
Thomas
> - if (errp == NULL) {
> - return;
> - }
> -
> va_start(ap, fmt);
> error_setv(errp, src, line, func, ERROR_CLASS_GENERIC_ERROR, fmt, ap,
> os_errno != 0 ? strerror(os_errno) : NULL);
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] util/error: Remove an unnecessary NULL check
2018-12-07 18:16 ` Thomas Huth
@ 2018-12-07 19:10 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-12-07 19:10 UTC (permalink / raw)
To: Thomas Huth, Markus Armbruster, Daniel P . Berrangé
Cc: qemu-devel, Eric Blake
On 12/7/18 7:16 PM, Thomas Huth wrote:
> On 2018-12-07 17:14, Philippe Mathieu-Daudé wrote:
>> This NULL check was required while introduced in 680d16dcb79f.
>> Later refactor added a NULL check in error_setv(), so this check
>> is now redundant.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>> util/error.c | 4 ----
>> 1 file changed, 4 deletions(-)
>>
>> diff --git a/util/error.c b/util/error.c
>> index b5ccbd8eac..934a78e1b1 100644
>> --- a/util/error.c
>> +++ b/util/error.c
>> @@ -103,10 +103,6 @@ void error_setg_errno_internal(Error **errp,
>> va_list ap;
>> int saved_errno = errno;
>
> Could the saved_errno now be removed, too, since err_setv does that again?
Yes, good idea, I'll send another patch.
>
> Thomas
>
>
>> - if (errp == NULL) {
>> - return;
>> - }
>> -
>> va_start(ap, fmt);
>> error_setv(errp, src, line, func, ERROR_CLASS_GENERIC_ERROR, fmt, ap,
>> os_errno != 0 ? strerror(os_errno) : NULL);
>>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-12-07 19:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-07 16:14 [Qemu-devel] [PATCH] util/error: Remove an unnecessary NULL check Philippe Mathieu-Daudé
2018-12-07 16:22 ` Daniel P. Berrangé
2018-12-07 18:01 ` Markus Armbruster
2018-12-07 18:16 ` Thomas Huth
2018-12-07 19:10 ` Philippe Mathieu-Daudé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).