Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp983242pxb; Fri, 15 Apr 2022 17:22:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzDFtrxZWeBdNgymBbNRs5pHycmfmImFaCH5DuF8ZHteECdTaTQ6sxSk/dKNeurDlkDuTi X-Received: by 2002:a17:902:7e0d:b0:158:cedb:3683 with SMTP id b13-20020a1709027e0d00b00158cedb3683mr1196627plm.108.1650068566525; Fri, 15 Apr 2022 17:22:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650068566; cv=none; d=google.com; s=arc-20160816; b=ZmcXqQtR7RQviZikQlLA/1hsrNZ9pvXeME9nL3koKVrrWnUNfiz4QZn632/sOCCtsE ijoct9AyBIpnu0R5sujDHZcdB16Z55WtGxmQAvTmchYd7+gx6MqhYUJ9WSRFjaSPD1k6 TeoK24hk0W28XQhgrnGG0nEn8HlbttVvcV7m65uBDrHKEc5gs4M7bGxkXgPdLGZjeBtp xwJv7dS4pb0ghbbGclFntx5aQYuFCH5Ku+QWL+0OruBOYjTu2iwPSndqElmyJgRWbJPf qQA2cocH54mGcbLy7OD5h3cMhe8dHOI2wn0M+MR2A9xZzzLceA6HVgtVff0afbZ+FBdP 0KiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=iMtDxFcYv+APnoa3Wtnursj/Bjt7HnoJKgSy8sOg09k=; b=WrVtK8KLcUX+XTWLKIqJAeRoJAHhuJsdydi7JGOY7lzWaxvAH99s8JfwpqQRrTWNZ0 Mef4IClfdM9pCtA1AxUexn/ax8xTbkcW9l57d1/ckvBuq0DHhhuYrBlsjbU8OIRuaNsD 8SOUsp6ChlpFshl7ozLPgVSZQCz6pWPIkQ5BZzYdDQGE4T6Ml6aHn89vb9ODxAADXlxH qjFjm+nZ/4KEhrrmlmrL8EiBh96kHXjT0IZPNiRSbOlUxINzfFuTmxLT6rMCtcbt+bFJ YUYLLoqrrMo39bz2r9zKq2mTSBUauxk8CpR84DwtHze2fN/PQcnmsoPFySiSPCONncca py1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=iWEpQoD6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b16-20020a056a000cd000b0050a4154760fsi2856002pfv.99.2022.04.15.17.22.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 17:22:46 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=iWEpQoD6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1F4BADBD2A; Fri, 15 Apr 2022 17:21:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241061AbiDNIpH (ORCPT + 99 others); Thu, 14 Apr 2022 04:45:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241076AbiDNIpC (ORCPT ); Thu, 14 Apr 2022 04:45:02 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5862865815; Thu, 14 Apr 2022 01:42:38 -0700 (PDT) Received: from zn.tnic (p2e55d808.dip0.t-ipconnect.de [46.85.216.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id A24041EC059E; Thu, 14 Apr 2022 10:42:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1649925752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=iMtDxFcYv+APnoa3Wtnursj/Bjt7HnoJKgSy8sOg09k=; b=iWEpQoD6e+RGn4KnAod0Tzo8cY5o3l2637By3+nm3vVOVZ5BY9D5nnZrUh6hPapCXhvcXr eUTHY8CzY7ADMIUU+nsOTU8lOLLFc6byoo/xHbcvJ4S0fK++JJnJ9tRkK0E0P05qfvHxCW oOHbjiGznE0bwTVRnnjat96iG1WyQpY= Date: Thu, 14 Apr 2022 10:42:32 +0200 From: Borislav Petkov To: Medad Young , Paul Menzel Cc: rric@kernel.org, James Morse , tony.luck@intel.com, Mauro Carvalho Chehab , Rob Herring , Benjamin Fair , Nancy Yuen , Patrick Venture , KWLIU@nuvoton.com, YSCHU@nuvoton.com, JJLIU0@nuvoton.com, KFTING , Avi Fishman , Tomer Maimon , Tali Perry , ctcchien@nuvoton.com, devicetree , OpenBMC Maillist , Linux Kernel Mailing List , linux-edac Subject: Re: [PATCH v6 3/3] EDAC: nuvoton: Add NPCM memory controller driver Message-ID: References: <20220322030152.19018-1-ctcchien@nuvoton.com> <20220322030152.19018-4-ctcchien@nuvoton.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 14, 2022 at 09:55:05AM +0800, Medad Young wrote: > > > + if (mtype == MEM_TYPE_DDR4) > > > + dimm->mtype = MEM_DDR4; > > > + else > > > + dimm->mtype = MEM_EMPTY; > > > > Use ternary operator? > > > > dimm-mtype = (mtype == MEM_TYPE_DDR4) ? MEM_DDR4 : MEM_EMPTY; Ternary operator is less readable than a plain and simple if-else. > > > +{ > > > + struct priv_data *priv = mci->pvt_info; > > > + const struct npcm_edac_platform_data *npcm_chip = priv->npcm_chip; > > > + u64 err_c_addr = 0x0; > > > > size_t > > OK Why is size_t? error address doesn't have anything to do with a sizeof(), array indexing or loop counting. It is an error address and having it in an u64 tells you exactly what its quantity is. So can we stop the silliness pls? > > > +static irqreturn_t edac_ecc_isr(int irq, void *dev_id) > > > +{ > > > + struct mem_ctl_info *mci = dev_id; > > > + struct priv_data *priv = mci->pvt_info; > > > + const struct npcm_edac_platform_data *npcm_chip = priv->npcm_chip; > > > + u32 intr_status; > > > + u32 val; > > > + > > > + /* Check the intr status and confirm ECC error intr */ > > > + intr_status = readl(priv->reg + npcm_chip->ecc_ctl_int_status); > > > + > > > + edac_dbg(3, "InterruptStatus : 0x%x\n", intr_status); > > > > Remove the space before the colon? Maybe use: > > > > "Interrupt status (intr_status): 0x%x\n" And repeat "interrupt status"? Also silly. The question to ask yourselves should always be: is this error message helpful enough to its intended recipients. When I see "Interrupt status (intr_status): 0x%x\n" in my code, I go: "hm, where does this message come from?" because it ain't helpful enough. So I have to go stare at the code too. I hope you're catching my drift. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette