All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Fwd: [PATCH v2 2/5] Change return type of functions that are named *_exit or *_exitfn in hw/char from int to void
       [not found] <1460484949-5798-1-git-send-email-nutanshinde1992@gmail.com>
@ 2016-04-12 18:17 ` Nutan Shinde
  2016-04-12 21:23   ` Paolo Bonzini
  0 siblings, 1 reply; 5+ messages in thread
From: Nutan Shinde @ 2016-04-12 18:17 UTC (permalink / raw)
  To: pbonzini, QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 1104 bytes --]

This change is required because the return type of exit(error) function is
not used.
This patch only has changes for files in hw/char package.

Signed-off-by: Nutan Shinde <nutanshinde1992@gmail.com>
---
 hw/char/sclpconsole-lm.c | 3 +--
 hw/char/sclpconsole.c    | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c
index 7d4ff81..a9a9703 100644
--- a/hw/char/sclpconsole-lm.c
+++ b/hw/char/sclpconsole-lm.c
@@ -328,9 +328,8 @@ static int console_init(SCLPEvent *event)
     return 0;
 }

-static int console_exit(SCLPEvent *event)
+static console_exit(SCLPEvent *event)
 {
-    return 0;
 }

 static void console_reset(DeviceState *dev)
diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c
index 45997ff..d179404 100644
--- a/hw/char/sclpconsole.c
+++ b/hw/char/sclpconsole.c
@@ -242,9 +242,8 @@ static void console_reset(DeviceState *dev)
    scon->notify = false;
 }

-static int console_exit(SCLPEvent *event)
+static console_exit(SCLPEvent *event)
 {
-    return 0;
 }

 static Property console_properties[] = {
--
1.9.1

[-- Attachment #2: Type: text/html, Size: 1508 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Fwd: [PATCH v2 2/5] Change return type of functions that are named *_exit or *_exitfn in hw/char from int to void
  2016-04-12 18:17 ` [Qemu-devel] Fwd: [PATCH v2 2/5] Change return type of functions that are named *_exit or *_exitfn in hw/char from int to void Nutan Shinde
@ 2016-04-12 21:23   ` Paolo Bonzini
  2016-04-13  6:33     ` Markus Armbruster
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2016-04-12 21:23 UTC (permalink / raw)
  To: Nutan Shinde, QEMU Developers



On 12/04/2016 20:17, Nutan Shinde wrote:
> 
> -static int console_exit(SCLPEvent *event)
> +static console_exit(SCLPEvent *event)
>  {
> -    return 0;

This patch doesn't even compile:

  CC    hw/char/sclpconsole.o
/home/pbonzini/work/upstream/qemu/hw/char/sclpconsole.c:245:8: error: return type defaults to ‘int’ [-Werror=implicit-int]
 static console_exit(SCLPEvent *event)
        ^
cc1: all warnings being treated as errors


Paolo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Fwd: [PATCH v2 2/5] Change return type of functions that are named *_exit or *_exitfn in hw/char from int to void
  2016-04-12 21:23   ` Paolo Bonzini
@ 2016-04-13  6:33     ` Markus Armbruster
  2016-04-13  7:38       ` Paolo Bonzini
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Armbruster @ 2016-04-13  6:33 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Nutan Shinde, QEMU Developers

Paolo Bonzini <pbonzini@redhat.com> writes:

> On 12/04/2016 20:17, Nutan Shinde wrote:
>> 
>> -static int console_exit(SCLPEvent *event)
>> +static console_exit(SCLPEvent *event)
>>  {
>> -    return 0;
>
> This patch doesn't even compile:
>
>   CC    hw/char/sclpconsole.o
> /home/pbonzini/work/upstream/qemu/hw/char/sclpconsole.c:245:8: error: return type defaults to ‘int’ [-Werror=implicit-int]
>  static console_exit(SCLPEvent *event)
>         ^
> cc1: all warnings being treated as errors

It wouldn't compile even with the missing void inserted:

    hw/char/sclpconsole-lm.c:361:14: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
         ec->exit = console_exit;
                  ^

I gather you're doing this for BiteSizedTasks items

* Look for functions that are named *_exit or *_exitfn in hw/ and that
  return int.  They should all return zero.  Make them return void, and
  remove the checks for the callers.
* Once the above change is done, remove the "Error **" argument from
  functions named *_unrealize in hw/

Added by Paolo on 2014-12-03.  These tasks don't make sense to me.
Paolo, can you explain?

Additionally, the commit message titles aren't quite right, the series
isn't threaded, and its parts can't be applied with git-am (some MIME
crap gets in the way).

Your title lacks a subsystem: prefix and is too long.  Better:

    hw/char: Change return type of *_exit(), *_exitfn() to void

Please study http://wiki.qemu-project.org/Contribute/SubmitAPatch once
more, particularly sections "Write a meaningful commit message", "Use
git format-patch", and "Include a meaningful cover letter".

In theory, it is possible to consistently send well-formed patches
by hand.  In practice, you either use git-send-email or you screw it up.
Use git-send-email.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Fwd: [PATCH v2 2/5] Change return type of functions that are named *_exit or *_exitfn in hw/char from int to void
  2016-04-13  6:33     ` Markus Armbruster
@ 2016-04-13  7:38       ` Paolo Bonzini
  2016-04-13 11:29         ` Markus Armbruster
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2016-04-13  7:38 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: Nutan Shinde, QEMU Developers



On 13/04/2016 08:33, Markus Armbruster wrote:
> * Look for functions that are named *_exit or *_exitfn in hw/ and that
>   return int.  They should all return zero.  Make them return void, and
>   remove the checks for the callers.

      ... and change the exit method to "void fn(void)"

> * Once the above change is done, remove the "Error **" argument from
>   functions named *_unrealize in hw/

     ... same for the unrealize method.

> Added by Paolo on 2014-12-03.  These tasks don't make sense to me.
> Paolo, can you explain?

The exit functions always return zero, the unrealize functions never
touch the Error** argument.  So make both of them "void fn(void)" and
remove the difference between exit and unrealize.

Paolo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Fwd: [PATCH v2 2/5] Change return type of functions that are named *_exit or *_exitfn in hw/char from int to void
  2016-04-13  7:38       ` Paolo Bonzini
@ 2016-04-13 11:29         ` Markus Armbruster
  0 siblings, 0 replies; 5+ messages in thread
From: Markus Armbruster @ 2016-04-13 11:29 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Nutan Shinde, QEMU Developers

Paolo Bonzini <pbonzini@redhat.com> writes:

> On 13/04/2016 08:33, Markus Armbruster wrote:
>> * Look for functions that are named *_exit or *_exitfn in hw/ and that
>>   return int.  They should all return zero.  Make them return void, and
>>   remove the checks for the callers.
>
>       ... and change the exit method to "void fn(void)"
>
>> * Once the above change is done, remove the "Error **" argument from
>>   functions named *_unrealize in hw/
>
>      ... same for the unrealize method.
>
>> Added by Paolo on 2014-12-03.  These tasks don't make sense to me.
>> Paolo, can you explain?
>
> The exit functions always return zero, the unrealize functions never
> touch the Error** argument.  So make both of them "void fn(void)" and
> remove the difference between exit and unrealize.

Got it now, thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-04-13 11:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1460484949-5798-1-git-send-email-nutanshinde1992@gmail.com>
2016-04-12 18:17 ` [Qemu-devel] Fwd: [PATCH v2 2/5] Change return type of functions that are named *_exit or *_exitfn in hw/char from int to void Nutan Shinde
2016-04-12 21:23   ` Paolo Bonzini
2016-04-13  6:33     ` Markus Armbruster
2016-04-13  7:38       ` Paolo Bonzini
2016-04-13 11:29         ` Markus Armbruster

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.