From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.6 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796393237; b=AvXakmZa2iWD7UB02lNpSsYj6W3FsYHv9zsB1iuQ6ZbztZkZu9YsncVhJIN36sFPa4x8 MpatUildQ6JpYCf8oYpbonY9ZZPjeFDaDJpccoA0JJ6qBvxrcEasXwMjqrd8Hb/T3G5LX eGAazWx/4YrUNKTbBSknxFpmQJc2DsgNhNysrwy3PR71r8Ai+uJNv721bmPZZwwaZS8S3 MWCOKwfhUD1pM0mRot2knOfAox/HtqxvYv6F2j7MREJJX50nJ6VskyLWkI3+OqL1G3bjg BxfWorRYocimnfmszWrpfYe1u1vjh0C2S5qU0hRMcSBFovsUcNDbJhLsaUc6k8Rz1/A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796393237; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:Organization; bh=HtngpH+4ON0vBVyAThZ/0S6Ez8lPJkSd9io1n1tF4Zk=; b=UoKYMfEPmEYxaUYuyPnRUDrmZgrNiGzNdvfsM7/NX2Ex9YXT+wZmwlTyCqxyCpbCv7r5 aIaSga2rBBtoajTCYor5PdBKOl1C5l54f+vfoZssKSePTXPVCR+HoajwKPoR8CB6vHeKR QnbXRFViLCbs0lRQiCkYGWaTe0P9WDROCmdOY/2/H74tXCQs9rJgGDfcVcc+cmaPBEDBi dba3tpvUDil5jdmm52huOCGrlIRoeQrAJX8QxV/tjoKnpdq9MLsHsjmwxfSvd8lJeE4UZ 1tsXAgxnw9oCZW2VVOXWxnbXPGE4LPCHGzHZRTEluIXOkGVOvsg3EfnZQUUXj/tsrTg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=eIklsWmP; arc=none smtp.remote-ip=192.198.163.6 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.6]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66222606A322; Fri, 4 Dec 2026 14:07:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 66222606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=eIklsWmP DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796393236; x=1827929236; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=pyRU5RqF4g1Fim/C5ESG7IfBrMRcpOUNmNwRBKgEszA=; b=eIklsWmPqFE1zKfELRLTZNHQd/wsyhYheXNZ8OatHy9vW687K+nCBa56 MDuTpYCYNsrKQuPzqA8MSCZdFQdg7y1WLLlrXL94TfY7JJ9XmkULKoRzX 407Ep9ExFnYnKzHd7yLgeRjsTIeILap28TSwil7U2ZCOnOsYaFR0e9LJs DUSzGTBGoE4kiF+qgnTqa2LpVQEpOSoof/dAvvNl7rV1tN1CIY78V2W2t y2nXb5D+41Xzt5tmWzvpGeLm250sUjA9aGf7v/sBN7c1NU2TB7m02xFB8 9MrHQS84uN2B2GQJdsKD6RBH6yTtyMigi4972KOA/NizEJrYevc802UDb Q==; X-CSE-ConnectionGUID: 9bRiiGs4T3yOZ2kUIyUsrA== X-CSE-MsgGUID: tOtcyAX/QwuqtajXVklYtA== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="14518" X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="14518" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa116.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 06:07:15 -0800 X-CSE-ConnectionGUID: gkCGnvNeRX2X7Y+3/aSshw== X-CSE-MsgGUID: UvHjM7gAQLWEeBIbMffioQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="13903746" Received: from alekseim-mobl.ger.corp.intel.com (HELO localhost) ([10.245.245.10]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 06:07:03 -0800 Date: Fri, 4 Dec 2026 16:07:01 +0200 From: Andy Shevchenko To: Atharva Tiwari Cc: Ihor Odainyi , Antoine Sidem , Aditya Garg , Bjorn Helgaas , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , "Rafael J. Wysocki" , Len Brown , Linus Walleij , Bartosz Golaszewski , Sven Peter , Janne Grunau , Neal Gompa , Guenter Roeck , Jonathan Cameron , David Lechner , Nuno =?iso-8859-1?Q?S=E1?= , Andy Shevchenko , Lee Jones , Pavel Machek , Griffin Kroah-Hartman , Hans de Goede , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Sebastian Reichel , Alexandre Belloni , Wim Van Sebroeck , Jarkko Sakkinen , Mimi Zohar , Roberto Sassu , Dmitry Kasatkin , Eric Snowberg , Paul Moore , James Morris , "Serge E. Hallyn" , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-gpio@vger.kernel.org, asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-hwmon@vger.kernel.org, linux-iio@vger.kernel.org, linux-leds@vger.kernel.org, mfd@lists.linux.dev, platform-driver-x86@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module@vger.kernel.org Subject: Re: [PATCH 01/14] treewide: Add backend for macsmc Message-ID: References: <20261204131619.5059-1-atharvatiwarilinuxdev@gmail.com> <20261204131619.5059-2-atharvatiwarilinuxdev@gmail.com> X-Mailing-List: linux-rtc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261204131619.5059-2-atharvatiwarilinuxdev@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Fri, Dec 04, 2026 at 08:12:41AM -0500, Atharva Tiwari wrote: > Split the Apple SMC driver into a common core and a backend > that handles the actual communication. The existing RTKit > code moves to its own backend, and nothing changes for > Apple Silicon. > > This lets the same SMC drivers run on other kinds of > hardware, starting with Intel Macs, as a replacement for > applesmc. There are plenty of style related issues in this code, besides the fact that it begs for a split. Read mailing list archives to understand what the problems are. ... > +#include > +#include > +#include > +#include > +#include > +#include Does it follow IWYU? ... > +EXPORT_SYMBOL(apple_smc_enter_atomic); Why no namespace is used? ... > +int apple_smc_write_atomic(struct apple_smc *smc, smc_key key, const void *buf, size_t size) > +{ > + guard(spinlock_irqsave)(&smc->lock); Delimit guard()() with blank line(s) so it will be easier to catch when reading the code. > + return smc->be->write_atomic(smc->be_cookie, key, buf, size); > +} ... > +int apple_smc_get_key_by_index(struct apple_smc *smc, int index, smc_key *key) > +{ > + guard(mutex)(&smc->mutex); > + int ret; No, we define variables at the top (yes, still). > + ret = smc->be->get_key_by_index(smc->be_cookie, index, key); > + *key = swab32(*key); > + > + return ret; > +} ... The above just something that I see briefly. But you need to revisit the whole code base. -- With Best Regards, Andy Shevchenko