From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=65.109.113.108 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796092751; b=J33OefzC0c9qbojB3/inmUPTqmZRWDn5y6k2XXDo3rCNK1nxCVRhig6c/m+1o04QRHYh BtlzJa9QENBq8/Y58m5LkZEyC/fENGOkuPPMu5pK2qysNM1oTh3nkYOKYdCc02xAabqwu o5nck2ct0rDOeDEuRDSJx1bF3bBBIhdC5j8rJ68PUcWjICk1Y1nU2kPaHGHpz6nOp+EXo oUIxkhnnKK4BtrDNE5WVMJ4CSD6CJZ6kcwm3aveBi9aLqG0kXkFc97qYhGDbNEcDQmh9k tY4U3GZYp+Hmd8P4HD7sk64/UV0cNdoNJBJisT5lY/oHp1pSKPVNlzE7nIkFuMyN75g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796092751; h=DMARC-Filter:Received:X-Virus-Scanned:Received:Received:Date:From:To: Cc:Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=T3op7Tog9qvlmYSJHXnyR5QMPB0GS18TtuJfE1+UgJw=; b=ECIHPo5perPXhvADfAzHF0joI3HqfeRlOqAOB5LEoxo0WupWt5/lCJON05eBLGb7mpSw +ZgVfGUOXtVf/0+5WmRbWSyQhh3s1Ow+hXDMnp+9fcX+9v4NYx62l7CeboajqF0r0s/kT 65gPcGPSBUuJkv4dBSW3Rnk1LVHMQdoRmlWYb/DY+UQTaiYJ0rocEbEdkiDRem5kIPYen cYU+RUY1VNlDQYkiIzTpQSAohobePhWInR8QEKN6BzRDrFVQ2jSluMnHty9Ci6E6EzR1B odPiKsq7SMpkyEcyJD/MQQplJdNDxpA1IpThQBWrCYrpvMtt/WjsaPl2a6F7/CtqTEQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; arc=none smtp.remote-ip=65.109.113.108 Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DB1D606A31A; Tue, 1 Dec 2026 02:39:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6DB1D606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id ACC3A40E01E1; Tue, 1 Dec 2026 02:39:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id IfQ4HqojRNlv; Tue, 1 Dec 2026 02:39:04 +0000 (UTC) Received: from stx.tnic (unknown [IPv6:2600:1700:38ca:c00::2b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id DA05240E0140; Tue, 1 Dec 2026 02:38:49 +0000 (UTC) Date: Mon, 30 Nov 2026 18:38:46 -0800 From: Borislav Petkov To: Ryan Chen Cc: Stefan Schaeckeler , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Joel Stanley , Andrew Jeffery , Tony Luck , Billy Tsai , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org Subject: Re: [PATCH v7 01/10] EDAC/aspeed: Stop keeping driver state in global variables Message-ID: <20261201023846.GAaw4zNheOnmaP9Y4T@fat_crate.local> References: <20261130-edac-v7-0-3aaf6d243f07@aspeedtech.com> <20261130-edac-v7-1-3aaf6d243f07@aspeedtech.com> X-Mailing-List: linux-kernel@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=utf-8 Content-Disposition: inline In-Reply-To: <20261130-edac-v7-1-3aaf6d243f07@aspeedtech.com> On Mon, Nov 30, 2026 at 03:24:28PM +0800, Ryan Chen wrote: > The register map and the interrupt number are global variables. The > following changes need to keep more state for the device, such as a > lock and the chip type, and adding more globals for that is not the > right way. Change that commit text to: "EDAC/aspeed: Add a driver private struct Collect all driver-specific variables in a private driver structure, like it is usually done for EDAC drivers." This is much clearer. Also, what is "struct aspeed_edac"'s name telling me? Your struct names should be descriptive and say what they are. For example: struct driver_priv or so. And then declarations like: struct driver_priv *priv = mci->pvt_info; make perfect sense. Same with: struct aspeed_edac_chip which appears later. This is not an "EDAC chip" but an aspeed memory controller chip, AFAICT. Right? So "struct aspeed_mc" perhaps? Naming is sooo important. And so on. Other than that, I cannot spot any more nasties. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette