summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-10-13 13:00:42 -0700
committerPatrick Venture <venture@google.com>2018-10-31 01:46:08 +0000
commit4491a46fb05d1d9c90fed3452157645b339b9dab (patch)
treec1f49a319df811b5f4bfd7b582f1f53186f53b7f /app
parent85f9819177505a6930be1443d755eaf2f7cfaf2e (diff)
downloadphosphor-host-ipmid-4491a46fb05d1d9c90fed3452157645b339b9dab.zip
phosphor-host-ipmid-4491a46fb05d1d9c90fed3452157645b339b9dab.tar.gz
cleanup: scope reduction
[app/channel.cpp:102]: (style) The scope of the variable 'resp' can be reduced. [ipmisensor.cpp:310]: (style) The scope of the variable 'i' can be reduced. [ipmid.cpp:506]: (style) The scope of the variable 'num_handlers' can be reduced. [read_fru_data.cpp:82]: (style) The scope of the variable 'fruId' can be reduced. [sensorhandler.cpp:256]: (style) The scope of the variable 'p' can be reduced. [storageaddsel.cpp:68]: (style) The scope of the variable 'p' can be reduced. Also delete two extra vertical lines. Change-Id: I8e72f8e1d94381f456674abf523d2f2fbdd8046d Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'app')
-rw-r--r--app/channel.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/app/channel.cpp b/app/channel.cpp
index 6db987f..8d765c5 100644
--- a/app/channel.cpp
+++ b/app/channel.cpp
@@ -99,15 +99,6 @@ ipmi_ret_t ipmi_app_channel_info(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
ipmi_context_t context)
{
ipmi_ret_t rc = IPMI_CC_OK;
- uint8_t resp[] = {1,
- IPMI_CHANNEL_MEDIUM_TYPE_OTHER,
- IPMI_CHANNEL_TYPE_IPMB,
- 1,
- 0x41,
- 0xA7,
- 0x00,
- 0,
- 0};
uint8_t* p = (uint8_t*)request;
int channel = (*p) & CHANNEL_MASK;
std::string ethdevice = ipmi::network::ChanneltoEthernet(channel);
@@ -122,6 +113,16 @@ ipmi_ret_t ipmi_app_channel_info(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
}
else
{
+ uint8_t resp[] = {1,
+ IPMI_CHANNEL_MEDIUM_TYPE_OTHER,
+ IPMI_CHANNEL_TYPE_IPMB,
+ 1,
+ 0x41,
+ 0xA7,
+ 0x00,
+ 0,
+ 0};
+
*data_len = sizeof(resp);
memcpy(response, resp, *data_len);
}
OpenPOWER on IntegriCloud