diff mbox

fix bad indentation in pcie_cap_slot_write_config()

Message ID 1445761408-10308-1-git-send-email-caoj.fnst@cn.fujitsu.com
State New
Headers show

Commit Message

Cao jin Oct. 25, 2015, 8:23 a.m. UTC
bad indentation conflicts with CODING_STYLE doc

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
 hw/pci/pcie.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Cao jin Oct. 26, 2015, 12:07 p.m. UTC | #1
Sorry, I just find that maybe I should cc this patch to 
qemu-trivial@nongnu.org

On 10/25/2015 04:23 PM, Cao jin wrote:
> bad indentation conflicts with CODING_STYLE doc
>
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> ---
>   hw/pci/pcie.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
> index 6e28985..e4bfe91 100644
> --- a/hw/pci/pcie.c
> +++ b/hw/pci/pcie.c
> @@ -413,13 +413,13 @@ void pcie_cap_slot_write_config(PCIDevice *dev,
>        */
>       if ((sltsta & PCI_EXP_SLTSTA_PDS) && (val & PCI_EXP_SLTCTL_PCC) &&
>           ((val & PCI_EXP_SLTCTL_PIC_OFF) == PCI_EXP_SLTCTL_PIC_OFF)) {
> -            PCIBus *sec_bus = pci_bridge_get_sec_bus(PCI_BRIDGE(dev));
> -            pci_for_each_device(sec_bus, pci_bus_num(sec_bus),
> -                                pcie_unplug_device, NULL);
> +        PCIBus *sec_bus = pci_bridge_get_sec_bus(PCI_BRIDGE(dev));
> +        pci_for_each_device(sec_bus, pci_bus_num(sec_bus),
> +                            pcie_unplug_device, NULL);
>
> -            pci_word_test_and_clear_mask(exp_cap + PCI_EXP_SLTSTA,
> -                                         PCI_EXP_SLTSTA_PDS);
> -            pci_word_test_and_set_mask(exp_cap + PCI_EXP_SLTSTA,
> +        pci_word_test_and_clear_mask(exp_cap + PCI_EXP_SLTSTA,
> +                                     PCI_EXP_SLTSTA_PDS);
> +        pci_word_test_and_set_mask(exp_cap + PCI_EXP_SLTSTA,
>                                          PCI_EXP_SLTSTA_PDC);
>       }
>
>
Michael S. Tsirkin Oct. 26, 2015, 12:16 p.m. UTC | #2
On Mon, Oct 26, 2015 at 08:07:34PM +0800, Cao jin wrote:
> Sorry, I just find that maybe I should cc this patch to
> qemu-trivial@nongnu.org

Indeed.

> On 10/25/2015 04:23 PM, Cao jin wrote:
> >bad indentation conflicts with CODING_STYLE doc
> >
> >Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> >---
> >  hw/pci/pcie.c | 12 ++++++------
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> >
> >diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
> >index 6e28985..e4bfe91 100644
> >--- a/hw/pci/pcie.c
> >+++ b/hw/pci/pcie.c
> >@@ -413,13 +413,13 @@ void pcie_cap_slot_write_config(PCIDevice *dev,
> >       */
> >      if ((sltsta & PCI_EXP_SLTSTA_PDS) && (val & PCI_EXP_SLTCTL_PCC) &&
> >          ((val & PCI_EXP_SLTCTL_PIC_OFF) == PCI_EXP_SLTCTL_PIC_OFF)) {
> >-            PCIBus *sec_bus = pci_bridge_get_sec_bus(PCI_BRIDGE(dev));
> >-            pci_for_each_device(sec_bus, pci_bus_num(sec_bus),
> >-                                pcie_unplug_device, NULL);
> >+        PCIBus *sec_bus = pci_bridge_get_sec_bus(PCI_BRIDGE(dev));
> >+        pci_for_each_device(sec_bus, pci_bus_num(sec_bus),
> >+                            pcie_unplug_device, NULL);
> >
> >-            pci_word_test_and_clear_mask(exp_cap + PCI_EXP_SLTSTA,
> >-                                         PCI_EXP_SLTSTA_PDS);
> >-            pci_word_test_and_set_mask(exp_cap + PCI_EXP_SLTSTA,
> >+        pci_word_test_and_clear_mask(exp_cap + PCI_EXP_SLTSTA,
> >+                                     PCI_EXP_SLTSTA_PDS);
> >+        pci_word_test_and_set_mask(exp_cap + PCI_EXP_SLTSTA,
> >                                         PCI_EXP_SLTSTA_PDC);
> >      }
> >
> >
> 
> -- 
> Yours Sincerely,
> 
> Cao Jin
Michael Tokarev Oct. 29, 2015, 7:45 a.m. UTC | #3
25.10.2015 11:23, Cao jin wrote:
> bad indentation conflicts with CODING_STYLE doc

I don't like patches which just change coding style.
It is often agreed that when you fix some code you
can also fix indentation of surrounding code, but
just fixing coding style isn't very productive.

Yet I'm applying this one.  Maybe it is the last
case like this.. ;)

Thanks,

/mjt
Cao jin Oct. 29, 2015, 7:57 a.m. UTC | #4
Thanks Michael. and I am sorry if it bothered you.
Maybe it can be avoid to have a clear definition of "trivial" to direct 
the newbies like me:P

On 10/29/2015 03:45 PM, Michael Tokarev wrote:
> 25.10.2015 11:23, Cao jin wrote:
>> bad indentation conflicts with CODING_STYLE doc
>
> I don't like patches which just change coding style.
> It is often agreed that when you fix some code you
> can also fix indentation of surrounding code, but
> just fixing coding style isn't very productive.
>
> Yet I'm applying this one.  Maybe it is the last
> case like this.. ;)
>
> Thanks,
>
> /mjt
>
Michael Tokarev Oct. 29, 2015, 8:07 a.m. UTC | #5
29.10.2015 10:57, Cao jin wrote:
> Thanks Michael. and I am sorry if it bothered you.

There's nothing to worry about, really.

> Maybe it can be avoid to have a clear definition of "trivial" to direct the newbies like me:P

It is a general common sense maybe, I dunno.  There's lot of code which does not
comply with the coding styles, and at the very least, when you change just that
without actually changing the code, git blame stops working, showing your non-
change for everything instead of showing actual _code_ changes.  That's one of
the reasons why all qemu codebase hasn't been translated by some automatic
coding style formatting tool.

Thanks,

/mjt
Cao jin Oct. 29, 2015, 8:28 a.m. UTC | #6
On 10/29/2015 04:07 PM, Michael Tokarev wrote:

> It is a general common sense maybe, I dunno.  There's lot of code which does not
> comply with the coding styles, and at the very least, when you change just that
> without actually changing the code, git blame stops working, showing your non-
> change for everything instead of showing actual _code_ changes.  That's one of
> the reasons why all qemu codebase hasn't been translated by some automatic
> coding style formatting tool.
>

I see. Thanks for sharing the thing about "git blame", I do not know 
this before:)

> Thanks,
>
> /mjt
>
diff mbox

Patch

diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index 6e28985..e4bfe91 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -413,13 +413,13 @@  void pcie_cap_slot_write_config(PCIDevice *dev,
      */
     if ((sltsta & PCI_EXP_SLTSTA_PDS) && (val & PCI_EXP_SLTCTL_PCC) &&
         ((val & PCI_EXP_SLTCTL_PIC_OFF) == PCI_EXP_SLTCTL_PIC_OFF)) {
-            PCIBus *sec_bus = pci_bridge_get_sec_bus(PCI_BRIDGE(dev));
-            pci_for_each_device(sec_bus, pci_bus_num(sec_bus),
-                                pcie_unplug_device, NULL);
+        PCIBus *sec_bus = pci_bridge_get_sec_bus(PCI_BRIDGE(dev));
+        pci_for_each_device(sec_bus, pci_bus_num(sec_bus),
+                            pcie_unplug_device, NULL);
 
-            pci_word_test_and_clear_mask(exp_cap + PCI_EXP_SLTSTA,
-                                         PCI_EXP_SLTSTA_PDS);
-            pci_word_test_and_set_mask(exp_cap + PCI_EXP_SLTSTA,
+        pci_word_test_and_clear_mask(exp_cap + PCI_EXP_SLTSTA,
+                                     PCI_EXP_SLTSTA_PDS);
+        pci_word_test_and_set_mask(exp_cap + PCI_EXP_SLTSTA,
                                        PCI_EXP_SLTSTA_PDC);
     }