public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] AdvancedFeaturePkg/BmcElog: Change arithmetic logic
@ 2019-09-02 12:05 Zhang, Shenglei
  2019-09-02 12:05 ` [PATCH] AdvancedFeaturePkg/BmcElog: Initialize ClearSelResponse Zhang, Shenglei
  2019-09-16  5:11 ` [edk2-devel] [PATCH] AdvancedFeaturePkg/BmcElog: Change arithmetic logic Liming Gao
  0 siblings, 2 replies; 4+ messages in thread
From: Zhang, Shenglei @ 2019-09-02 12:05 UTC (permalink / raw)
  To: devel; +Cc: Michael Kubacki, Sai Chaganty, Liming Gao

Change the value from "sizeof(UINT8)" to 1 in the arithmetic expression.
The original value added to (UINT8 *)&GetBmcGlobalEnables is
(sizeof(UINT8)*sizeof(UINT8)) which equals to 1, so the functionality
looks right. But the arithmetic logic is actually wrong.

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
---
 Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c b/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c
index 421fbdec..beaa3fa0 100644
--- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c
+++ b/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c
@@ -131,7 +131,7 @@ Returns:
         ElogStat = 1;
       }
 
-      CopyMem (&SetBmcGlobalEnables, (UINT8 *)&GetBmcGlobalEnables + sizeof(UINT8), sizeof(UINT8));
+      CopyMem (&SetBmcGlobalEnables, (UINT8 *)&GetBmcGlobalEnables + 1, sizeof(UINT8));
       SetBmcGlobalEnables.SetEnables.Bits.SystemEventLogging = ElogStat;
 
       Status = IpmiSetBmcGlobalEnables (&SetBmcGlobalEnables, &CompletionCode);
-- 
2.18.0.windows.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-16  5:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-02 12:05 [PATCH] AdvancedFeaturePkg/BmcElog: Change arithmetic logic Zhang, Shenglei
2019-09-02 12:05 ` [PATCH] AdvancedFeaturePkg/BmcElog: Initialize ClearSelResponse Zhang, Shenglei
2019-09-16  5:11   ` [edk2-devel] " Liming Gao
2019-09-16  5:11 ` [edk2-devel] [PATCH] AdvancedFeaturePkg/BmcElog: Change arithmetic logic Liming Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox