From patchwork Sat Apr 9 02:08:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 1615107 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=lyXLxby7; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KZz7k4Gsbz9sFr for ; Sat, 9 Apr 2022 12:09:05 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4KZz7h4WPkz3bbp for ; Sat, 9 Apr 2022 12:09:04 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=lyXLxby7; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=rdunlap@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=lyXLxby7; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4KZz7N1qjgz2xBv for ; Sat, 9 Apr 2022 12:08:45 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=F75WgLKYZWUeJINf8+Yays5uvhvJJCETxcO2mCDDMP8=; b=lyXLxby7leOtzEIBGgGdvhg9aI ppN1Ti3FCmXWfMEATse9V55cNyhMl5ie97YyCk3Me6nN+EeaeKZ2J0m8RX0mbgcWnlGkpah08S0iN sT2I3qLUVQBzSMDV77n/r80NjnenKYglKrA0fpcymAdAentilrJMUtYmoiaei0oJngUxsotetB99X ICMzQgBdyltZuIYaSYsf7+zNQ3WVApWi5yjMghYG81YdO0KyR9/fjW3l231YCgebN8equojEHbBTt MRWS25GkXuVN9SCNlPeq43tcungXlKhRsv+LbCSIbLF5gngIjY+RO+fHi8CzTeSDHl/vkKs+0tdIn Ah0X6acA==; Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nd0WV-001hkH-Ma; Sat, 09 Apr 2022 02:08:23 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Subject: [PATCH] macintosh: fix via-pmu and via-cuda build without RTC_CLASS Date: Fri, 8 Apr 2022 19:08:21 -0700 Message-Id: <20220409020821.10229-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kees Cook , Arnd Bergmann , Randy Dunlap , Nick Desaulniers , Nathan Chancellor , Geert Uytterhoeven , linuxppc-dev@lists.ozlabs.org, Finn Thain , kernel test robot Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Fix build when RTC_CLASS is not set/enabled. Eliminates these build errors: m68k-linux-ld: drivers/macintosh/via-pmu.o: in function `pmu_set_rtc_time': drivers/macintosh/via-pmu.c:1769: undefined reference to `rtc_tm_to_time64' m68k-linux-ld: drivers/macintosh/via-cuda.o: in function `cuda_set_rtc_time': drivers/macintosh/via-cuda.c:797: undefined reference to `rtc_tm_to_time64' Fixes: 0792a2c8e0bb ("macintosh: Use common code to access RTC") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Benjamin Herrenschmidt Cc: Michael Ellerman Cc: Christophe Leroy Cc: Kees Cook Cc: Arnd Bergmann Cc: Finn Thain Cc: Geert Uytterhoeven Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: linuxppc-dev@lists.ozlabs.org --- drivers/macintosh/via-cuda.c | 5 ++++- drivers/macintosh/via-pmu.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) --- a/drivers/macintosh/via-cuda.c +++ b/drivers/macintosh/via-cuda.c @@ -794,7 +794,10 @@ int cuda_set_rtc_time(struct rtc_time *t u32 now; struct adb_request req; - now = lower_32_bits(rtc_tm_to_time64(tm) + RTC_OFFSET); + now = lower_32_bits(mktime64(((unsigned int)tm->tm_year + 1900), + tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, + tm->tm_min, tm->tm_sec) + + RTC_OFFSET); if (cuda_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME, now >> 24, now >> 16, now >> 8, now) < 0) return -ENXIO; --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c @@ -1766,7 +1766,10 @@ int pmu_set_rtc_time(struct rtc_time *tm u32 now; struct adb_request req; - now = lower_32_bits(rtc_tm_to_time64(tm) + RTC_OFFSET); + now = lower_32_bits(mktime64(((unsigned int)tm->tm_year + 1900), + tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, + tm->tm_min, tm->tm_sec) + + RTC_OFFSET); if (pmu_request(&req, NULL, 5, PMU_SET_RTC, now >> 24, now >> 16, now >> 8, now) < 0) return -ENXIO;