From: Scott Branden <scott.branden@broadcom.com>
To: Shiping Ji <shiping.linux@gmail.com>,
Borislav Petkov <bp@alien8.de>, James Morse <james.morse@arm.com>,
robh+dt@kernel.org, mark.rutland@arm.com
Cc: devicetree@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
linux-edac@vger.kernel.org,
Mauro Carvalho Chehab <mchehab@kernel.org>,
sashal@kernel.org, hangl@microsoft.com,
Lei Wang <lewan@microsoft.com>,
shji@microsoft.com, ruizhao@microsoft.com,
Yuqing Shen <yuqing.shen@broadcom.com>,
ray.jui@broadcom.com, wangglei@gmail.com
Subject: Re: [PATCH v9 2/2] EDAC: add EDAC driver for DMC520
Date: Thu, 16 Jan 2020 16:31:27 -0800 [thread overview]
Message-ID: <aa80b8a5-5297-91c6-6410-99e43b53bd20@broadcom.com> (raw)
In-Reply-To: <6a462190-0af2-094a-daa8-f480d54a1fbf@gmail.com>
Hi Shiping,
Here is another small change to cleanup.
On 2020-01-15 6:32 a.m., Shiping Ji wrote:
> New driver supports error detection and correction on the devices with ARM
> DMC-520 memory controller.
>
> Signed-off-by: Shiping Ji <shiping.linux@gmail.com>
> Signed-off-by: Lei Wang <leiwang_git@outlook.com>
> Reviewed-by: James Morse <james.morse@arm.com>
>
> ---
> Changes in v9:
> - Removed interrupt-config and replaced with an interrupt map where names and masks are predefined
> - Only one ISR function is defined, mask is retrieved from the interrupt map
> - "dram_ecc_errc" and "dram_ecc_errd" are implemented
>
> ---
> +static void dmc520_get_dram_ecc_error_info(struct dmc520_edac *edac,
> + bool is_ce,
> + struct ecc_error_info *info)
> +{
> + u32 reg_offset_low, reg_offset_high;
> + u32 reg_val_low, reg_val_high;
> + bool valid;
> +
> + reg_offset_low = is_ce ? REG_OFFSET_DRAM_ECC_ERRC_INT_INFO_31_00 :
> + REG_OFFSET_DRAM_ECC_ERRD_INT_INFO_31_00;
> + reg_offset_high = is_ce ? REG_OFFSET_DRAM_ECC_ERRC_INT_INFO_63_32 :
> + REG_OFFSET_DRAM_ECC_ERRD_INT_INFO_63_32;
> +
> + reg_val_low = dmc520_read_reg(edac, reg_offset_low);
> + reg_val_high = dmc520_read_reg(edac, reg_offset_high);
> +
> + valid = (FIELD_GET(REG_FIELD_ERR_INFO_LOW_VALID, reg_val_low) != 0) &&
> + (FIELD_GET(REG_FIELD_ERR_INFO_HIGH_VALID, reg_val_high) != 0);
> +
> + if (valid) {
> + info->col =
> + FIELD_GET(REG_FIELD_ERR_INFO_LOW_COL, reg_val_low);
> + info->row =
> + FIELD_GET(REG_FIELD_ERR_INFO_LOW_ROW, reg_val_low);
> + info->rank =
> + FIELD_GET(REG_FIELD_ERR_INFO_LOW_RANK, reg_val_low);
> + info->bank =
> + FIELD_GET(REG_FIELD_ERR_INFO_HIGH_BANK, reg_val_high);
> + } else {
> + memset(info, 0, sizeof(struct ecc_error_info));
This should be sizeof(*info), not sizeof(struct ecc_error_info)
for better programming to allow info to change type in the future
without the code changing.
> + }
> +}
> +
>
next prev parent reply other threads:[~2020-01-17 0:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-15 14:32 [PATCH v9 2/2] EDAC: add EDAC driver for DMC520 Shiping Ji
2020-01-15 21:38 ` Borislav Petkov
2020-01-15 21:49 ` Shiping Ji
2020-01-15 22:05 ` Borislav Petkov
2020-01-15 22:08 ` Shiping Ji
2020-01-17 0:18 ` Borislav Petkov
2020-01-17 18:31 ` Shiping Ji
2020-01-17 18:40 ` Scott Branden
2020-01-17 18:57 ` Borislav Petkov
2020-01-17 0:31 ` Scott Branden [this message]
2020-01-17 18:24 ` Shiping Ji
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aa80b8a5-5297-91c6-6410-99e43b53bd20@broadcom.com \
--to=scott.branden@broadcom.com \
--cc=bp@alien8.de \
--cc=devicetree@vger.kernel.org \
--cc=hangl@microsoft.com \
--cc=james.morse@arm.com \
--cc=lewan@microsoft.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mchehab@kernel.org \
--cc=ray.jui@broadcom.com \
--cc=robh+dt@kernel.org \
--cc=ruizhao@microsoft.com \
--cc=sashal@kernel.org \
--cc=shiping.linux@gmail.com \
--cc=shji@microsoft.com \
--cc=wangglei@gmail.com \
--cc=yuqing.shen@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).