public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	linux-s390@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org,
	Gerald Schaefer <gerald.schaefer@de.ibm.com>,
	Souptick Joarder <jrdr.linux@gmail.com>,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Philipp Rudo <prudo@linux.ibm.com>
Subject: Re: [PATCH] s390: add unreachable() to dump_fault_info() to fix -Wmaybe-uninitialized
Date: Fri, 17 May 2019 15:59:51 +0900	[thread overview]
Message-ID: <20190517065951.GA11550@jagdpanzerIV> (raw)
In-Reply-To: <20190517064922.22743-1-yamada.masahiro@socionext.com>

On (05/17/19 15:49), Masahiro Yamada wrote:
[..]
> @@ -211,6 +211,8 @@ static void dump_fault_info(struct pt_regs *regs)
>  		asce = S390_lowcore.kernel_asce;
>  		pr_cont("kernel ");
>  		break;
> +	default:
> +		unreachable();
>  	}
>  	pr_cont("ASCE.\n");
>  	dump_pagetable(asce, regs->int_parm_long & __FAIL_ADDR_MASK);

Or have default fault type and asce?

Just an idea.

---

diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index c220399ae196..876d71c31894 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -174,7 +174,8 @@ static void dump_pagetable(unsigned long asce, unsigned long address)
 
 static void dump_fault_info(struct pt_regs *regs)
 {
-	unsigned long asce;
+	unsigned long asce = S390_lowcore.kernel_asce;
+	char *type = "kernel ";
 
 	pr_alert("Failing address: %016lx TEID: %016lx\n",
 		 regs->int_parm_long & __FAIL_ADDR_MASK, regs->int_parm_long);
@@ -197,22 +198,18 @@ static void dump_fault_info(struct pt_regs *regs)
 	switch (get_fault_type(regs)) {
 	case USER_FAULT:
 		asce = S390_lowcore.user_asce;
-		pr_cont("user ");
+		type = "user ";
 		break;
 	case VDSO_FAULT:
 		asce = S390_lowcore.vdso_asce;
-		pr_cont("vdso ");
+		type = "vdso ";
 		break;
 	case GMAP_FAULT:
 		asce = ((struct gmap *) S390_lowcore.gmap)->asce;
-		pr_cont("gmap ");
-		break;
-	case KERNEL_FAULT:
-		asce = S390_lowcore.kernel_asce;
-		pr_cont("kernel ");
+		type = "gmap ";
 		break;
 	}
-	pr_cont("ASCE.\n");
+	pr_cont("%s ASCE.\n", type);
 	dump_pagetable(asce, regs->int_parm_long & __FAIL_ADDR_MASK);
 }
 

  reply	other threads:[~2019-05-17  6:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17  6:49 [PATCH] s390: add unreachable() to dump_fault_info() to fix -Wmaybe-uninitialized Masahiro Yamada
2019-05-17  6:59 ` Sergey Senozhatsky [this message]
2019-05-17  7:06 ` Martin Schwidefsky

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=20190517065951.GA11550@jagdpanzerIV \
    --to=sergey.senozhatsky.work@gmail.com \
    --cc=arnd@arndb.de \
    --cc=gerald.schaefer@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=imbrenda@linux.vnet.ibm.com \
    --cc=jrdr.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=prudo@linux.ibm.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=yamada.masahiro@socionext.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