diff options
author | Lee Leahy <leroy.p.leahy@intel.com> | 2017-03-17 10:43:25 -0700 |
---|---|---|
committer | Lee Leahy <leroy.p.leahy@intel.com> | 2017-03-17 19:21:35 +0100 |
commit | 8a9c7dc08712e71bec5bc92bbaf93bf43126cd0d (patch) | |
tree | edfa1b727a4deab19352c7a1dddeccf672b4e4f4 /src/soc/intel/broadwell/smbus_common.c | |
parent | 23602dfd6812dba0499318e1ec25492faa17febb (diff) | |
download | coreboot-8a9c7dc08712e71bec5bc92bbaf93bf43126cd0d.tar.xz |
soc/intel/broadwell: Fix {}, () and conditional issues
Fix the following errors and warnings detected by checkpatch:
ERROR: open brace '{' following struct go on the same line
ERROR: return is not a function, parentheses are not required
ERROR: do not use assignment in if condition
ERROR: trailing statements should be on next line
WARNING: else is not generally useful after a break or return
WARNING: braces {} are not necessary for single statement blocks
WARNING: braces {} are not necessary for any arm of this statement
TEST=None
Change-Id: I9414341b0c778c252db33f0ef4847b9530681d96
Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com>
Reviewed-on: https://review.coreboot.org/18884
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/soc/intel/broadwell/smbus_common.c')
-rw-r--r-- | src/soc/intel/broadwell/smbus_common.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/soc/intel/broadwell/smbus_common.c b/src/soc/intel/broadwell/smbus_common.c index e392f4050e..29b7dbbe9d 100644 --- a/src/soc/intel/broadwell/smbus_common.c +++ b/src/soc/intel/broadwell/smbus_common.c @@ -62,9 +62,9 @@ int do_smbus_read_byte(unsigned int smbus_base, unsigned int device, unsigned char global_status_register; unsigned char byte; - if (smbus_wait_until_ready(smbus_base) < 0) { + if (smbus_wait_until_ready(smbus_base) < 0) return SMBUS_WAIT_UNTIL_READY_TIMEOUT; - } + /* Setup transaction */ /* Disable interrupts */ outb(inb(smbus_base + SMBHSTCTL) & (~1), smbus_base + SMBHSTCTL); @@ -86,9 +86,8 @@ int do_smbus_read_byte(unsigned int smbus_base, unsigned int device, smbus_base + SMBHSTCTL); /* Poll for transaction completion */ - if (smbus_wait_until_done(smbus_base) < 0) { + if (smbus_wait_until_done(smbus_base) < 0) return SMBUS_WAIT_UNTIL_DONE_TIMEOUT; - } global_status_register = inb(smbus_base + SMBHSTSTAT); @@ -97,9 +96,8 @@ int do_smbus_read_byte(unsigned int smbus_base, unsigned int device, /* Read results of transaction */ byte = inb(smbus_base + SMBHSTDAT0); - if (global_status_register != (1 << 1)) { + if (global_status_register != (1 << 1)) return SMBUS_ERROR; - } return byte; } |