Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/55985 )
Change subject: util/intelp2m: use import once for all included modules ......................................................................
util/intelp2m: use import once for all included modules
There is no need to repeat "import" for each module in GoLang. Use this keyword only once in each file for code cleanliness.
Change-Id: Ibb24fafd409b31b174946a39ca1f810d59b87e76 Signed-off-by: Maxim Polyakov max.senia.poliak@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/55985 Reviewed-by: Angel Pons th3fanbus@gmail.com Reviewed-by: Matt DeVillier matt.devillier@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M util/intelp2m/fields/cb/cb.go M util/intelp2m/fields/fields.go M util/intelp2m/fields/raw/raw.go M util/intelp2m/main.go M util/intelp2m/parser/parser.go M util/intelp2m/platforms/apl/macro.go M util/intelp2m/platforms/cnl/macro.go M util/intelp2m/platforms/common/macro.go M util/intelp2m/platforms/lbg/macro.go M util/intelp2m/platforms/snr/macro.go 10 files changed, 62 insertions(+), 56 deletions(-)
Approvals: build bot (Jenkins): Verified Matt DeVillier: Looks good to me, but someone else must approve Angel Pons: Looks good to me, approved
diff --git a/util/intelp2m/fields/cb/cb.go b/util/intelp2m/fields/cb/cb.go index 3bda62e..3603aac 100644 --- a/util/intelp2m/fields/cb/cb.go +++ b/util/intelp2m/fields/cb/cb.go @@ -1,7 +1,9 @@ package cb
-import "../../config" -import "../../platforms/common" +import ( + "../../config" + "../../platforms/common" +)
type FieldMacros struct {}
diff --git a/util/intelp2m/fields/fields.go b/util/intelp2m/fields/fields.go index d2ca0e8..e8d8625 100644 --- a/util/intelp2m/fields/fields.go +++ b/util/intelp2m/fields/fields.go @@ -1,11 +1,12 @@ package fields
-import "../config" -import "../platforms/common" - -import "./fsp" -import "./cb" -import "./raw" +import ( + "../config" + "../platforms/common" + "./fsp" + "./cb" + "./raw" +)
// InterfaceSet - set the interface for decoding configuration // registers DW0 and DW1. diff --git a/util/intelp2m/fields/raw/raw.go b/util/intelp2m/fields/raw/raw.go index a54e51d..e6fa25c 100644 --- a/util/intelp2m/fields/raw/raw.go +++ b/util/intelp2m/fields/raw/raw.go @@ -1,7 +1,9 @@ package raw
-import "fmt" -import "../../platforms/common" +import ( + "fmt" + "../../platforms/common" +)
type FieldMacros struct {}
diff --git a/util/intelp2m/main.go b/util/intelp2m/main.go index 511f54d..fdfc34f 100644 --- a/util/intelp2m/main.go +++ b/util/intelp2m/main.go @@ -1,11 +1,12 @@ package main
-import "flag" -import "fmt" -import "os" - -import "./parser" -import "./config" +import ( + "flag" + "fmt" + "os" + "./parser" + "./config" +)
// generateOutputFile - generates include file // parser : parser data structure diff --git a/util/intelp2m/parser/parser.go b/util/intelp2m/parser/parser.go index c0dc65f..bfcdff8 100644 --- a/util/intelp2m/parser/parser.go +++ b/util/intelp2m/parser/parser.go @@ -5,15 +5,14 @@ "fmt" "strings" "strconv" + "../platforms/common" + "../platforms/snr" + "../platforms/lbg" + "../platforms/apl" + "../platforms/cnl" + "../config" )
-import "../platforms/common" -import "../platforms/snr" -import "../platforms/lbg" -import "../platforms/apl" -import "../platforms/cnl" -import "../config" - // PlatformSpecific - platform-specific interface type PlatformSpecific interface { GenMacro(id string, dw0 uint32, dw1 uint32, ownership uint8) string diff --git a/util/intelp2m/platforms/apl/macro.go b/util/intelp2m/platforms/apl/macro.go index 0364067..5f27074 100644 --- a/util/intelp2m/platforms/apl/macro.go +++ b/util/intelp2m/platforms/apl/macro.go @@ -1,12 +1,12 @@ package apl
-import "fmt" -import "strconv" - -// Local packages -import "../common" -import "../../config" -import "../../fields" +import ( + "fmt" + "strconv" + "../common" + "../../config" + "../../fields" +)
const ( PAD_CFG_DW0_RO_FIELDS = (0x1 << 27) | (0x1 << 24) | (0x3 << 21) | (0xf << 16) | 0xfc diff --git a/util/intelp2m/platforms/cnl/macro.go b/util/intelp2m/platforms/cnl/macro.go index c3bdfc8..714bfa1 100644 --- a/util/intelp2m/platforms/cnl/macro.go +++ b/util/intelp2m/platforms/cnl/macro.go @@ -1,13 +1,13 @@ package cnl
-import "strings" -import "fmt" - -// Local packages -import "../common" -import "../../config" -import "../../fields" -import "../snr" +import ( + "strings" + "fmt" + "../common" + "../../config" + "../../fields" + "../snr" +)
const ( PAD_CFG_DW0_RO_FIELDS = (0x1 << 27) | (0x1 << 24) | (0x3 << 21) | (0xf << 16) | 0xfc diff --git a/util/intelp2m/platforms/common/macro.go b/util/intelp2m/platforms/common/macro.go index 38937f6..ed42729 100644 --- a/util/intelp2m/platforms/common/macro.go +++ b/util/intelp2m/platforms/common/macro.go @@ -1,9 +1,10 @@ package common
-import "strconv" -import "sync" - -import "../../config" +import ( + "strconv" + "sync" + "../../config" +)
type Fields interface { DecodeDW0() diff --git a/util/intelp2m/platforms/lbg/macro.go b/util/intelp2m/platforms/lbg/macro.go index 6b44a25..003ea3f 100644 --- a/util/intelp2m/platforms/lbg/macro.go +++ b/util/intelp2m/platforms/lbg/macro.go @@ -1,12 +1,12 @@ package lbg
-import "fmt" - -// Local packages -import "../../config" -import "../../fields" -import "../common" -import "../snr" +import ( + "fmt" + "../../config" + "../../fields" + "../common" + "../snr" +)
const ( PAD_CFG_DW0_RO_FIELDS = (0x1 << 27) | (0x1 << 24) | (0x3 << 21) | (0xf << 16) | 0xfc diff --git a/util/intelp2m/platforms/snr/macro.go b/util/intelp2m/platforms/snr/macro.go index fb530c5..cebb0cd 100644 --- a/util/intelp2m/platforms/snr/macro.go +++ b/util/intelp2m/platforms/snr/macro.go @@ -1,12 +1,12 @@ package snr
-import "strings" -import "fmt" - -// Local packages -import "../common" -import "../../config" -import "../../fields" +import ( + "strings" + "fmt" + "../common" + "../../config" + "../../fields" +)
const ( PAD_CFG_DW0_RO_FIELDS = (0x1 << 27) | (0x1 << 24) | (0x3 << 21) | (0xf << 16) | 0xfc