aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/amd64_edac.c
diff options
context:
space:
mode:
authorBorislav Petkov <borislav.petkov@amd.com>2010-05-25 12:21:07 -0400
committerBorislav Petkov <borislav.petkov@amd.com>2010-08-03 10:14:06 -0400
commiteba042a81edd6baaff44831b2d719b14a6d21e58 (patch)
treea1e768aadf18708114e2d6c4d4a54b3af49e42e9 /drivers/edac/amd64_edac.c
parentbc57117856cf1e581135810b37d3b75f9d1749f5 (diff)
edac, mc: Improve scrub rate handling
Fortify the interface to not accept negative values, remove memctrl_int_store() as a result. Also, sanitize bandwidth setting by making the argument a simple u32 instead of strange u32 pointer being passed around for no obvious reason. Then, fix error handling and teach it to return proper error values. Finally, make code more readable, simplify debug messages. Cc: Mauro Carvalho Chehab <mchehab@redhat.com> Cc: Arthur Jones <ajones@riverbed.com> Signed-off-by: Borislav Petkov <borislav.petkov@amd.com> Acked-by: Doug Thompson <dougthompson@xmission.com>
Diffstat (limited to 'drivers/edac/amd64_edac.c')
-rw-r--r--drivers/edac/amd64_edac.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index cdf457925f03..0106d343a681 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -160,7 +160,7 @@ static int amd64_search_set_scrub_rate(struct pci_dev *ctl, u32 new_bw,
160 return 0; 160 return 0;
161} 161}
162 162
163static int amd64_set_scrub_rate(struct mem_ctl_info *mci, u32 *bandwidth) 163static int amd64_set_scrub_rate(struct mem_ctl_info *mci, u32 bandwidth)
164{ 164{
165 struct amd64_pvt *pvt = mci->pvt_info; 165 struct amd64_pvt *pvt = mci->pvt_info;
166 u32 min_scrubrate = 0x0; 166 u32 min_scrubrate = 0x0;
@@ -180,8 +180,8 @@ static int amd64_set_scrub_rate(struct mem_ctl_info *mci, u32 *bandwidth)
180 amd64_printk(KERN_ERR, "Unsupported family!\n"); 180 amd64_printk(KERN_ERR, "Unsupported family!\n");
181 return -EINVAL; 181 return -EINVAL;
182 } 182 }
183 return amd64_search_set_scrub_rate(pvt->misc_f3_ctl, *bandwidth, 183 return amd64_search_set_scrub_rate(pvt->misc_f3_ctl, bandwidth,
184 min_scrubrate); 184 min_scrubrate);
185} 185}
186 186
187static int amd64_get_scrub_rate(struct mem_ctl_info *mci, u32 *bw) 187static int amd64_get_scrub_rate(struct mem_ctl_info *mci, u32 *bw)