qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] ccd801: hw/block/pflash_cfi: Fix code style f


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] ccd801: hw/block/pflash_cfi: Fix code style for checkpatch.pl
Date: Thu, 18 Mar 2021 16:10:26 -0700

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: ccd8014b813897886eae4ed5c725eb9dc5eedbd3
      
https://github.com/qemu/qemu/commit/ccd8014b813897886eae4ed5c725eb9dc5eedbd3
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-03-18 (Thu, 18 Mar 2021)

  Changed paths:
    M hw/block/pflash_cfi01.c
    M hw/block/pflash_cfi02.c

  Log Message:
  -----------
  hw/block/pflash_cfi: Fix code style for checkpatch.pl

We are going to move this code, fix its style first.

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: David Edmondson <david.edmondson@oracle.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210310170528.1184868-2-philmd@redhat.com>


  Commit: a42cd11bd34939edd92b312093c8b56487587ff6
      
https://github.com/qemu/qemu/commit/a42cd11bd34939edd92b312093c8b56487587ff6
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-03-18 (Thu, 18 Mar 2021)

  Changed paths:
    M hw/block/pflash_cfi01.c

  Log Message:
  -----------
  hw/block/pflash_cfi01: Extract pflash_cfi01_fill_cfi_table()

Fill the CFI table in out of DeviceRealize() in a new function:
pflash_cfi01_fill_cfi_table().

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: David Edmondson <david.edmondson@oracle.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210310170528.1184868-3-philmd@redhat.com>


  Commit: 4586c2e5d5cd625b36052d5bd9ef0dee69a5c5c6
      
https://github.com/qemu/qemu/commit/4586c2e5d5cd625b36052d5bd9ef0dee69a5c5c6
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-03-18 (Thu, 18 Mar 2021)

  Changed paths:
    M hw/block/pflash_cfi02.c

  Log Message:
  -----------
  hw/block/pflash_cfi02: Extract pflash_cfi02_fill_cfi_table()

Fill the CFI table in out of DeviceRealize() in a new function:
pflash_cfi02_fill_cfi_table().

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: David Edmondson <david.edmondson@oracle.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210310170528.1184868-4-philmd@redhat.com>


  Commit: 326d02c34a92f6e30fa3231be83efda43bac36f8
      
https://github.com/qemu/qemu/commit/326d02c34a92f6e30fa3231be83efda43bac36f8
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-03-18 (Thu, 18 Mar 2021)

  Changed paths:
    M hw/block/pflash_cfi02.c

  Log Message:
  -----------
  hw/block/pflash_cfi02: Set rom_mode to true in pflash_setup_mappings()

There is only one call to pflash_setup_mappings(). Convert 'rom_mode'
to boolean and set it to true directly within pflash_setup_mappings().

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: David Edmondson <david.edmondson@oracle.com>
Message-Id: <20210310170528.1184868-5-philmd@redhat.com>


  Commit: cadf25cfaa8d495c8e642cda49eda074352a8fc8
      
https://github.com/qemu/qemu/commit/cadf25cfaa8d495c8e642cda49eda074352a8fc8
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-03-18 (Thu, 18 Mar 2021)

  Changed paths:
    M hw/block/pflash_cfi02.c

  Log Message:
  -----------
  hw/block/pflash_cfi02: Open-code pflash_register_memory(rom=false)

There is only one call to pflash_register_memory() with
rom_mode == false. As we want to modify pflash_register_memory()
in the next patch, open-code this trivial function in place for
the 'rom_mode == false' case.

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: David Edmondson <david.edmondson@oracle.com>
Message-Id: <20210310170528.1184868-6-philmd@redhat.com>


  Commit: 7cb1096021fa749f9dc50a3ff074c2101680741c
      
https://github.com/qemu/qemu/commit/7cb1096021fa749f9dc50a3ff074c2101680741c
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-03-18 (Thu, 18 Mar 2021)

  Changed paths:
    M hw/block/pflash_cfi02.c
    M hw/block/trace-events

  Log Message:
  -----------
  hw/block/pflash_cfi02: Rename register_memory(true) as mode_read_array

The same pattern is used when setting the flash in READ_ARRAY mode:
- Set the state machine command to READ_ARRAY
- Reset the write_cycle counter
- Reset the memory region in ROMD

Refactor the current code by extracting this pattern.
It is used three times:

- When the timer expires and not in bypass mode

- On a read access (on invalid command).

- When the device is initialized. Here the ROMD mode is hidden
  by the memory_region_init_rom_device() call.

pflash_register_memory(rom_mode=true) already sets the ROM device
in "read array" mode (from I/O device to ROM one). Explicit that
by renaming the function as pflash_mode_read_array(), adding
a trace event and resetting wcycle.

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: David Edmondson <david.edmondson@oracle.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210310170528.1184868-7-philmd@redhat.com>


  Commit: 7d1df53f14a26fa95ebee9767d3a4fac281fd70f
      
https://github.com/qemu/qemu/commit/7d1df53f14a26fa95ebee9767d3a4fac281fd70f
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-03-18 (Thu, 18 Mar 2021)

  Changed paths:
    M hw/block/pflash_cfi02.c

  Log Message:
  -----------
  hw/block/pflash_cfi02: Factor out pflash_reset_state_machine()

There is multiple places resetting the internal state machine.
Factor the code out in a new pflash_reset_state_machine() method.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: David Edmondson <david.edmondson@oracle.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20210310170528.1184868-8-philmd@redhat.com>


  Commit: d9106341657198096fed7e7c116cd9af606b59c5
      
https://github.com/qemu/qemu/commit/d9106341657198096fed7e7c116cd9af606b59c5
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-03-18 (Thu, 18 Mar 2021)

  Changed paths:
    M hw/block/pflash_cfi02.c

  Log Message:
  -----------
  hw/block/pflash_cfi02: Add DeviceReset method

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: David Edmondson <david.edmondson@oracle.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20210310170528.1184868-9-philmd@redhat.com>


  Commit: 2b49cd652a1df7e0120d75e3e13665410672682e
      
https://github.com/qemu/qemu/commit/2b49cd652a1df7e0120d75e3e13665410672682e
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-03-18 (Thu, 18 Mar 2021)

  Changed paths:
    M hw/block/pflash_cfi01.c

  Log Message:
  -----------
  hw/block/pflash_cfi01: Clarify trace events

Use the 'mode_read_array' event when we set the device in such
mode, and use the 'reset' event in DeviceReset handler.

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: David Edmondson <david.edmondson@oracle.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210310170528.1184868-10-philmd@redhat.com>


  Commit: 2231bee28c03a60836fc75bc737448042e33272b
      
https://github.com/qemu/qemu/commit/2231bee28c03a60836fc75bc737448042e33272b
  Author: David Edmondson <david.edmondson@oracle.com>
  Date:   2021-03-18 (Thu, 18 Mar 2021)

  Changed paths:
    M hw/block/pflash_cfi01.c

  Log Message:
  -----------
  hw/block/pflash_cfi01: Correct the type of PFlashCFI01.ro

PFlashCFI01.ro is a bool, declare it as such.

Signed-off-by: David Edmondson <david.edmondson@oracle.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210216142721.1985543-3-david.edmondson@oracle.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


  Commit: 91316cbb3830bb845c42da2d6eab06de56b889b0
      
https://github.com/qemu/qemu/commit/91316cbb3830bb845c42da2d6eab06de56b889b0
  Author: David Edmondson <david.edmondson@oracle.com>
  Date:   2021-03-18 (Thu, 18 Mar 2021)

  Changed paths:
    M hw/block/pflash_cfi01.c
    M hw/block/pflash_cfi02.c
    M hw/block/trace-events

  Log Message:
  -----------
  hw/block/pflash_cfi: Replace DPRINTF with trace events

Rather than having a device specific debug implementation in
pflash_cfi01.c and pflash_cfi02.c, use the standard tracing facility.

Signed-off-by: David Edmondson <david.edmondson@oracle.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210216142721.1985543-2-david.edmondson@oracle.com>
[PMD: Rebased, fixed pflash_write_block_erase trace event format]
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


  Commit: cf6b56d4f2107259f52413f979a1d474dad0c1e1
      
https://github.com/qemu/qemu/commit/cf6b56d4f2107259f52413f979a1d474dad0c1e1
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-03-18 (Thu, 18 Mar 2021)

  Changed paths:
    M hw/block/pflash_cfi01.c
    M hw/block/pflash_cfi02.c
    M hw/block/trace-events

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/philmd/tags/pflash-20210318' into 
staging

Parallel NOR Flash patches queue

- Code movement to ease maintainability
- Tracing improvements

# gpg: Signature made Thu 18 Mar 2021 15:44:12 GMT
# gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" 
[full]
# Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE

* remotes/philmd/tags/pflash-20210318:
  hw/block/pflash_cfi: Replace DPRINTF with trace events
  hw/block/pflash_cfi01: Correct the type of PFlashCFI01.ro
  hw/block/pflash_cfi01: Clarify trace events
  hw/block/pflash_cfi02: Add DeviceReset method
  hw/block/pflash_cfi02: Factor out pflash_reset_state_machine()
  hw/block/pflash_cfi02: Rename register_memory(true) as mode_read_array
  hw/block/pflash_cfi02: Open-code pflash_register_memory(rom=false)
  hw/block/pflash_cfi02: Set rom_mode to true in pflash_setup_mappings()
  hw/block/pflash_cfi02: Extract pflash_cfi02_fill_cfi_table()
  hw/block/pflash_cfi01: Extract pflash_cfi01_fill_cfi_table()
  hw/block/pflash_cfi: Fix code style for checkpatch.pl

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/8a40754bca14...cf6b56d4f210



reply via email to

[Prev in Thread] Current Thread [Next in Thread]