qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aleksandar Markovic <aleksandar.m.mail@gmail.com>
To: Filip Bozuta <Filip.Bozuta@rt-rk.com>
Cc: "pburton@wavecomp.com" <pburton@wavecomp.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"hpoussin@reactos.org" <hpoussin@reactos.org>,
	"amarkovic@wavecomp.com" <amarkovic@wavecomp.com>,
	"aleksandar.rikalo@rt-rk.com" <aleksandar.rikalo@rt-rk.com>,
	"aurelien@aurel32.net" <aurelien@aurel32.net>
Subject: Re: [PATCH 3/5] mips: mipssim: Renovate coding style
Date: Fri, 6 Dec 2019 09:03:48 +0100	[thread overview]
Message-ID: <CAL1e-=hm-0L0YBSuu0uzwUn+A+MnYB5x-cUUuJWN6NkjqiMqNw@mail.gmail.com> (raw)
In-Reply-To: <1574687098-26689-4-git-send-email-Filip.Bozuta@rt-rk.com>

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

On Monday, November 25, 2019, Filip Bozuta <Filip.Bozuta@rt-rk.com> wrote:

> The script checkpatch.pl located in scripts folder was
> used to detect all errors and warrnings in files:
>     hw/mips/mips_mipssim.c
>     hw/net/mipsnet.c
>
> All these mips mipssim machine files were edited and
> all the errors and warrings generated by the checkpatch.pl
> script were corrected and then the script was
> ran again to make sure there are no more errors and warnings.
>
> Signed-off-by: Filip Bozuta <Filip.Bozuta@rt-rk.com>
> ---
>  hw/net/mipsnet.c | 44 ++++++++++++++++++++++++--------------------
>  1 file changed, 24 insertions(+), 20 deletions(-)
>
>
Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>


> diff --git a/hw/net/mipsnet.c b/hw/net/mipsnet.c
> index f7ae1ce..cb3331f 100644
> --- a/hw/net/mipsnet.c
> +++ b/hw/net/mipsnet.c
> @@ -9,19 +9,19 @@
>
>  /* MIPSnet register offsets */
>
> -#define MIPSNET_DEV_ID         0x00
> -#define MIPSNET_BUSY           0x08
> -#define MIPSNET_RX_DATA_COUNT  0x0c
> -#define MIPSNET_TX_DATA_COUNT  0x10
> -#define MIPSNET_INT_CTL                0x14
> -# define MIPSNET_INTCTL_TXDONE         0x00000001
> -# define MIPSNET_INTCTL_RXDONE         0x00000002
> -# define MIPSNET_INTCTL_TESTBIT                0x80000000
> -#define MIPSNET_INTERRUPT_INFO 0x18
> -#define MIPSNET_RX_DATA_BUFFER 0x1c
> -#define MIPSNET_TX_DATA_BUFFER 0x20
> -
> -#define MAX_ETH_FRAME_SIZE     1514
> +#define MIPSNET_DEV_ID          0x00
> +#define MIPSNET_BUSY            0x08
> +#define MIPSNET_RX_DATA_COUNT   0x0c
> +#define MIPSNET_TX_DATA_COUNT   0x10
> +#define MIPSNET_INT_CTL         0x14
> +# define MIPSNET_INTCTL_TXDONE          0x00000001
> +# define MIPSNET_INTCTL_RXDONE          0x00000002
> +# define MIPSNET_INTCTL_TESTBIT         0x80000000
> +#define MIPSNET_INTERRUPT_INFO  0x18
> +#define MIPSNET_RX_DATA_BUFFER  0x1c
> +#define MIPSNET_TX_DATA_BUFFER  0x20
> +
> +#define MAX_ETH_FRAME_SIZE      1514
>
>  #define TYPE_MIPS_NET "mipsnet"
>  #define MIPS_NET(obj) OBJECT_CHECK(MIPSnetState, (obj), TYPE_MIPS_NET)
> @@ -64,8 +64,9 @@ static void mipsnet_update_irq(MIPSnetState *s)
>
>  static int mipsnet_buffer_full(MIPSnetState *s)
>  {
> -    if (s->rx_count >= MAX_ETH_FRAME_SIZE)
> +    if (s->rx_count >= MAX_ETH_FRAME_SIZE) {
>          return 1;
> +    }
>      return 0;
>  }
>
> @@ -73,18 +74,21 @@ static int mipsnet_can_receive(NetClientState *nc)
>  {
>      MIPSnetState *s = qemu_get_nic_opaque(nc);
>
> -    if (s->busy)
> +    if (s->busy) {
>          return 0;
> +    }
>      return !mipsnet_buffer_full(s);
>  }
>
> -static ssize_t mipsnet_receive(NetClientState *nc, const uint8_t *buf,
> size_t size)
> +static ssize_t mipsnet_receive(NetClientState *nc,
> +                               const uint8_t *buf, size_t size)
>  {
>      MIPSnetState *s = qemu_get_nic_opaque(nc);
>
> -    trace_mipsnet_receive(size);
> -    if (!mipsnet_can_receive(nc))
> +    race_mipsnet_receive(size);
> +    if (!mipsnet_can_receive(nc)) {
>          return 0;
> +    }
>
>      if (size >= sizeof(s->rx_buffer)) {
>          return 0;
> @@ -115,10 +119,10 @@ static uint64_t mipsnet_ioport_read(void *opaque,
> hwaddr addr,
>      addr &= 0x3f;
>      switch (addr) {
>      case MIPSNET_DEV_ID:
> -        ret = be32_to_cpu(0x4d495053);         /* MIPS */
> +        ret = be32_to_cpu(0x4d495053);          /* MIPS */
>          break;
>      case MIPSNET_DEV_ID + 4:
> -        ret = be32_to_cpu(0x4e455430);         /* NET0 */
> +        ret = be32_to_cpu(0x4e455430);          /* NET0 */
>          break;
>      case MIPSNET_BUSY:
>          ret = s->busy;
> --
> 2.7.4
>
>
>

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

  reply	other threads:[~2019-12-06 15:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25 13:04 [PATCH 0/5] mips: machines: Renovate coding style Filip Bozuta
2019-11-25 13:04 ` [PATCH 1/5] mips: jazz: " Filip Bozuta
2019-12-06  8:07   ` Aleksandar Markovic
2019-11-25 13:04 ` [PATCH 2/5] mips: malta: " Filip Bozuta
2019-11-30 23:46   ` Aleksandar Markovic
2019-12-02 20:49     ` Eduardo Habkost
2019-12-05 21:27       ` Cleber Rosa
2019-12-06  8:24         ` Aleksandar Markovic
2019-12-01  0:00   ` Aleksandar Markovic
2019-12-01 20:20   ` Philippe Mathieu-Daudé
2019-12-06  8:21     ` Aleksandar Markovic
2019-11-25 13:04 ` [PATCH 3/5] mips: mipssim: " Filip Bozuta
2019-12-06  8:03   ` Aleksandar Markovic [this message]
2019-11-25 13:04 ` [PATCH 4/5] mips: r4000: " Filip Bozuta
2019-12-02  0:08   ` Aleksandar Markovic
2019-11-25 13:04 ` [PATCH 5/5] mips: fulong 2e: " Filip Bozuta
2019-12-01 23:49   ` Aleksandar Markovic
2019-12-06 13:58 [PATCH 0/5] mips: machines: " Filip Bozuta
2019-12-06 13:58 ` [PATCH 3/5] mips: mipssim: " Filip Bozuta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAL1e-=hm-0L0YBSuu0uzwUn+A+MnYB5x-cUUuJWN6NkjqiMqNw@mail.gmail.com' \
    --to=aleksandar.m.mail@gmail.com \
    --cc=Filip.Bozuta@rt-rk.com \
    --cc=aleksandar.rikalo@rt-rk.com \
    --cc=amarkovic@wavecomp.com \
    --cc=aurelien@aurel32.net \
    --cc=hpoussin@reactos.org \
    --cc=pburton@wavecomp.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).