From: Nico Boehr <nrb@linux.ibm.com>
To: frankja@linux.ibm.com, imbrenda@linux.ibm.com, thuth@redhat.com,
david@redhat.com, pbonzini@redhat.com, andrew.jones@linux.dev,
lvivier@redhat.com
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: [kvm-unit-tests PATCH v1 08/10] s390x: gs: turn off formatter for inline assembly
Date: Mon, 6 Nov 2023 13:51:04 +0100 [thread overview]
Message-ID: <20231106125352.859992-9-nrb@linux.ibm.com> (raw)
In-Reply-To: <20231106125352.859992-1-nrb@linux.ibm.com>
clang-format does not properly understand the code and aligns the first
opening quote on consecutive lines with the last opening quote on the
previous line like so:
" some string " CONCATED_WITH_MACRO " continues here "
" weird indent for some reason"
Disable clang-format for this block of code and properly align the
indented asm with the opening parenthesis.
Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
---
s390x/gs.c | 44 +++++++++++++++++++++++---------------------
1 file changed, 23 insertions(+), 21 deletions(-)
diff --git a/s390x/gs.c b/s390x/gs.c
index 9ae893eaf89a..7e08c2a78d32 100644
--- a/s390x/gs.c
+++ b/s390x/gs.c
@@ -35,28 +35,30 @@ static inline unsigned long load_guarded(unsigned long *p)
}
/* guarded-storage event handler and finally it calls gs_handler */
+/* clang-format off */
extern void gs_handler_asm(void);
- asm ( ".macro STGSC args:vararg\n"
- " .insn rxy,0xe30000000049,\\args\n"
- " .endm\n"
- " .globl gs_handler_asm\n"
- "gs_handler_asm:\n"
- " lgr %r14,%r15\n" /* Save current stack address in r14 */
- ".Lgs_handler_frame = 16*8+32+" xstr(STACK_FRAME_SIZE) "\n"
- " aghi %r15,-(.Lgs_handler_frame)\n" /* Allocate stack frame */
- " stmg %r0,%r13,192(%r15)\n" /* Store regs to save area */
- " stg %r14,312(%r15)\n"
- " la %r2," xstr(STACK_FRAME_SIZE) "(%r15)\n" /* Store gscb address in this_cb */
- " STGSC %r0," xstr(STACK_FRAME_SIZE) "(%r15)\n"
- " lg %r14,24(%r2)\n" /* Get GSEPLA from GSCB*/
- " lg %r14,40(%r14)\n" /* Get GSERA from GSEPL*/
- " stg %r14,304(%r15)\n" /* Store GSERA in r14 of reg save area */
- " brasl %r14,gs_handler\n" /* Jump to gs_handler */
- " lmg %r0,%r15,192(%r15)\n" /* Restore regs */
- " aghi %r14, 6\n" /* Add lgg instr len to GSERA */
- " br %r14\n" /* Jump to next instruction after lgg */
- ".size gs_handler_asm,.-gs_handler_asm\n"
- );
+asm (".macro STGSC args:vararg\n"
+ " .insn rxy,0xe30000000049,\\args\n"
+ " .endm\n"
+ " .globl gs_handler_asm\n"
+ "gs_handler_asm:\n"
+ " lgr %r14,%r15\n" /* Save current stack address in r14 */
+ ".Lgs_handler_frame = 16*8+32+" xstr(STACK_FRAME_SIZE) "\n"
+ " aghi %r15,-(.Lgs_handler_frame)\n" /* Allocate stack frame */
+ " stmg %r0,%r13,192(%r15)\n" /* Store regs to save area */
+ " stg %r14,312(%r15)\n"
+ " la %r2," xstr(STACK_FRAME_SIZE) "(%r15)\n" /* Store gscb address in this_cb */
+ " STGSC %r0," xstr(STACK_FRAME_SIZE) "(%r15)\n"
+ " lg %r14,24(%r2)\n" /* Get GSEPLA from GSCB*/
+ " lg %r14,40(%r14)\n" /* Get GSERA from GSEPL*/
+ " stg %r14,304(%r15)\n" /* Store GSERA in r14 of reg save area */
+ " brasl %r14,gs_handler\n" /* Jump to gs_handler */
+ " lmg %r0,%r15,192(%r15)\n" /* Restore regs */
+ " aghi %r14, 6\n" /* Add lgg instr len to GSERA */
+ " br %r14\n" /* Jump to next instruction after lgg */
+ ".size gs_handler_asm,.-gs_handler_asm\n"
+);
+/* clang-format on */
void gs_handler(struct gs_cb *this_cb)
{
--
2.41.0
next prev parent reply other threads:[~2023-11-06 12:54 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-06 12:50 [kvm-unit-tests PATCH v1 00/10] RFC: Add clang-format and kerneldoc check Nico Boehr
2023-11-06 12:50 ` [kvm-unit-tests PATCH v1 01/10] make: add target to check kernel-doc comments Nico Boehr
2023-11-22 12:27 ` Thomas Huth
2023-11-06 12:50 ` [kvm-unit-tests PATCH v1 02/10] powerpc: properly format non-kernel-doc comments Nico Boehr
2023-11-06 16:53 ` Claudio Imbrenda
2023-11-06 17:13 ` Nico Boehr
2023-11-07 8:37 ` Thomas Huth
2023-11-07 18:42 ` Claudio Imbrenda
2023-11-22 12:28 ` Thomas Huth
2023-11-06 12:50 ` [kvm-unit-tests PATCH v1 03/10] lib: s390x: cpacf: move kernel-doc comment to correct function Nico Boehr
2023-11-22 12:47 ` Thomas Huth
2023-11-06 12:51 ` [kvm-unit-tests PATCH v1 04/10] s390x: properly format non-kernel-doc comments Nico Boehr
2023-11-06 16:54 ` Claudio Imbrenda
2023-11-22 12:47 ` Thomas Huth
2023-11-06 12:51 ` [kvm-unit-tests PATCH v1 05/10] s390x: ensure kernel-doc parameters are properly formated Nico Boehr
2023-11-22 12:49 ` Thomas Huth
2023-11-06 12:51 ` [kvm-unit-tests PATCH v1 06/10] x86: properly format non-kernel-doc comments Nico Boehr
2023-11-22 12:49 ` Thomas Huth
2023-11-06 12:51 ` [kvm-unit-tests PATCH v1 07/10] s390x: cpumodel: list tcg_fail explicitly Nico Boehr
2023-11-06 12:51 ` Nico Boehr [this message]
2023-11-06 12:51 ` [kvm-unit-tests PATCH v1 09/10] add clang-format configuration file Nico Boehr
2023-11-22 12:56 ` Thomas Huth
2023-11-06 12:51 ` [kvm-unit-tests PATCH v1 10/10] add make format Nico Boehr
2023-11-22 13:09 ` [kvm-unit-tests PATCH v1 00/10] RFC: Add clang-format and kerneldoc check Thomas Huth
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=20231106125352.859992-9-nrb@linux.ibm.com \
--to=nrb@linux.ibm.com \
--cc=andrew.jones@linux.dev \
--cc=david@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=thuth@redhat.com \
/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