Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5111734yba; Wed, 10 Apr 2019 11:34:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxzL4EoqUQzqLMRKFJ5emhG/I0ELda8aVBF2ohp402ao0Nm2Y0BedpuqKvZ4qnb/yowBeHT X-Received: by 2002:a63:525f:: with SMTP id s31mr42358499pgl.172.1554921299290; Wed, 10 Apr 2019 11:34:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554921299; cv=none; d=google.com; s=arc-20160816; b=gbKF1d26EyaFfGJVrh2Lr6t/m0s5x536lahIN4d7W+udM0JQ3LnP2KcmXeHZH0WV8X 2o5QCaOEFMtwnmPdtAxoI2aiFYLz/ojVv2cmOO9yMASY9NqTPRtxxRsn4P23zM8Ra/Qm sDXtkRoxUonoQhfyOOt4ubM4dmtz3xsXzXHf9nKQPxrVsLJOd5bXQCtzTeafYllJk0UP DnmsQsjlCKZdQOoJx/BjB1WzNHh4I+1K1HSpFqBzmxpVW8V1A5MUPZVhI7eE+XR28jeB qJUsKRcn2UbddEP+PEC3nwRrqWcVkuJqWOOY6zOWgKLgLNi4Y8DX57nibsnK3WR9/4fK 2tTQ== 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=ejTL1NpH/QqV6JuAyy3Jfgo+WSDWKNvvQgys8d3viZY=; b=ANn+fl9Se8pw3u52Xzq6/ddduAljJZ+idaxhdriJESyWo8IJU5e6wLUsNc8nlEgWgp 5NfBESM/Mmj1C5F3WoweJrrK14vcTQTHTQzR8w6IgOLgvs0Qlc7CVfx1dy9lNbZ2is+7 +g8N7UWHglDdfyDCyoGQgFGQEvcK6Jsu1KFOaofML6BITHKd7sdEtDeQBGnxyr22jage twUV4yS6Vkku5RA5SfefAC1eTV1Vl9srIQNBaa4XNyFqW92H3NHovwaizIdt5kVJuRuZ QrAx38wKgJXFErikr//OgFWHrSGI+yUIqD+Crcdmac+icG9fROu8Hxf/6pU91bYrIz1V dgwg== 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 i6si31972094pgj.329.2019.04.10.11.34.42; Wed, 10 Apr 2019 11:34:59 -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 S1731860AbfDJQAV (ORCPT + 99 others); Wed, 10 Apr 2019 12:00:21 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:51466 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728970AbfDJQAU (ORCPT ); Wed, 10 Apr 2019 12:00:20 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3AG0CO5138551 for ; Wed, 10 Apr 2019 12:00:18 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0b-001b2d01.pphosted.com with ESMTP id 2rsjvwtjhs-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 10 Apr 2019 12:00:17 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 10 Apr 2019 17:00:14 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 10 Apr 2019 17:00:10 +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 x3AG08wq50135080 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Apr 2019 16:00:09 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9E591A4075; Wed, 10 Apr 2019 16:00:08 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 44701A406A; Wed, 10 Apr 2019 16:00:08 +0000 (GMT) Received: from mschwideX1 (unknown [9.152.212.148]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 10 Apr 2019 16:00:08 +0000 (GMT) Date: Wed, 10 Apr 2019 18:00:07 +0200 From: Martin Schwidefsky To: Arnd Bergmann Cc: Heiko Carstens , Julian Wiedmann , Ursula Braun , clang-built-linux@googlegroups.com, Nick Desaulniers , Nathan Chancellor , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 06/12] s390: ctcm: fix ctcm_new_device error return code In-Reply-To: <20190408212648.2407234-6-arnd@arndb.de> References: <20190408212648.2407234-1-arnd@arndb.de> <20190408212648.2407234-6-arnd@arndb.de> 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: 19041016-0020-0000-0000-0000032E6443 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19041016-0021-0000-0000-000021809037 Message-Id: <20190410180007.4255ee21@mschwideX1> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-10_07:,, 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-1904100111 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 8 Apr 2019 23:26:19 +0200 Arnd Bergmann wrote: > clang points out that the return code from this function is > undefined for one of the error paths: > > ../drivers/s390/net/ctcm_main.c:1595:7: warning: variable 'result' is used uninitialized whenever 'if' condition is true > [-Wsometimes-uninitialized] > if (priv->channel[direction] == NULL) { > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ../drivers/s390/net/ctcm_main.c:1638:9: note: uninitialized use occurs here > return result; > ^~~~~~ > ../drivers/s390/net/ctcm_main.c:1595:3: note: remove the 'if' if its condition is always false > if (priv->channel[direction] == NULL) { > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ../drivers/s390/net/ctcm_main.c:1539:12: note: initialize the variable 'result' to silence this warning > int result; > ^ > > Make it return -ENODEV here, as in the related failure cases. > gcc has a known bug in underreporting some of these warnings > when it has already eliminated the assignment of the return code > based on some earlier optimization step. > > Signed-off-by: Arnd Bergmann Added to our internal tree for Julian to pick up. -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.