EDAC/mc: Reduce indentation level in edac_mc_handle_error()
authorRobert Richter <rrichter@marvell.com>
Wed, 6 Nov 2019 09:33:14 +0000 (09:33 +0000)
committerBorislav Petkov <bp@suse.de>
Sun, 10 Nov 2019 11:40:14 +0000 (12:40 +0100)
Reduce the indentation level in edac_mc_handle_error() a bit.

No functional changes.

Signed-off-by: Robert Richter <rrichter@marvell.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Cc: "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
Cc: James Morse <james.morse@arm.com>
Cc: Tony Luck <tony.luck@intel.com>
Link: https://lkml.kernel.org/r/20191106093239.25517-7-rrichter@marvell.com
drivers/edac/edac_mc.c

index ab2b489788888d1a3794dbb00e4c645e88e1e5ea..614841035bfeb38e497e682145f0ca48f3dbed3f 100644 (file)
@@ -1172,36 +1172,37 @@ void edac_mc_handle_error(const enum hw_event_mc_err_type type,
                 * channel/memory controller/...  may be affected.
                 * Also, don't show errors for empty DIMM slots.
                 */
-               if (e->enable_per_layer_report && dimm->nr_pages) {
-                       if (n_labels >= EDAC_MAX_LABELS) {
-                               e->enable_per_layer_report = false;
-                               break;
-                       }
-                       n_labels++;
-                       if (p != e->label) {
-                               strcpy(p, OTHER_LABEL);
-                               p += strlen(OTHER_LABEL);
-                       }
-                       strcpy(p, dimm->label);
-                       p += strlen(p);
+               if (!e->enable_per_layer_report || !dimm->nr_pages)
+                       continue;
 
-                       /*
-                        * get csrow/channel of the DIMM, in order to allow
-                        * incrementing the compat API counters
-                        */
-                       edac_dbg(4, "%s csrows map: (%d,%d)\n",
-                                mci->csbased ? "rank" : "dimm",
-                                dimm->csrow, dimm->cschannel);
-                       if (row == -1)
-                               row = dimm->csrow;
-                       else if (row >= 0 && row != dimm->csrow)
-                               row = -2;
-
-                       if (chan == -1)
-                               chan = dimm->cschannel;
-                       else if (chan >= 0 && chan != dimm->cschannel)
-                               chan = -2;
+               if (n_labels >= EDAC_MAX_LABELS) {
+                       e->enable_per_layer_report = false;
+                       break;
+               }
+               n_labels++;
+               if (p != e->label) {
+                       strcpy(p, OTHER_LABEL);
+                       p += strlen(OTHER_LABEL);
                }
+               strcpy(p, dimm->label);
+               p += strlen(p);
+
+               /*
+                * get csrow/channel of the DIMM, in order to allow
+                * incrementing the compat API counters
+                */
+               edac_dbg(4, "%s csrows map: (%d,%d)\n",
+                       mci->csbased ? "rank" : "dimm",
+                       dimm->csrow, dimm->cschannel);
+               if (row == -1)
+                       row = dimm->csrow;
+               else if (row >= 0 && row != dimm->csrow)
+                       row = -2;
+
+               if (chan == -1)
+                       chan = dimm->cschannel;
+               else if (chan >= 0 && chan != dimm->cschannel)
+                       chan = -2;
        }
 
        if (!e->enable_per_layer_report) {