Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5617321imu; Mon, 26 Nov 2018 03:04:26 -0800 (PST) X-Google-Smtp-Source: AJdET5eJ1UH3JgrTNi+PWhxmP3oOYVYO0u2hNwMjaPCkpuTtuSMxj0j+K7fkU3560MqSH81TR7I4 X-Received: by 2002:a62:ab0d:: with SMTP id p13mr27441803pff.211.1543230266561; Mon, 26 Nov 2018 03:04:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543230266; cv=none; d=google.com; s=arc-20160816; b=vVb38+n2smhsOe8QBzTc6kybdmDByIeIT1Vy+PXsWS9w+xHmfWNbQy4MNBZtk9zpZa FPx9e/YJy9dMkq1OWyc9mJh5uIybvDPFuvS5M6F6Il71zpBnTA6jNdVILCdaTypSiqax RhRPGIbgetIKrkNzgYxZxI6+2iX5YbJJjWIc3XT+Um4pNvKRLfMdpFmDV1AfDpfGqw6s zz6quS/4x8AbELxJj4cdSNFtlASHFLIiZ0r8fUTy8+Wc0DtL1mveRVkbfbawIFMP13ss iLHHGktTaw7Jr9+pu9+rMaOidhDQ0kfuncWBsoaN7q09aMxkIh1BIHfZGNcjXFA8il6g GJdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oWIpxE747Dl4kyMkxzANJhqPRUKXE284V169Qtfpm84=; b=KfSOEtmnpIkS8lyDWgB09vLfXOa1CHiIkvrfGteieYdcx5+bdoALS1Kx8KKpzL7Jnk zrF5vaYHzZsGLdRLKsURr/B19I3Pfh7Fl4eSnZOnZRvrOZiZQJ+TDQhzaHUWkbREAqcp wzp0JO4nlQOUkMAHMk0wOwJaRCOgT2VgNJJV1Gw1gGdpVMbVE6siiB+V1l/xEEGE+Cd9 7VkFntbY/fD1NWY6PV/AClYJ1qUKzsbQ8YArUTYzTGfSTzjOZM67POgYogYWi5oMugI7 Ccul3I4u6m53ej0egRRIDFiWyv4tbMtllKYM9DixPi2RW6x0Mz1nTZh57Vj0JlSpUHvh ECtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="kW/Hcy2r"; 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 a6si42910967plz.316.2018.11.26.03.04.09; Mon, 26 Nov 2018 03:04:26 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b="kW/Hcy2r"; 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 S1730505AbeKZV4V (ORCPT + 99 others); Mon, 26 Nov 2018 16:56:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:39462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730481AbeKZV4U (ORCPT ); Mon, 26 Nov 2018 16:56:20 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 13B4B2147D; Mon, 26 Nov 2018 11:02:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543230155; bh=PspPYDW7nO30Kx0HzYkJrraEp4WmNd5TjJSUEOV5mlE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kW/Hcy2rjER+KmMvAfyfwQj5LVA1j+6pb75nPK2Z69aU7WnX+IVB8hB0CVX7mW45x qiALWshS0dq9BBdo09auJqbtxQw1ydqPYSpSw19O3gayjWlXIcITgS0T/XJ880lnQ0 gZhER9wvk/lhrzIJ8EMA2wMZOQyI54FS/6j2SXDc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Prasad Sodagudi , Nathan Chancellor , Nick Desaulniers , Dennis Zhou , Sasha Levin Subject: [PATCH 4.19 028/118] arm64: percpu: Initialize ret in the default case Date: Mon, 26 Nov 2018 11:50:22 +0100 Message-Id: <20181126105100.947333890@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181126105059.832485122@linuxfoundation.org> References: <20181126105059.832485122@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit b5bb425871186303e6936fa2581521bdd1964a58 ] Clang warns that if the default case is taken, ret will be uninitialized. ./arch/arm64/include/asm/percpu.h:196:2: warning: variable 'ret' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] default: ^~~~~~~ ./arch/arm64/include/asm/percpu.h:200:9: note: uninitialized use occurs here return ret; ^~~ ./arch/arm64/include/asm/percpu.h:157:19: note: initialize the variable 'ret' to silence this warning unsigned long ret, loop; ^ = 0 This warning appears several times while building the erofs filesystem. While it's not strictly wrong, the BUILD_BUG will prevent this from becoming a true problem. Initialize ret to 0 in the default case right before the BUILD_BUG to silence all of these warnings. Reported-by: Prasad Sodagudi Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Dennis Zhou Signed-off-by: Sasha Levin --- arch/arm64/include/asm/percpu.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/include/asm/percpu.h b/arch/arm64/include/asm/percpu.h index 9234013e759e..21a81b59a0cc 100644 --- a/arch/arm64/include/asm/percpu.h +++ b/arch/arm64/include/asm/percpu.h @@ -96,6 +96,7 @@ static inline unsigned long __percpu_##op(void *ptr, \ : [val] "Ir" (val)); \ break; \ default: \ + ret = 0; \ BUILD_BUG(); \ } \ \ @@ -125,6 +126,7 @@ static inline unsigned long __percpu_read(void *ptr, int size) ret = READ_ONCE(*(u64 *)ptr); break; default: + ret = 0; BUILD_BUG(); } @@ -194,6 +196,7 @@ static inline unsigned long __percpu_xchg(void *ptr, unsigned long val, : [val] "r" (val)); break; default: + ret = 0; BUILD_BUG(); } -- 2.17.1