[PATCH 06/21] io: Fix Error usage in a comment <example>

Markus Armbruster posted 21 patches 6 years, 2 months ago
Maintainers: David Gibson <david@gibson.dropbear.id.au>, Igor Mammedov <imammedo@redhat.com>, Corey Minyard <minyard@acm.org>, Richard Henderson <rth@twiddle.net>, Jason Wang <jasowang@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Michael Roth <mdroth@linux.vnet.ibm.com>, Markus Armbruster <armbru@redhat.com>, Halil Pasic <pasic@linux.ibm.com>, "Michael S. Tsirkin" <mst@redhat.com>, David Hildenbrand <david@redhat.com>, Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>, Max Reitz <mreitz@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Paul Burton <pburton@wavecomp.com>, Christian Borntraeger <borntraeger@de.ibm.com>
[PATCH 06/21] io: Fix Error usage in a comment <example>
Posted by Markus Armbruster 6 years, 2 months ago
Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 include/io/task.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/io/task.h b/include/io/task.h
index 5cb9faf9f2..1abbfb8b65 100644
--- a/include/io/task.h
+++ b/include/io/task.h
@@ -119,7 +119,7 @@ typedef void (*QIOTaskWorker)(QIOTask *task,
  *   gboolean myobject_operation_timer(gpointer opaque)
  *   {
  *      QIOTask *task = QIO_TASK(opaque);
- *      Error *err;*
+ *      Error *err = NULL;
  *
  *      ...check something important...
  *       if (err) {
-- 
2.21.0


Re: [PATCH 06/21] io: Fix Error usage in a comment <example>
Posted by Vladimir Sementsov-Ogievskiy 6 years, 2 months ago
30.11.2019 22:42, Markus Armbruster wrote:
> Cc: "Daniel P. Berrangé" <berrange@redhat.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>   include/io/task.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/io/task.h b/include/io/task.h
> index 5cb9faf9f2..1abbfb8b65 100644
> --- a/include/io/task.h
> +++ b/include/io/task.h
> @@ -119,7 +119,7 @@ typedef void (*QIOTaskWorker)(QIOTask *task,
>    *   gboolean myobject_operation_timer(gpointer opaque)
>    *   {
>    *      QIOTask *task = QIO_TASK(opaque);
> - *      Error *err;*
> + *      Error *err = NULL;
>    *
>    *      ...check something important...
>    *       if (err) {
> 

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

(I also think you can safely s/Fix Error usage/Fix typo/ in subject)

-- 
Best regards,
Vladimir
Re: [PATCH 06/21] io: Fix Error usage in a comment <example>
Posted by Markus Armbruster 6 years, 2 months ago
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> writes:

> 30.11.2019 22:42, Markus Armbruster wrote:
>> Cc: "Daniel P. Berrangé" <berrange@redhat.com>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>   include/io/task.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/include/io/task.h b/include/io/task.h
>> index 5cb9faf9f2..1abbfb8b65 100644
>> --- a/include/io/task.h
>> +++ b/include/io/task.h
>> @@ -119,7 +119,7 @@ typedef void (*QIOTaskWorker)(QIOTask *task,
>>    *   gboolean myobject_operation_timer(gpointer opaque)
>>    *   {
>>    *      QIOTask *task = QIO_TASK(opaque);
>> - *      Error *err;*
>> + *      Error *err = NULL;
>>    *
>>    *      ...check something important...
>>    *       if (err) {
>> 
>
> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>
> (I also think you can safely s/Fix Error usage/Fix typo/ in subject)

I'd say it's both: the trailing * is clearly a typo, but the missing
initializer is asking Murphy for random crashes at inopportune times.
Examples better set *good* examples :)

Thanks!