Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5643942imu; Mon, 26 Nov 2018 03:26:35 -0800 (PST) X-Google-Smtp-Source: AFSGD/UsAVrXAGhW5UZQ/o3actd+y57fkJIXEw1DjxiJDgUS2i7nm3tBvDF4HRoBK42d8EZVjoMn X-Received: by 2002:a62:4156:: with SMTP id o83mr12746452pfa.72.1543231595534; Mon, 26 Nov 2018 03:26:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543231595; cv=none; d=google.com; s=arc-20160816; b=wpb50hnX/73DjWlTCkjZpN7TDXAum3kROK6fei41mKKoN/njntphlEtbGRUtgMAMoS TeN2DLWLiqsPSi/rfvGPsNr92nHD/7lMMEitIvaCfjgNBWRYaxqrl0jx2iIujbZfvRCA 3UNx7/2UzKNBy73OAGk4qyq+AT56ISP+JjUDALFeTNOQbALSkgGmZJeAGurhwiq+oJr3 FaZWJuCW1cGSCMax18AbNta9dmZfWvQVS/a02zPIERnyKjbp/8CDc8ubuDsfxkKZNtJ6 qcezbS4ZWThhdy3VE+naHxTcLLx+x2rvQ8NStV2plv8EEmRAhVFdPcqFCyi40SZ3zBfo sceA== 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=2Zd5kr9uZZwsaqjUUKWqtqFc54mT7BlRBJm0FNeHBH0=; b=j4wGAvRdWw/5YK8vLJ+/DvayJaeK1HaEf7URvVYEVSeKqvSlNZHnWr4uhVczIuwauD seOfXP429dW7RhRuYBEq9f5C05yTWT5aavELegApXB6MPEMbF/KMwz9AE/pgEu0EwSt6 r/9R77fX1BKhYXTN3qQoVPFxd7S6KZGpEvunpWiQjRrdxEXK/C0XqmlGqplUXcnuSi1/ mmVX/iOOOOSCNs/cV3aJEvYsUHZh0TxEq6qjRhcRyugOMfqy+CJUfCOtTh6fqacMlkX7 kAnIzHkk+AWH9CcqQMNyMZiEICGMpqLm8B4vhbjM4rF3+zAqOx5X+rpD/3v4fjR/nXbs yxAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FYoYBplG; 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 g34si27435pld.15.2018.11.26.03.26.13; Mon, 26 Nov 2018 03:26:35 -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=FYoYBplG; 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 S1728038AbeKZVtT (ORCPT + 99 others); Mon, 26 Nov 2018 16:49:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:58186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726923AbeKZVtS (ORCPT ); Mon, 26 Nov 2018 16:49:18 -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 3D2A920817; Mon, 26 Nov 2018 10:55:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543229734; bh=CWXe8bmYTNGgMbuhn3JlZovGxAWMbX13Qy0lsep1bCE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FYoYBplGjSqmcvG7vj1C/eoCZE7Ih3D/zQwfTQoIJ89YuBqxytrt1sbMP79Wjess7 EARcINUK+d0XBcuG+R2iycss08mCv+WXxbmF51YshGLaNJAa4a6cUwlgSHRtFcPrs9 5JcfQzn64A4iNYWq8q0x2kMxZTJ051urGvnK5op8= 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.4 45/70] arm64: percpu: Initialize ret in the default case Date: Mon, 26 Nov 2018 11:51:00 +0100 Message-Id: <20181126105051.385406546@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181126105046.722096341@linuxfoundation.org> References: <20181126105046.722096341@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.4-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 8a336852eeba..aea904713d0f 100644 --- a/arch/arm64/include/asm/percpu.h +++ b/arch/arm64/include/asm/percpu.h @@ -84,6 +84,7 @@ static inline unsigned long __percpu_##op(void *ptr, \ : [val] "Ir" (val)); \ break; \ default: \ + ret = 0; \ BUILD_BUG(); \ } \ \ @@ -113,6 +114,7 @@ static inline unsigned long __percpu_read(void *ptr, int size) ret = ACCESS_ONCE(*(u64 *)ptr); break; default: + ret = 0; BUILD_BUG(); } @@ -182,6 +184,7 @@ static inline unsigned long __percpu_xchg(void *ptr, unsigned long val, : [val] "r" (val)); break; default: + ret = 0; BUILD_BUG(); } -- 2.17.1