Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp319272pxb; Thu, 14 Apr 2022 23:46:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCiKJVmnUNPrexZ8dAtXND+oBcVEM4OsRTkW9/YhKs3amcWzQOSHxaaGopEHzBDiI5nV3B X-Received: by 2002:a63:7559:0:b0:39e:44f4:363 with SMTP id f25-20020a637559000000b0039e44f40363mr5236003pgn.267.1650005168596; Thu, 14 Apr 2022 23:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650005168; cv=none; d=google.com; s=arc-20160816; b=a+hAcbQiQum63cwcLNcq5cmao2PHIGt6NudUir4rlPefbAXUKsh8yVx/aQHsmNMZJN 9QWZ+PodGaRBBxedU0uwr3+JD8x4eCrpw3NcySlWkSx76MNytGWzBzgNO3fTZvMeED7a gJXDkKgOjmQ5P0eV0zz82z0IAHFXFhgK2A7OfEVhFwXjMxaHzNziH/gYr9KyxEesnHAz 1m/hgUwslEYWAeFinF50sM+SL/TOtr98883hVfvnTJ71div0bNe+yA0PLyr/dm6WiN/G Qkl/D7TEPdRa8ETh6HJS6BEcr8glDyvWEZjkP5mQTNGCAEULgWr8rVEjRmc+XFfHptt4 PSkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=0pl8s6YMijfBdjUZgg6Mpq4f002Lb9s2pZ7eRmRtKik=; b=E4qLztj5Olyb6QfkXAbx5dBC3fanWRVsV5QYQ8qYkKsPKm2H2ho4NomcQ+/APRwbSE XPwNXdEs2hCk6RzEjpzuNVXxC7NYtjE0QSv2f2DqSbRtuyvo82/Jw7Beq6eBhe4XMORb JQWGQVGHHQWC/+MqFEKx97XKW0a6GZc6i0et0PwWaQWEtai5kNemcnStm6ETs5RylUmp VtM1HCqtrDdMlQAEY3MJdcMhwrO7AiuIMcTrC/GG5lnYYiHZFr2hjeZ67teXKG8ibFVf 8K11FmijdEHYFP/SoWfONJfCLkpJk/F0wxXNf8l0IMrimk/w4srp7P5WfMcNeOru+1sH H7fA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o5-20020a637305000000b003985b5d10dbsi804639pgc.384.2022.04.14.23.45.56; Thu, 14 Apr 2022 23:46:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241264AbiDNI7O (ORCPT + 99 others); Thu, 14 Apr 2022 04:59:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241248AbiDNI7M (ORCPT ); Thu, 14 Apr 2022 04:59:12 -0400 Received: from mx1.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30E9B68322; Thu, 14 Apr 2022 01:56:45 -0700 (PDT) Received: from [192.168.0.2] (ip5f5ae8d7.dynamic.kabel-deutschland.de [95.90.232.215]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 12B9961EA1936; Thu, 14 Apr 2022 10:56:44 +0200 (CEST) Message-ID: <14d07709-07ef-21a8-ad74-0f56447cf6dd@molgen.mpg.de> Date: Thu, 14 Apr 2022 10:56:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v6 3/3] EDAC: nuvoton: Add NPCM memory controller driver Content-Language: en-US To: Borislav Petkov , Medad Young 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 References: <20220322030152.19018-1-ctcchien@nuvoton.com> <20220322030152.19018-4-ctcchien@nuvoton.com> From: Paul Menzel In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Dear Borislav, Am 14.04.22 um 10:42 schrieb Borislav Petkov: > 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. Good point. Sorry for missing that. > So can we stop the silliness pls? No idea, why you had to ask this question, while you statement before already made the point. >>>> +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. Sorry I do not get your point. Would you elaborate on the debug message so it’s more useful? Or would you keep `InterruptStatus`, or – as it’s a debug message – use the variable name? My point was mainly about, why not use the variable name directly in the debug message, and the space before the colon. Kind regards, Paul