Skip to contentSkip to conversation

amd64_edac: add f10-and-later methods-p2

PATCH Doug Thompson 1 participant 1 message May 5, 2009

lore
Share & tools
lore
#0 lore raw
Quoted 31 lines · Mauro Carvalho Chehab

From: Mauro Carvalho Chehab <[email protected]>
Subject: Re: [PATCH 12/21] amd64_edac: add f10-and-later methods-p2
To: "Borislav Petkov" <[email protected]>
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Date: Monday, May 4, 2009, 5:25 PM
Borislav Petkov escreveu:

Quoted 4 lines

+/*
+ * f10_lookup_addr_in_dct
+ *
+ *    Iterate over the DRAM DCT "base"

and "mask" register looking for

Quoted 1 line

+ *    a SystemAddr match on the

specified 'ChannelSelect' and 'NodeID'

Quoted 6 lines

+ *
+ * Return:
+ *    -1  NOT FOUND
+ *    0..csrow = Chip-Select Row
+ */
+static int f10_lookup_addr_in_dct(u32 InputAddr, u32

NodeID, u32 ChannelSelect)

Review

Quoted 10 lines
(quoted diff) +10 -0
+{
+    struct mem_ctl_info *mci;
+    struct amd64_pvt *pvt;
+    u32 CSBase, CSMask;
+    int CSFound = -1;
+    int csrow;
+
+    mci = mci_lookup[NodeID];
+    if (!mci)
+        return

CSFound;

Quoted 9 lines
Quoted 1 line

It is better to use a standard error code like -EINVAL instead of using -1 for error.

Cheers,
Mauro.

good point thanks

doug t