Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mtl models to ci #60

Merged
merged 3 commits into from
Jul 9, 2024
Merged

Add mtl models to ci #60

merged 3 commits into from
Jul 9, 2024

Conversation

macpijan
Copy link

No description provided.

@macpijan
Copy link
Author

macpijan commented Jun 13, 2024

clang-format results in a following diff:

diff --git a/src/board/novacustom/v560tu/board.c b/src/board/novacustom/v560tu/board.c
index 1d99fd571b87..a6c78ffccc7a 100644
--- a/src/board/novacustom/v560tu/board.c
+++ b/src/board/novacustom/v560tu/board.c
@@ -52,7 +52,6 @@ uint8_t board_id(void) {
 exit:
     cached = true;
     return 1;
-
 }
 
 void board_event(void) {
diff --git a/src/ec/ite/adc.c b/src/ec/ite/adc.c
index aefb51d7ea08..5b3a6eb47c1d 100644
--- a/src/ec/ite/adc.c
+++ b/src/ec/ite/adc.c
@@ -8,14 +8,7 @@
 // Based on chromium EC chip/it83xx/adc.c
 
 const struct Vch adc_channels[] = {
-    VCH(0),
-    VCH(1),
-    VCH(2),
-    VCH(3),
-    VCH(4),
-    VCH(5),
-    VCH(6),
-    VCH(7),
+    VCH(0), VCH(1), VCH(2), VCH(3), VCH(4), VCH(5), VCH(6), VCH(7),
 };
 
 void adc_init(void) {
@@ -72,8 +65,7 @@ int16_t adc_read_channel(uint8_t ch) {
         }
     };
 
-    uint32_t measurement = (((*adc_channels[ch].data_hi) & 0x03) << 8)
-                            | *adc_channels[ch].data_lo;
+    uint32_t measurement = (((*adc_channels[ch].data_hi) & 0x03) << 8) | *adc_channels[ch].data_lo;
 
     adc_disable_channel(ch);

We do not like what it does I assume @mkopec ?

Also, 02-clang-format.sh results in:

Checking C style...FAILED
src/board/system76/common/dgpu.c:34:24: error: code should be clang-formatted [-Wclang-format-violations]
#define FAN_POINT(T, D) \
                      ^
src/board/system76/common/include/board/peci.h:18:23: error: code should be clang-formatted [-Wclang-format-violations]
   ((uint32_t)((time)&0x3f) << 17 | (uint32_t)((duty)&0xf) << 24)
                     ^
src/board/system76/common/include/board/peci.h:18:24: error: code should be clang-formatted [-Wclang-format-violations]
   ((uint32_t)((time)&0x3f) << 17 | (uint32_t)((duty)&0xf) << 24)
                      ^
src/board/system76/common/include/board/peci.h:18:55: error: code should be clang-formatted [-Wclang-format-violations]
   ((uint32_t)((time)&0x3f) << 17 | (uint32_t)((duty)&0xf) << 24)
                                                     ^
src/board/system76/common/include/board/peci.h:18:56: error: code should be clang-formatted [-Wclang-format-violations]
   ((uint32_t)((time)&0x3f) << 17 | (uint32_t)((duty)&0xf) << 24)
                                                      ^
src/board/system76/common/include/board/peci.h:20:38: error: code should be clang-formatted [-Wclang-format-violations]
#define PECI_PSYS_PL2(watts) ((watts)*8 | PECI_PL_ENABLE | PECI_PL_CLAMP)
                                    ^
src/board/system76/common/include/board/peci.h:20:39: error: code should be clang-formatted [-Wclang-format-violations]
#define PECI_PSYS_PL2(watts) ((watts)*8 | PECI_PL_ENABLE | PECI_PL_CLAMP)
                                     ^
src/board/system76/common/include/board/peci.h:22:13: error: code should be clang-formatted [-Wclang-format-violations]
   ((watts)*8 | PECI_PL_ENABLE | PECI_PL_CLAMP | PECI_PL_TIME_WINDOW(time, duty))
           ^
src/board/system76/common/include/board/peci.h:22:14: error: code should be clang-formatted [-Wclang-format-violations]
   ((watts)*8 | PECI_PL_ENABLE | PECI_PL_CLAMP | PECI_PL_TIME_WINDOW(time, duty))
            ^
src/board/system76/common/include/board/peci.h:23:33: error: code should be clang-formatted [-Wclang-format-violations]
#define PECI_PL4(watts) ((watts)*8)
                               ^
src/board/system76/common/include/board/peci.h:23:34: error: code should be clang-formatted [-Wclang-format-violations]
#define PECI_PL4(watts) ((watts)*8)
                                ^
src/board/system76/common/usbpd/tps65987.c:56:36: error: code should be clang-formatted [-Wclang-format-violations]
#define PDO_CURRENT_MA(pdo) (((pdo)&0x3FF) * 10)
                                  ^
src/board/system76/common/usbpd/tps65987.c:56:37: error: code should be clang-formatted [-Wclang-format-violations]
#define PDO_CURRENT_MA(pdo) (((pdo)&0x3FF) * 10)
                                   ^

We should either disable/adjust the rules, or fix the code accordingly.

@macpijan macpijan requested a review from mkopec June 13, 2024 09:51
macpijan added 2 commits July 9, 2024 15:40
Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
@mkopec mkopec force-pushed the add-mtl-models-to-ci branch from 0e48b4d to d4ab673 Compare July 9, 2024 13:40
The lint was failing due to my workstation and the job runtime having
different clang-format versions.

pre-commit handles those steps for us already, and can be configured to
use an arbitrary clang version, so just remove the old lint job.

Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
@mkopec mkopec force-pushed the add-mtl-models-to-ci branch from ca034a8 to 8584377 Compare July 9, 2024 13:46
@mkopec
Copy link
Member

mkopec commented Jul 9, 2024

All warnings resolved, had to bump the version of clang-format in pre-commit and remove the old lint job from CI (pre-commit already handles everything it did)

@mkopec mkopec merged commit 8584377 into master Jul 9, 2024
9 checks passed
@mkopec mkopec deleted the add-mtl-models-to-ci branch July 9, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants