From patchwork Tue Mar 13 13:05:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 131464 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp711239ljb; Tue, 13 Mar 2018 06:06:13 -0700 (PDT) X-Google-Smtp-Source: AG47ELtQ/VicHwafEi4bS2Dw2sNDRLzBM9xtxzS6QGF9wdx2t9/1kqahAVxWiyfUJlMo60cON+UO X-Received: by 2002:a17:902:d891:: with SMTP id b17-v6mr517879plz.241.1520946373666; Tue, 13 Mar 2018 06:06:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520946373; cv=none; d=google.com; s=arc-20160816; b=kArOOJZqDebqvt9J7VSofr6rgA+wrFf4kGfSxm9/bJHF2bx3jzcG6wk3Tx2+zD3vtr zonhsMESafHHMI0wYizfWv98XKrNLYmWUQXlYXT6CtwxeHgkhfjhnFkzf0D+WUbUxW0P tcOCwQiZvapGNHejXbak6iseK0hX4gHMTaYBxX3CfOki0AKMO9p5D4GIQDKLBsg2R2kV aaZ1F1YAGad7g0bBvYk9Z3Da6VOjh98IzhoDK4a08U7hJbYbTMRqvnYt8suogipEdn2Z uLBIWqlK/cCaZ4cUDIjgkdL2u8EIGIJmkKITEfFac0oP9TejW4fDirqJN28e8qz7lsdn zUAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=snTi/Z7mi1/j+VDSUd1VjSNk3eJXsA1MHvFPxDSUyek=; b=V7Zh/QiqT5aJSWig5XwnOiSpntECjWquG2h3t9oI54ilC31NAe5UOLut8/XDOV57An G7mrcgXweJPHMKDGTKqUa+7aI3hEb10djU95WskNMqIpAN7NiJm2WMLBnjFzNccxNVLK Hlq7WXib3Ux+g7lChQDrNX6yaE4nIqXKholIuwzGCWcSuqwSnC7LSpFfxMwh+pf/HaaO DOZPcWKenAJfEALG+TdwC22TINSsu5MGMeyRfpx0Y8e4hXDva3E68bJtqKeQZudfRugN pKQNaMyxQHaaPQriGBtm7/LTqZvX2bQhX763DXdL6029tO4gPsds9+l7+t4px06uftXe H0qA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r65si132589pfa.79.2018.03.13.06.06.13; Tue, 13 Mar 2018 06:06:13 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752434AbeCMNGK (ORCPT + 28 others); Tue, 13 Mar 2018 09:06:10 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:39109 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750796AbeCMNGI (ORCPT ); Tue, 13 Mar 2018 09:06:08 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0LlYpT-1eKTOZ2W0N-00bGXE; Tue, 13 Mar 2018 14:05:36 +0100 From: Arnd Bergmann To: Oleg Drokin , Andreas Dilger , James Simmons , Greg Kroah-Hartman Cc: Arnd Bergmann , NeilBrown , lustre-devel@lists.lustre.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: lustre: fid: avoid false-positive uninitialized variable warning Date: Tue, 13 Mar 2018 14:05:16 +0100 Message-Id: <20180313130532.4015402-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:2HlTolkLrD6qrWoM//2uMBdGVTyl5E7EPcgynasDVSIxBHLYO/F 6Dp9mQq7Tgig/SuJd3M4TlAmMBbMMMhAhJ2nfplrkEEimIYQiOLTUXhoR1gwnWsn/I+m5wd PJKd1MUVc8nSjCod+0iUKE5fD5zeGRkS+7mDEPHLSRRC7gJjahEiQHokkkP13ATHtMdBfcE 5ghCxctF5znTP3DYmE41A== X-UI-Out-Filterresults: notjunk:1; V01:K0:HzjFsWE9PMs=:0HVzQaehV5S5sApoPalP3P 0ZV0vMRhkeBJHrmwhHb+rwTiouzKgYIFiNHOcetD2xsoBZfcbKtehdwGJ7fBssyRFCXh4m1UT hBlCT4PZmi/Wc1s+TXmYG+yxFf+p9b/O0GRwsZzOUE4T8tD8464B5UYAvmmsDkoofErqm1BuW NLllO+cxaEf7uaI769KoiSucTjCNXduNV4DtToDqTDFV+Li1gaTbhbLbvTEo3OdtqqmbD3jR5 pftw2qYxZ1LMQi0S6g9mYiw4+hDn2labthb+m6pJWUTw1628iR74N/FxV2iW+qSTs3tujjW9y iHB6GojWhIbkbc0CzVScDJQaaQbadEjA3isouMMClnfoSs9Lbnknr1Ala0O56CpAuG19tTG7S yp81RWerCYOPRYb5hAFSSQUjafGQvmR2VHPjY+oooaGyIaV1VGO2PkWdEV50IIzcgrv7YjtOG CIsDt8He1+vvQbgxNB79jBc8+UvtBdqgceQnBfapONU1FD4yKJSAg9E1MkD1gHyS1KS29ycQ1 9XxrWn1n+hvjepvfqi7EwnD1pOaw4B0CVpHmL7tDdB33M6NvAwF8QYmQPwCPBeDMzL+NAy/5Q ccAFwbrjO5raqnB7RtXLjQ+vj1w7d2uauNNpa5XAoJrf10aRX34f5QExWDpV2WwN71sNANLiK ADOdbaFU0Rzx9SeZn2dakZ2NHWHtRmvjjoL7QB3N3uiIZBuV2YCGYQ840M3XVnOqQLDxzUNjd QORD6ZgP0oO0TVC9UKQeZ/WHMGRTeq+iusR15A== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org One of Neil's recent cleanups apparently has led the code to get to a state where gcc tracks the 'seqnr' variable just enough to see that it is sometimes initialized in seq_client_alloc_seq(), but not enough that it can prove this initialization to be reliable before the use of that variable: drivers/staging/lustre/lustre/fid/fid_request.c: In function 'seq_client_alloc_fid': drivers/staging/lustre/lustre/fid/fid_request.c:245:22: error: 'seqnr' may be used uninitialized in this function [-Werror=maybe-uninitialized] The code seems to be otherwise correct, and I could not come up with a good way to simplify it further, so this adds a fake initialization to shut up that warning. Cc: NeilBrown Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/fid/fid_request.c | 1 + 1 file changed, 1 insertion(+) -- 2.9.0 diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c b/drivers/staging/lustre/lustre/fid/fid_request.c index fa23423eb8b3..030680f37c79 100644 --- a/drivers/staging/lustre/lustre/fid/fid_request.c +++ b/drivers/staging/lustre/lustre/fid/fid_request.c @@ -174,6 +174,7 @@ static int seq_client_alloc_seq(const struct lu_env *env, if (rc) { CERROR("%s: Can't allocate new meta-sequence, rc %d\n", seq->lcs_name, rc); + *seqnr = U64_MAX; return rc; } CDEBUG(D_INFO, "%s: New range - " DRANGE "\n",