Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1536686yba; Fri, 17 May 2019 00:30:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyt429V02p7qHlDPAWQ9gQHCjTobIOpfUC8pS8B2LmT1Rx71MJptOUHP920mLRuJXpDx/5N X-Received: by 2002:a63:5105:: with SMTP id f5mr38769190pgb.373.1558078229678; Fri, 17 May 2019 00:30:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558078229; cv=none; d=google.com; s=arc-20160816; b=0ba0ZO8KrhA3b/wFkAISXUtrilBGmEEDqFFS62Kkjs8d+8nZAFaF9vcZu/VKCuM2uD jf7oscTYoNiv6Gp/DiNXWcjvCG1hIm0n6h0MpXIpyoxVqNonzg0NYKu+Bs7kNX4XZ1LB ThEnIZG18z8D3HhuVdX8kL9dqmviaNkRYxBKvM5V9E8A+PjNXEC+wie+vANvyk8/0keT minMX7RBwTf+qr/bbfNycaCmJZ0tjgE7df2O+z8xAdow9fujGCimgtLmZ9B53EjXgtLp u9h1yQa58vC9zsOhokDeoWMp11AK7EKdsjOyc+Gq4ZAaWKqKj4Va1FNqpWXLEP3kHo6A 5lkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:subject:cc:to:from:date; bh=yl3pjQNh5zG3JyDgato8vGtmo/nJM2jAvj/hQ8usBmg=; b=rKsRPsQZPw84gqyeN2C6Sk4Nh+ilwxVgqQP97wb9S1uvCPLAoFXgLUtXSpaHjpWUMA lrc76azlNRn8TQZvFvGlZ8wibKYln82ZP0FZzKkTWwIJaQEZYVoG/tT1WNo/KBEm3JKE phis/YaYwBNGKlSQ6r4pR0V1XC5gqZ+VMoH7FosCSf1y0+2AM05VlQ3luf+4K4wY25/0 wydVFo6026qnS5QW3f9HLEKsA81l1IEk/n10by3Lb73viLEygp8ZyP96r8E1sfVbxJXJ AvjN1QXyQIFUBc5kYITh2coBe1xQSHhhVtc1rOxO46sSMi4lXJthK7o1SQ639iEQIoMf Xi1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si1609027pgv.338.2019.05.17.00.30.14; Fri, 17 May 2019 00:30:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727822AbfEQHGj (ORCPT + 99 others); Fri, 17 May 2019 03:06:39 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40120 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727386AbfEQHGj (ORCPT ); Fri, 17 May 2019 03:06:39 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4H6wCHN108484 for ; Fri, 17 May 2019 03:06:37 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2shqvp93b6-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 17 May 2019 03:06:37 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 17 May 2019 08:06:33 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 17 May 2019 08:06:30 +0100 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x4H76TJm48955522 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 07:06:29 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E94A3A4067; Fri, 17 May 2019 07:06:28 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 86C3AA4054; Fri, 17 May 2019 07:06:28 +0000 (GMT) Received: from mschwideX1 (unknown [9.145.144.159]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 17 May 2019 07:06:28 +0000 (GMT) Date: Fri, 17 May 2019 09:06:26 +0200 From: Martin Schwidefsky To: Masahiro Yamada Cc: Heiko Carstens , linux-s390@vger.kernel.org, Arnd Bergmann , Claudio Imbrenda , linux-kernel@vger.kernel.org, Gerald Schaefer , Souptick Joarder , Sergey Senozhatsky , Philipp Rudo Subject: Re: [PATCH] s390: add unreachable() to dump_fault_info() to fix -Wmaybe-uninitialized In-Reply-To: <20190517064922.22743-1-yamada.masahiro@socionext.com> References: <20190517064922.22743-1-yamada.masahiro@socionext.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19051707-0028-0000-0000-0000036EA350 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19051707-0029-0000-0000-0000242E40EB Message-Id: <20190517090626.3c707d77@mschwideX1> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-05-17_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905170047 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 17 May 2019 15:49:22 +0900 Masahiro Yamada wrote: > When CONFIG_OPTIMIZE_INLINING is enabled for s390, I see this warning: > > arch/s390/mm/fault.c:127:15: warning: 'asce' may be used uninitialized in this function [-Wmaybe-uninitialized] > switch (asce & _ASCE_TYPE_MASK) { > arch/s390/mm/fault.c:177:16: note: 'asce' was declared here > unsigned long asce; > ^~~~ > > If get_fault_type() is not inlined, the compiler cannot deduce that > all the possible paths in the 'switch' statement are covered. > > Of course, we could mark get_fault_type() as __always_inline to get > back the original behavior, but I do not think it sensible to force > inlining just for the purpose of suppressing the warning. Since this > is just a matter of warning, I want to keep as much room for compiler > optimization as possible. > > I added unreachable() to teach the compiler that the 'default' label > is unreachable. > > I got rid of the 'inline' marker. Even without the 'inline' hint, > the compiler inlines functions based on its inlining heuristic. > > Fixes: 9012d011660e ("compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING") > Signed-off-by: Masahiro Yamada Added to our internal tree and I will add it to s390/linux soon. Thanks. > --- > > arch/s390/mm/fault.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c > index c220399ae196..91ce03fd0c84 100644 > --- a/arch/s390/mm/fault.c > +++ b/arch/s390/mm/fault.c > @@ -85,7 +85,7 @@ static inline int notify_page_fault(struct pt_regs *regs) > * Find out which address space caused the exception. > * Access register mode is impossible, ignore space == 3. > */ > -static inline enum fault_type get_fault_type(struct pt_regs *regs) > +static enum fault_type get_fault_type(struct pt_regs *regs) > { > unsigned long trans_exc_code; > > @@ -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); -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.