Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple PCIe FMC carrier SPEC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Simple PCIe FMC carrier SPEC
Commits
daf7995a
Commit
daf7995a
authored
Apr 12, 2019
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:drv: improvements form cppcheck
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
e24273e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
+10
-11
spec-fpga.c
kernel/spec-fpga.c
+3
-4
spec-irq.c
kernel/spec-irq.c
+7
-7
No files found.
kernel/spec-fpga.c
View file @
daf7995a
...
...
@@ -158,11 +158,10 @@ static int gn4124_fpga_fcl_init(struct spec_dev *spec, int last_word_size)
static
int
gn4124_fpga_fcl_waitdone
(
struct
spec_dev
*
spec
)
{
unsigned
long
j
;
uint32_t
val
;
j
=
jiffies
+
2
*
HZ
;
while
(
1
)
{
val
=
gennum_readl
(
spec
,
FCL_IRQ
);
uint32_t
val
=
gennum_readl
(
spec
,
FCL_IRQ
);
/* Done */
if
(
val
&
0x8
)
...
...
@@ -192,13 +191,13 @@ static int gn4124_fpga_fcl_waitdone(struct spec_dev *spec)
static
int
gn4124_fpga_load
(
struct
spec_dev
*
spec
,
const
void
*
data
,
int
len
)
{
int
size32
=
(
len
+
3
)
>>
2
;
int
done
=
0
,
wrote
=
0
,
i
;
int
done
=
0
,
wrote
=
0
;
const
uint32_t
*
data32
=
data
;
while
(
size32
>
0
)
{
/* Check to see if FPGA configuation has error */
i
=
gennum_readl
(
spec
,
FCL_IRQ
);
i
nt
i
=
gennum_readl
(
spec
,
FCL_IRQ
);
if
(
(
i
&
8
)
&&
wrote
)
{
done
=
1
;
printk
(
"%s: %i: done after %i
\n
"
,
__func__
,
__LINE__
,
...
...
kernel/spec-irq.c
View file @
daf7995a
...
...
@@ -207,10 +207,9 @@ out_enable_irq:
static
irqreturn_t
spec_irq_sw_handler
(
int
irq
,
void
*
arg
)
{
struct
spec_dev
*
spec
=
arg
;
uint32_t
int_stat
;
/* Ack the interrupts */
int_stat
=
gennum_readl
(
spec
,
GNINT_STAT
);
gennum_readl
(
spec
,
GNINT_STAT
);
gennum_writel
(
spec
,
0x0000
,
GNINT_STAT
);
complete
(
&
spec
->
compl
);
...
...
@@ -365,13 +364,13 @@ static int spec_irq_sw_test(struct spec_dev *spec)
*/
int
spec_irq_init
(
struct
spec_dev
*
spec
)
{
int
irq
=
to_pci_dev
(
spec
->
dev
.
parent
)
->
irq
;
int
err
;
int
i
;
int
irq
,
err
,
i
;
if
(
!
spec
)
return
-
EINVAL
;
irq
=
to_pci_dev
(
spec
->
dev
.
parent
)
->
irq
;
/* disable all source of interrupts */
for
(
i
=
0
;
i
<
7
;
i
++
)
gennum_writel
(
spec
,
0
,
GNINT_CFG
(
i
));
...
...
@@ -421,12 +420,13 @@ err_gpio:
void
spec_irq_exit
(
struct
spec_dev
*
spec
)
{
int
i
;
int
irq
=
to_pci_dev
(
spec
->
dev
.
parent
)
->
irq
;
int
i
,
irq
;
if
(
!
spec
)
return
;
irq
=
to_pci_dev
(
spec
->
dev
.
parent
)
->
irq
;
/* disable all source of interrupts */
for
(
i
=
0
;
i
<
7
;
i
++
)
gennum_writel
(
spec
,
0
,
GNINT_CFG
(
i
));
...
...
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