From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751272AbdAPI6c (ORCPT ); Mon, 16 Jan 2017 03:58:32 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:45083 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751207AbdAPI6a (ORCPT ); Mon, 16 Jan 2017 03:58:30 -0500 From: Amelie Delaunay To: Alessandro Zummo , Alexandre Belloni , Rob Herring , Mark Rutland , Maxime Coquelin , Alexandre Torgue , Russell King CC: , , , , Gabriel Fernandez , Amelie Delaunay Subject: [PATCH] rtc: stm32: use 0 instead of ~PWR_CR_DBP in regmap_update_bits Date: Mon, 16 Jan 2017 09:57:38 +0100 Message-ID: <1484557058-21601-1-git-send-email-amelie.delaunay@st.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.201.23.160] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-16_07:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using the ~ operator on a BIT() constant results in a large 'unsigned long' constant that won't fit into an 'unsigned int' function argument on 64-bit architectures, resulting in a harmless build warning in x86 allmodconfig: drivers/rtc/rtc-stm32.c: In function 'stm32_rtc_probe': drivers/rtc/rtc-stm32.c:651:51: error: large integer implicitly truncated to unsigned type [-Werror=overflow] regmap_update_bits(rtc->dbp, PWR_CR, PWR_CR_DBP, ~PWR_CR_DBP); As PWR_CR_DBP mask prevents other bits to be cleared, replace all ~PWR_CR_DBP by 0. Fixes: 4e64350f42e2 ("rtc: add STM32 RTC driver") Signed-off-by: Arnd Bergmann Signed-off-by: Amelie Delaunay --- drivers/rtc/rtc-stm32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c index 8c599f5..03c97c1 100644 --- a/drivers/rtc/rtc-stm32.c +++ b/drivers/rtc/rtc-stm32.c @@ -648,7 +648,7 @@ static int stm32_rtc_probe(struct platform_device *pdev) err: clk_disable_unprepare(rtc->ck_rtc); - regmap_update_bits(rtc->dbp, PWR_CR, PWR_CR_DBP, ~PWR_CR_DBP); + regmap_update_bits(rtc->dbp, PWR_CR, PWR_CR_DBP, 0); device_init_wakeup(&pdev->dev, false); @@ -670,7 +670,7 @@ static int stm32_rtc_remove(struct platform_device *pdev) clk_disable_unprepare(rtc->ck_rtc); /* Enable backup domain write protection */ - regmap_update_bits(rtc->dbp, PWR_CR, PWR_CR_DBP, ~PWR_CR_DBP); + regmap_update_bits(rtc->dbp, PWR_CR, PWR_CR_DBP, 0); device_init_wakeup(&pdev->dev, false); -- 1.9.1