From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julia Lawall Date: Fri, 25 Jan 2019 14:59:44 +0000 Subject: Re: [PATCH -next] EDAC: Drop pointless static qualifier in edac_fake_inject_write() Message-Id: List-Id: References: <1548383420-163054-1-git-send-email-yuehaibing@huawei.com> In-Reply-To: <1548383420-163054-1-git-send-email-yuehaibing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: YueHaibing Cc: Borislav Petkov , Mauro Carvalho Chehab , James Morse , linux-edac@vger.kernel.org, kernel-janitors@vger.kernel.org On Fri, 25 Jan 2019, YueHaibing wrote: > On 2019/1/25 13:41, Julia Lawall wrote: > > > > > > On Fri, 25 Jan 2019, YueHaibing wrote: > > > >> There is no need to have the 'enum hw_event_mc_err_typetype' variable > >> static since new value always be assigned before use it. > > > > How did you find this? If you used some tool, it would really be kind if > > you would reference that tool. People who make tools may need to justify > > that the time that they spend doing so is worthwhile. > > > Sure, the tool exists in https://github.com/weiyj/dpatch > > which run a coccinelle script OK, so your could say: Found using dpatch running a Coccinelle rule. Or something like that. julia > > > > > julia > > > >> > >> Signed-off-by: YueHaibing > >> --- > >> drivers/edac/debugfs.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/drivers/edac/debugfs.c b/drivers/edac/debugfs.c > >> index 0a92772..6736543 100644 > >> --- a/drivers/edac/debugfs.c > >> +++ b/drivers/edac/debugfs.c > >> @@ -8,7 +8,7 @@ static ssize_t edac_fake_inject_write(struct file *file, > >> { > >> struct device *dev = file->private_data; > >> struct mem_ctl_info *mci = to_mci(dev); > >> - static enum hw_event_mc_err_type type; > >> + enum hw_event_mc_err_type type; > >> u16 errcount = mci->fake_inject_count; > >> > >> if (!errcount) > >> > >> > >> > >> > >> > >> > > > > . > > > >