From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bartlomiej Zolnierkiewicz Subject: Re: [PATCH] thermal: exynos_tmu: avoid uninitialized variables Date: Wed, 28 Mar 2018 15:56:23 +0200 Message-ID: <11114909.7eTX8MzZjF@amdc3058> References: <20180328134520.1970967-1-arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: In-reply-to: <20180328134520.1970967-1-arnd@arndb.de> Sender: linux-kernel-owner@vger.kernel.org To: Arnd Bergmann Cc: Zhang Rui , Eduardo Valentin , Kukjin Kim , Krzysztof Kozlowski , Marek Szyprowski , Maciej Purski , linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org List-Id: linux-pm@vger.kernel.org On Wednesday, March 28, 2018 03:44:44 PM Arnd Bergmann wrote: > Removing the initialization in the error case introduced > a compile-time warning: > > drivers/thermal/samsung/exynos_tmu.c: In function 'temp_to_code': > drivers/thermal/samsung/exynos_tmu.c:304:9: error: 'temp_code' may be used uninitialized in this function [-Werror=maybe-uninitialized] > return temp_code; > ^~~~~~~~~ > drivers/thermal/samsung/exynos_tmu.c: In function 'exynos_get_temp': > drivers/thermal/samsung/exynos_tmu.c:931:37: error: 'temp' may be used uninitialized in this function [-Werror=maybe-uninitialized] > *temp = code_to_temp(data, value) * MCELSIUS; > > Let's assume the runtime warning is sufficient, and make it > return a well-defined number instead of unintialized data. > > Fixes: 480b5bfc16e1 ("thermal: exynos: remove parsing of samsung, tmu_default_temp_offset property") > Signed-off-by: Arnd Bergmann Thanks Arnd! Acked-by: Bartlomiej Zolnierkiewicz Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics