From: Giangiacomo Mariotti Date: Sun, 29 Oct 2006 22:41:51 +0000 Subject: [KJ] [PATCH] cleaning of HANDLE_STACK definition Message-Id: <20061029224151.68009.qmail@web90309.mail.mud.yahoo.com> MIME-Version: 1 Content-Type: multipart/mixed; boundary="0-1031393295-1162161711=:62430" List-Id: References: <20061029191459.92665.qmail@web90313.mail.mud.yahoo.com> In-Reply-To: <20061029191459.92665.qmail@web90313.mail.mud.yahoo.com> To: kernel-janitors@vger.kernel.org This is a multi-part message in MIME format... --0-1031393295-1162161711=:62430 Content-Type: multipart/alternative; boundary="----------=_1162161856-13510-246" Content-Transfer-Encoding: binary MIME-Version: 1.0 X-Mailer: MIME-tools 5.411 (Entity 5.404) This is a multi-part message in MIME format... ------------=_1162161856-13510-246 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Matthew Wilcox wrote : >you've wrapped it past the 80 column boundary, so you'd need to fix that..= .... >you didn't put a signed-off-by on it. This one is my previous patch modified. >I don't think the outer do ..... while is necessary anyway.Is there any pr= oblem >with just deleting them? I thought about it,but then I tried to change this misleading code without = being too destructive,I thought that the previous author could have had a good reason= to use the do{}while(0). Description: clean the definition of HANDLE_STACK in arch/x86_64/kernel/tra= ps.c because it's syntax is misleading. Signed-off-by: Giangiacomo Mariotti ------- =46rom cadb09c6ef0cf2874b1ed3813ea32848cb8c479c Mon Sep 17 00:00:00 2001 From: Giangiacomo Mariotti Date: Sun, 29 Oct 2006 16:22:03 +0100 Subject: [PATCH] cleaning of HANDLE_STACK definition --- arch/x86_64/kernel/traps.c | 32 ++++++++++++++++++-------------- 1 files changed, 18 insertions(+), 14 deletions(-) diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c index 7819022..5573a21 100644 --- a/arch/x86_64/kernel/traps.c +++ b/arch/x86_64/kernel/traps.c @@ -297,20 +297,24 @@ void dump_trace(struct task_struct *tsk, * iteration will eventually trigger. */ #define HANDLE_STACK(cond) \ - do while (cond) { \ - unsigned long addr =3D *stack++; \ - if (oops_in_progress ? \ - __kernel_text_address(addr) : \ - kernel_text_address(addr)) { \ - /* \ - * If the address is either in the text segment of the \ - * kernel, or in the region which contains vmalloc'ed \ - * memory, it *may* be the address of a calling \ - * routine; if so, print it so that someone tracing \ - * down the cause of the crash will be able to figure \ - * out the call path that was taken. \ - */ \ - ops->address(data, addr); \ + do { \ + while (cond) { \ + unsigned long addr =3D *stack++; \ + if (oops_in_progress ? \ + __kernel_text_address(addr) : \ + kernel_text_address(addr)) { \ + /* \ + * If the address is either in the text \ + * segment of the kernel, or in the region \ + * which contains vmalloc'ed memory, it may \ + * be the address of a calling routine; if \ + * so, print it so that someone tracing \ + * down the cause of the crash will be able \ + * to figure out the call path that \ + * was taken. \ + */ \ + ops->address(data, addr); \ + } \ } \ } while (0) =20 --=20 1.4.3.2 ------------=_1162161856-13510-246 Content-Type: text/html; charset=ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Matthew Wilcox wrote :
>you've wrappe= d it past the 80 column boundary, so you'd need to fix that......
>yo= u didn't put a signed-off-by on it.
This one is my previous patch modifi= ed.
>I don't think the outer do ..... while is necessary anyway.Is th= ere any problem
>with just deleting them?
I thought about it,but t= hen I tried to change this misleading code without being too
destructive= ,I thought that the previous author could have had a good reason to
use = the do{}while(0).

Description: clean the definition of HANDLE_STACK = in arch/x86_64/kernel/traps.c
       =              be= cause it's syntax is misleading.
Signed-off-by: Giangiacomo Mariotti <giangiacomo_mariotti@yahoo.com>

-------

From cadb09c6= ef0cf2874b1ed3813ea32848cb8c479c Mon Sep 17 00:00:00 2001
From: Giangiac= omo Mariotti <giangiacomo_mariotti@yahoo.com>
Date: Sun, 29 Oct 20= 06 16:22:03 +0100
Subject: [PATCH] cleaning of HANDLE_STACK definition
---
 arch/x86_64/kernel/traps.c |   32 ++++++++++++= ++++++--------------
 1 files changed, 18 insertions(+), 14 deletio= ns(-)

diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/t= raps.c
index 7819022..5573a21 100644
--- a/arch/x86_64/kernel/traps.c=
+++ b/arch/x86_64/kernel/traps.c
@@ -297,20 +297,24 @@ void dump_tra= ce(struct task_struct *tsk,
      * iteration w= ill eventually trigger.
      */
 #defi= ne HANDLE_STACK(cond) \
-    do while (cond) { \
-&nbs= p;       unsigned long addr =3D *stack++; \
-        if (oops_in_progress ?  &= nbsp;      \
-        =     __kernel_text_address(addr) : \
-    &= nbsp;       kernel_text_address(addr)) { \
-&nb= sp;           /* \
-  =            * If the address is eith= er in the text segment of the \
-        &= nbsp;    * kernel, or in the region which contains vmalloc'e= d \
-             * me= mory, it *may* be the address of a calling \
-     &= nbsp;       * routine; if so, print it so that som= eone tracing \
-           =  * down the cause of the crash will be able to figure \
- &nb= sp;           * out the call path that was t= aken. \
-             = */ \
-            ops->a= ddress(data, addr);   \
+    do { \
+ &= nbsp;      while (cond) { \
+    &nbs= p;       unsigned long addr =3D *stack++; \
+&n= bsp;           if (oops_in_progress= ?         \
+     &nb= sp;          __kernel_text_address(addr)= : \
+             &nb= sp;  kernel_text_address(addr)) { \
+      = ;          /* \
+    &= nbsp;           * If the address is= either in the text \
+             =    * segment of the kernel, or in the region \
+  &n= bsp;             * which conta= ins vmalloc'ed memory, it may \
+        &= nbsp;       * be the address of a calling routine;= if \
+             &n= bsp;  * so, print it so that someone tracing \
+    =             * down the cause o= f the crash will be able \
+         =        * to figure out the call path that \
+&n= bsp;               *= was taken. \
+            =     */ \
+         &nb= sp;      ops->address(data, addr);   \
+ &n= bsp;          } \
   &= nbsp;     } \
     } while (0)
&nb= sp;
--
1.4.3.2



------------=_1162161856-13510-246-- --0-1031393295-1162161711=:62430 Content-Type: text/plain; name="=?utf-8?q?0001-cleaning-of-HANDLE=5FSTACK-definition.txt?=" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="=?utf-8?q?0001-cleaning-of-HANDLE=5FSTACK-definition.txt?=" RnJvbSBjYWRiMDljNmVmMGNmMjg3NGIxZWQzODEzZWEzM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ZSBjcmFzaCB3aWxsIGJlIGFi bGUgXAorCQkJCSogdG8gZmlndXJlIG91dCB0aGUgY2FsbCBwYXRoIHRoYXQg XAorCQkJCSogd2FzIHRha2VuLiBcCisJCQkJKi8gXAorCQkJCW9wcy0+YWRk cmVzcyhkYXRhLCBhZGRyKTsgICBcCisJCQl9IFwKIAkJfSBcCiAJfSB3aGls ZSAoMCkKIAotLSAKMS40LjMuMgoK --0-1031393295-1162161711=:62430 Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.osdl.org https://lists.osdl.org/mailman/listinfo/kernel-janitors --0-1031393295-1162161711=:62430--