Skip to contentSkip to conversation

traps: coding style fixes

PATCH Superseded Andrii Anisov 4 participants 9 messages Sep 11, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 traps: coding style fixes

From: Andrii Anisov <[email protected]>

---
 xen/arch/arm/traps.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
xen/arch/arm/traps.c +8 -4
index 9ae64ae..45fb3d5 100644
@@ -244,7 +244,8 @@ static register_t *select_user_reg(struct cpu_user_regs *regs, int reg)
      */
 #define REGOFFS(R) offsetof(struct cpu_user_regs, R)
 
-    switch ( reg ) {
+    switch ( reg )
+    {
     case 0 ... 7: /* Unbanked registers */
         BUILD_BUG_ON(REGOFFS(r0) + 7*sizeof(register_t) != REGOFFS(r7));
         return &regs->r0 + reg;
@@ -1429,7 +1430,8 @@ static void do_debug_trap(struct cpu_user_regs *regs, unsigned int code)
 {
     uint32_t reg;
     uint32_t domid = current->domain->domain_id;
-    switch ( code ) {
+    switch ( code )
+    {
     case 0xe0 ... 0xef:
         reg = code - 0xe0;
         printk("DOM%d: R%d = 0x%"PRIregister" at 0x%"PRIvaddr"\n",
@@ -2071,7 +2073,8 @@ void do_trap_guest_sync(struct cpu_user_regs *regs)
 
     enter_hypervisor_head(regs);
 
-    switch (hsr.ec) {
+    switch (hsr.ec)
+    {
     case HSR_EC_WFI_WFE:
         /*
          * HCR_EL2.TWI, HCR_EL2.TWE
@@ -2270,7 +2273,8 @@ void leave_hypervisor_tail(void)
     while (1)
     {
         local_irq_disable();
-        if (!softirq_pending(smp_processor_id())) {
+        if (!softirq_pending(smp_processor_id()))
+        {
             vgic_sync_to_lrs();
 
             /*
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 11.09.18 at 09:18, <[email protected]> wrote:

From: Andrii Anisov <[email protected]>

---
 xen/arch/arm/traps.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Two things: Could you please make your subject make clear this is about ARM, so that people know whether to look at the patch?

And - since this pattern repeats - could you please refrain from spamming the list by sending all of your patches twice (once To the list, and once with the list on Cc; I've dropped the To part here, while you should drop the Cc part)?

Thanks, Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw

Hello Jan,

Quoted 2 lines · Jan Beulich

Two things: Could you please make your subject make clear this is about ARM, so that people know whether to look at the patch?

Got it.

Quoted 4 lines

And - since this pattern repeats - could you please refrain from spamming the list by sending all of your patches twice (once To the list, and once with the list on Cc; I've dropped the To part here, while you should drop the Cc part)?

I guess it's a result of git send-email --cc-cmd=scripts/get_maintainer.pl.... I'll review my publishing steps to avoid this.

Signature · 8 lines
*Andrii Anisov*



_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#3 lore raw
Quoted 8 lines · Andrii Anisov

Hello Jan,

Quoted 2 lines · Jan Beulich

Two things: Could you please make your subject make clear this is about ARM, so that people know whether to look at the patch?

Got it.

Quoted 7 lines
Quoted 4 lines

And - since this pattern repeats - could you please refrain from spamming the list by sending all of your patches twice (once To the list, and once with the list on Cc; I've dropped the To part here, while you should drop the Cc part)?

I guess it's a result of git send-email --cc-cmd=scripts/get_maintainer.pl.... I'll review my publishing steps to avoid this.

What's your full command? All occurrence of xen.org has been removed a while ago... So it should not happen unless you use an old tree.

With Xen 4.11 and onwards, you can use scripts/add_maintainer.pl. It will add CC for maintainers of each patch and cover letter.

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#4 lore raw

Hello Julien,

Hello Julien,

Quoted 1 line · Julien Grall

What's your full command?

For this particular patch it was:
    git format-patch -1 --to "[email protected]"
    git send-email --cc-cmd=scripts/get_maintainer.pl 0001-traps-coding-style-fixes.patch

Quoted 1 line

All occurrence of xen.org has been removed a while ago... So it should not happen unless you use an old tree.

And was done on top of the current master:

   aanisov@aanisov-work:~/DEV/temp/xen$ git show --oneline --decorate
   1d069e4 (HEAD, origin/staging, origin/smoke, origin/master,
   origin/coverity-tested/smoke, origin/HEAD) mkdeb: use compression
   level 0
   diff --git a/tools/misc/mkdeb b/tools/misc/mkdeb
   index 67b91cc..f4befcc 100644
   --- a/tools/misc/mkdeb
   +++ b/tools/misc/mkdeb
   @@ -59,7 +59,7 @@ find deb/etc -type f -printf /etc/%P\\n
Quoted 1 line

deb/DEBIAN/conffiles

 # Package it up
 chown -R root:root deb
-dpkg --build deb xen-upstream-$version.deb +dpkg-deb --build -z0 deb xen-upstream-$version.deb

 # Tidy up after ourselves
 rm -rf deb

   aanisov@aanisov-work:~/DEV/temp/xen$ grep -i "xen-devel" MAINTAINERS
   Backport requests should be made on the [email protected]
   L:    [email protected]
   L:    [email protected]
   L:    [email protected]
   L:    [email protected]
Signature · 8 lines
*Andrii Anisov*



_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#5 lore raw
Quoted 8 lines · Andrii Anisov

Hello Julien,

Hello Julien,

Quoted 1 line · Julien Grall

What's your full command?

For this particular patch it was:
    git format-patch -1 --to "[email protected]"

That's your problem. You are using a deprecated e-mail address here. This should be replaced by [email protected].

But the --to here should not be necessary. The scripts add_maintainers.pl will make sure the xen-devel will be on the to.

Quoted 31 lines

    git send-email --cc-cmd=scripts/get_maintainer.pl
0001-traps-coding-style-fixes.patch

Quoted 1 line

All occurrence of xen.org has been removed a while ago... So it should not happen unless you use an old tree.

And was done on top of the current master:

    aanisov@aanisov-work:~/DEV/temp/xen$ git show --oneline --decorate
    1d069e4 (HEAD, origin/staging, origin/smoke, origin/master,
    origin/coverity-tested/smoke, origin/HEAD) mkdeb: use compression
    level 0
    diff --git a/tools/misc/mkdeb b/tools/misc/mkdeb
    index 67b91cc..f4befcc 100644
    --- a/tools/misc/mkdeb
    +++ b/tools/misc/mkdeb
    @@ -59,7 +59,7 @@ find deb/etc -type f -printf /etc/%P\\n
     >deb/DEBIAN/conffiles

     # Package it up
     chown -R root:root deb
   -dpkg --build deb xen-upstream-$version.deb +dpkg-deb --build -z0 deb xen-upstream-$version.deb

     # Tidy up after ourselves
     rm -rf deb

    aanisov@aanisov-work:~/DEV/temp/xen$ grep -i "xen-devel" MAINTAINERS
    Backport requests should be made on the [email protected]
    L:    [email protected]
    L:    [email protected]
    L:    [email protected]
    L:    [email protected]
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#6 lore raw

Hello Julien,

Quoted 1 line · Julien Grall

That's your problem. You are using a deprecated e-mail address here. This should be replaced by [email protected].

I've got the point.
Thank you for taking care to help me sort it out.

Quoted 1 line

But the --to here should not be necessary. The scripts add_maintainers.pl will make sure the xen-devel will be on the to.

I'll try it with the next nit.

Signature · 8 lines
*Andrii Anisov*



_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#7 lore raw
In reply to Andrii Anisov
Quoted 22 lines · Andrii Anisov

From: Andrii Anisov <[email protected]>

---
  xen/arch/arm/traps.c | 12 ++++++++----
  1 file changed, 8 insertions(+), 4 deletions(-)
xen/arch/arm/traps.c +2 -1
index 9ae64ae..45fb3d5 100644
@@ -244,7 +244,8 @@ static register_t *select_user_reg(struct cpu_user_regs *regs, int reg)
       */
  #define REGOFFS(R) offsetof(struct cpu_user_regs, R)
 
-    switch ( reg ) {
+    switch ( reg )
+    {
      case 0 ... 7: /* Unbanked registers */
          BUILD_BUG_ON(REGOFFS(r0) + 7*sizeof(register_t) != REGOFFS(r7));
          return &regs->r0 + reg;

xen/arch/arm/traps.c static void do_debug_trap(struct cpu_user_regs *regs, unsigned int code) · line 1432

Quoted 3 lines
xen/arch/arm/traps.c +0 -0
@@ -1429,7 +1430,8 @@ static void do_debug_trap(struct cpu_user_regs *regs, unsigned int code)
  {
      uint32_t reg;
      uint32_t domid = current->domain->domain_id;

While you are at fixing coding style: newline here.

xen/arch/arm/traps.c void do_trap_guest_sync(struct cpu_user_regs *regs) · line 2076

Quoted 12 lines
xen/arch/arm/traps.c +3 -2
-    switch ( code ) {
+    switch ( code )
+    {
      case 0xe0 ... 0xef:
          reg = code - 0xe0;
          printk("DOM%d: R%d = 0x%"PRIregister" at 0x%"PRIvaddr"\n",
@@ -2071,7 +2073,8 @@ void do_trap_guest_sync(struct cpu_user_regs *regs)
 
      enter_hypervisor_head(regs);
 
-    switch (hsr.ec) {
+    switch (hsr.ec)

Xen coding style requires space after ( and before ).

xen/arch/arm/traps.c void leave_hypervisor_tail(void) · line 2276

Quoted 10 lines
xen/arch/arm/traps.c +2 -1
+    {
      case HSR_EC_WFI_WFE:
          /*
           * HCR_EL2.TWI, HCR_EL2.TWE
@@ -2270,7 +2273,8 @@ void leave_hypervisor_tail(void)
      while (1)
      {
          local_irq_disable();
-        if (!softirq_pending(smp_processor_id())) {
+        if (!softirq_pending(smp_processor_id()))

Same here.

xen/arch/arm/traps.c void leave_hypervisor_tail(void) · line 2280

Quoted 5 lines
xen/arch/arm/traps.c +1 -0
+        {
              vgic_sync_to_lrs();
 
              /*

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#8 lore raw
Quoted 22 lines · Julien Grall

xen/arch/arm/traps.c static void do_debug_trap(struct cpu_user_regs · line 1433

Quoted 5 lines
xen/arch/arm/traps.c +0 -0
@@ -1429,7 +1430,8 @@ static void do_debug_trap(struct cpu_user_regs 
 *regs, unsigned int code)
   {
       uint32_t reg;
       uint32_t domid = current->domain->domain_id;

While you are at fixing coding style: newline here.

xen/arch/arm/traps.c void do_trap_guest_sync(struct cpu_user_regs · line 2076

Quoted 11 lines
xen/arch/arm/traps.c +2 -1
-    switch ( code ) {
+    switch ( code )
+    {

      case 0xe0 ... 0xef:
          reg = code - 0xe0;
          printk("DOM%d: R%d = 0x%"PRIregister" at 0x%"PRIvaddr"\n",

xen/arch/arm/traps.c +1 -0
@@ -2071,7 +2073,8 @@ void do_trap_guest_sync(struct cpu_user_regs 
 *regs)
         enter_hypervisor_head(regs);
   -    switch (hsr.ec) {
+    switch (hsr.ec)

Xen coding style requires space after ( and before ).

Quoted 12 lines

xen/arch/arm/traps.c void leave_hypervisor_tail(void) · line 2276

Quoted 10 lines
(quoted diff) +1 -0
+    {

      case HSR_EC_WFI_WFE:
          /*
           * HCR_EL2.TWI, HCR_EL2.TWE

xen/arch/arm/traps.c +1 -1
@@ -2270,7 +2273,8 @@ void leave_hypervisor_tail(void)
       while (1)
       {
           local_irq_disable();
-        if (!softirq_pending(smp_processor_id())) {
+        if (!softirq_pending(smp_processor_id()))

Same here.

Yep.

Signature · 8 lines
*Andrii Anisov*



_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel