From patchwork Wed Sep 30 15:58:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 11809787 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 91D4692C for ; Wed, 30 Sep 2020 16:02:48 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B417206F7 for ; Wed, 30 Sep 2020 16:02:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="r4s4A0QA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B417206F7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=de.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:48156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kNeZ4-0001NZ-UI for patchwork-qemu-devel@patchwork.kernel.org; Wed, 30 Sep 2020 12:02:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kNeVw-0007OR-Bf; Wed, 30 Sep 2020 11:59:33 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:15600) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kNeVm-00020U-ID; Wed, 30 Sep 2020 11:59:30 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08UFnKFT052616; Wed, 30 Sep 2020 11:59:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pp1; bh=ZnS0+7S2RNPNxs2Px+2PcH0G/J5pQy4PjvtM9g2VMik=; b=r4s4A0QAq0nqlHJBnHyDd9Q5LBhF+04LLC710SX7Wp24bbziDITaFerOv3/TRdAYTt4w KJx+ykHdhGLYitaVCBGcaPTZOsVaJ8hLEcalXJqbgT0ARwpWfSWN6m06MkYAzyxPAtEw 9OIGzoSY5QJHaAuMTmGCmPHd/MYFHUGSKq/CTBMGK1n1I908LTKHnYtr5Nxi3Nww0kCO /u7EtxPWKbP4TZs6VVb+D2r7M1gcMVjrCmHTFXsCYe6CdmkvqjHYyrbX6gvaF5Z/gXbS b3nwvH9vt7GySDffU7rbHE2EO79yKKGj6bpIsEn/s/7JC7M14ENqWMV+kNhng9xBmoGU Tg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 33vw0eg7d6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 11:59:08 -0400 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 08UFpBBR057776; Wed, 30 Sep 2020 11:59:08 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 33vw0eg7bs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 11:59:08 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08UFuvQW008249; Wed, 30 Sep 2020 15:59:05 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma04ams.nl.ibm.com with ESMTP id 33sw97vkwx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 15:59:05 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08UFx3Yp31392150 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Sep 2020 15:59:03 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5CD294203F; Wed, 30 Sep 2020 15:59:03 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4A1B242041; Wed, 30 Sep 2020 15:59:03 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 30 Sep 2020 15:59:03 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id 051CDE1FB0; Wed, 30 Sep 2020 17:59:03 +0200 (CEST) From: Christian Borntraeger To: qemu-devel@nongnu.org Subject: [PATCH 4/4] virtiofsd: avoid false positive compiler warning Date: Wed, 30 Sep 2020 17:58:59 +0200 Message-Id: <20200930155859.303148-5-borntraeger@de.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200930155859.303148-1-borntraeger@de.ibm.com> References: <20200930155859.303148-1-borntraeger@de.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-30_08:2020-09-30, 2020-09-30 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 spamscore=0 lowpriorityscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 clxscore=1015 suspectscore=1 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009300121 Received-SPF: pass client-ip=148.163.156.1; envelope-from=borntraeger@de.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/30 11:59:20 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.373, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Kevin Wolf , qemu-block@nongnu.org, "Dr . David Alan Gilbert" , Max Reitz , Christian Borntraeger , Stefan Hajnoczi Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" make: *** [Makefile:121: config-host.mak] Error 1 [cborntra@m83lp52 qemu]$ make -C build/ make: Entering directory '/home/cborntra/REPOS/qemu/build' Generating qemu-version.h with a meson_exe.py custom command Compiling C object tools/virtiofsd/virtiofsd.p/passthrough_ll.c.o ../tools/virtiofsd/passthrough_ll.c: In function ‘lo_setattr’: ../tools/virtiofsd/passthrough_ll.c:702:19: error: ‘fd’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 702 | res = futimens(fd, tv); | ^~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make: *** [Makefile.ninja:1438: tools/virtiofsd/virtiofsd.p/passthrough_ll.c.o] Error 1 make: Leaving directory '/home/cborntra/REPOS/ as far as I can see this can not happen. Let us silence the warning by giving fd a default value. Signed-off-by: Christian Borntraeger --- tools/virtiofsd/passthrough_ll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index 0b229ebd5786..da06aa6e9264 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -620,7 +620,7 @@ static void lo_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr, struct lo_inode *inode; int ifd; int res; - int fd; + int fd = 0; inode = lo_inode(req, ino); if (!inode) {