Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2625926pxb; Sun, 17 Oct 2021 20:53:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXZF6yH588++QJGrv09YrS3Q+SZQY5YndErjanwbSAMLNn5+uPrDR0+Jm8aQpQ6cUWkNrv X-Received: by 2002:a17:902:e0d5:b0:13f:25a0:d26b with SMTP id e21-20020a170902e0d500b0013f25a0d26bmr25148161pla.53.1634529195993; Sun, 17 Oct 2021 20:53:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634529195; cv=none; d=google.com; s=arc-20160816; b=qY3Pj5eUJqX5tcfpWElRBfFN3CicZZCid5INreNc+tu02y141xI+tkOazMZm1UVHPg /N3YQ1P2TihcwQk0dTxD+QYUotIVFdm0u2yituOgWP1DM805qACNEgXCw1dRfKTzjv0T O6ABtp2sMjUQ40OuBWvkklJEkczOYOEn0rYszzNfpK3C+fJU0pPAItvacLRYzYGi+YFh ymQHTfvCyypL8eLA1d6xpeid9dCXAzM6ri7xFuNFBklmDlIqUhTWygRuJCcBRnlMD4ku a+Py8IMtFlUrS60R0pvafQLU6dbTGw7OkvEVoD8NqNkSkavDGbum0aB693ZxQlPIMik1 q5FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=/DSJFiwmqKLVRMwp9ASpgvgIX1IJVRs0mwUUJlo/V8k=; b=U/+2hAZSYOhMjL9jo1S09kW7Us3/kYI02af9ECLDt4urOo0HdI0XcVyIjrQ60uO7Fq evcr9pBLHNADhMpsc6sjKC0knQLx8TDe7LG6Sps3Z/+0j0rkcewo57HX70hozSFXMmgU 5r3WSdjjEU4P5om6hzvUxraWDtFXGjNKjAm+2itA5PAewZGzQrmOuB3svwH4ReR+uYNB i2vaABzW+yrblgf33PNZmRlgyv6ipqorZv2y7Gxkq4fpNXh2XyQjEwAQ8xQo9t+sSSPG ENk+xwpxF8Thf8WTiQBAXq13BY/+oWr6MmYGT7OI4sCSYvCXeW8+lN8MEKxWDp90Bmk5 mpww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j67si18275448pfg.121.2021.10.17.20.53.03; Sun, 17 Oct 2021 20:53:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243037AbhJOVCD (ORCPT + 99 others); Fri, 15 Oct 2021 17:02:03 -0400 Received: from hostingweb31-40.netsons.net ([89.40.174.40]:37390 "EHLO hostingweb31-40.netsons.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231621AbhJOVCC (ORCPT ); Fri, 15 Oct 2021 17:02:02 -0400 Received: from [77.244.183.192] (port=63076 helo=[192.168.178.41]) by hostingweb31.netsons.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1mbUIz-007DZ3-HN; Fri, 15 Oct 2021 22:59:53 +0200 Subject: Re: [PATCH 4/8] rtc: max77686: remove useless variable To: Alexandre Belloni Cc: linux-kernel@vger.kernel.org, Lee Jones , Rob Herring , Alessandro Zummo , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Wim Van Sebroeck , Guenter Roeck , devicetree@vger.kernel.org, linux-rtc@vger.kernel.org, linux-watchdog@vger.kernel.org, Chiwoong Byun , Laxman Dewangan References: <20211011155615.257529-1-luca@lucaceresoli.net> <20211011155615.257529-5-luca@lucaceresoli.net> From: Luca Ceresoli Message-ID: <61be8df2-cec5-8df0-425d-aae458710112@lucaceresoli.net> Date: Fri, 15 Oct 2021 22:59:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hostingweb31.netsons.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lucaceresoli.net X-Get-Message-Sender-Via: hostingweb31.netsons.net: authenticated_id: luca@lucaceresoli.net X-Authenticated-Sender: hostingweb31.netsons.net: luca@lucaceresoli.net X-Source: X-Source-Args: X-Source-Dir: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 15/10/21 19:33, Alexandre Belloni wrote: > On 11/10/2021 17:56:11+0200, Luca Ceresoli wrote: >>> rtc_24hr_mode is set to 1 in max77686_rtc_probe()->max77686_rtc_init_reg() >> before being read and is never set back to 0 again. As such, it is de facto >> a constant. >> >> Remove the variable and the unreachable code. >> >> Signed-off-by: Luca Ceresoli >> --- >> drivers/rtc/rtc-max77686.c | 11 +---------- >> 1 file changed, 1 insertion(+), 10 deletions(-) >> >> diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c >> index 7e765207f28e..9901c596998a 100644 >> --- a/drivers/rtc/rtc-max77686.c >> +++ b/drivers/rtc/rtc-max77686.c >> @@ -99,7 +99,6 @@ struct max77686_rtc_info { >> >> int rtc_irq; >> int virq; >> - int rtc_24hr_mode; >> }; >> >> enum MAX77686_RTC_OP { >> @@ -278,13 +277,7 @@ static void max77686_rtc_data_to_tm(u8 *data, struct rtc_time *tm, >> >> tm->tm_sec = data[RTC_SEC] & mask; >> tm->tm_min = data[RTC_MIN] & mask; >> - if (info->rtc_24hr_mode) { >> - tm->tm_hour = data[RTC_HOUR] & 0x1f; >> - } else { >> - tm->tm_hour = data[RTC_HOUR] & 0x0f; >> - if (data[RTC_HOUR] & HOUR_PM_MASK) > > So I guess HOUR_PM_SHIFT and HOUR_PM_MASK can also be removed Sure. Coming in v2. Thanks. -- Luca