Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Programmable RF Attenuator
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Programmable RF Attenuator
Commits
8bd16668
Commit
8bd16668
authored
Apr 28, 2023
by
Dimitris Lampridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw: add cppcheck to CI analysis
and fix reported warnings
parent
6fcb20cc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
4 deletions
+16
-4
.gitlab-ci.yml
.gitlab-ci.yml
+9
-0
Makefile
software/lib/Makefile
+6
-0
eeprom.c
software/lib/eeprom.c
+1
-3
liboattnusb.c
software/lib/liboattnusb.c
+0
-1
No files found.
.gitlab-ci.yml
View file @
8bd16668
...
...
@@ -11,6 +11,15 @@ include:
ref
:
master
file
:
'
edl-gitlab-ci.yml'
cppcheck
:
stage
:
analyse
image
:
name
:
gitlab-registry.cern.ch/coht/common-containers/static-analysis:latest
interruptible
:
true
allow_failure
:
true
script
:
-
make -C software/lib cppcheck
build_software
:
stage
:
build
image
:
gitlab-registry.cern.ch/be-cem-edl/evergreen/gitlab-ci/build-fec-sw:latest
...
...
software/lib/Makefile
View file @
8bd16668
...
...
@@ -11,6 +11,8 @@ GIT_VERSION = $(shell git describe --dirty --tags --long)
NAME
=
oattnusb
LIBNAME
=
lib
$(NAME)
CPPCHECK
?=
cppcheck
all
:
lib doc
lib
:
$(LIBNAME).a $(LIBNAME).so
...
...
@@ -28,4 +30,8 @@ clean:
rm
-f
*
.a
*
.o
*
.so
rm
-rf
html
cppcheck
:
$(CPPCHECK)
-I
.
*
.c
*
.h
--error-exitcode
=
1
--suppress
=
missingIncludeSystem
\
--enable
=
warning,style,performance,portability,information,missingInclude
-include
Makefile.install
software/lib/eeprom.c
View file @
8bd16668
...
...
@@ -43,13 +43,11 @@ static void eeprom_backup(unsigned char *eeprom_raw, int sz)
int
oau_factory_program_eeprom
(
unsigned
int
bus
,
unsigned
int
dev
,
char
*
serial
)
{
int
i
;
int
ret
;
int
b
,
d
;
char
devbus
[
16
];
static
uint8_t
eeprom_raw
[
128
];
static
char
ser
[
64
];
char
*
ptr
;
struct
ftdi_context
*
ctx
;
if
((
ctx
=
ftdi_new
())
==
NULL
)
{
...
...
@@ -57,7 +55,7 @@ int oau_factory_program_eeprom(unsigned int bus, unsigned int dev, char *serial)
return
-
ENOMEM
;
}
snprintf
(
devbus
,
sizeof
(
devbus
),
"d:%03
d/%03d
"
,
bus
,
dev
);
snprintf
(
devbus
,
sizeof
(
devbus
),
"d:%03
u/%03u
"
,
bus
,
dev
);
ret
=
ftdi_usb_open_string
(
ctx
,
devbus
);
if
(
ret
!=
0
)
{
fprintf
(
stderr
,
"cannot open usb device %s
\n
"
,
devbus
);
...
...
software/lib/liboattnusb.c
View file @
8bd16668
...
...
@@ -179,7 +179,6 @@ int oattnusb_get_nchannels(int fd)
int
oattnusb_list_devices
(
void
)
{
int
i
,
devs
;
struct
oattnusb_devarray
*
list
;
list
=
oattnusb_get_devarray
(
OATTNUSB_VENDOR_ID
,
OATTNUSB_DEVICE_ID
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment