Skip to content

Commit e4cf679

Browse files
IlievIliya92mchehab
authored andcommitted
media: drivers: media: pci: b2c2: Fix errors due to unappropriate coding style.
Fix error due to assignment in conditional expression. Fix errors due to absence of empty spaces separators after commas in function calls. Fix errors due to lines longer than 80 characters. Signed-off-by: Iliya Iliev <iliyailiev3592@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
1 parent aaef6a9 commit e4cf679

File tree

1 file changed

+37
-33
lines changed

1 file changed

+37
-33
lines changed

drivers/media/pci/b2c2/flexcop-dma.c

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ int flexcop_dma_allocate(struct pci_dev *pdev,
1717
return -EINVAL;
1818
}
1919

20-
if ((tcpu = pci_alloc_consistent(pdev, size, &tdma)) != NULL) {
20+
tcpu = pci_alloc_consistent(pdev, size, &tdma);
21+
if (tcpu != NULL) {
2122
dma->pdev = pdev;
2223
dma->cpu_addr0 = tcpu;
2324
dma->dma_addr0 = tdma;
@@ -34,31 +35,32 @@ void flexcop_dma_free(struct flexcop_dma *dma)
3435
{
3536
pci_free_consistent(dma->pdev, dma->size*2,
3637
dma->cpu_addr0, dma->dma_addr0);
37-
memset(dma,0,sizeof(struct flexcop_dma));
38+
memset(dma, 0, sizeof(struct flexcop_dma));
3839
}
3940
EXPORT_SYMBOL(flexcop_dma_free);
4041

4142
int flexcop_dma_config(struct flexcop_device *fc,
4243
struct flexcop_dma *dma,
4344
flexcop_dma_index_t dma_idx)
4445
{
45-
flexcop_ibi_value v0x0,v0x4,v0xc;
46-
v0x0.raw = v0x4.raw = v0xc.raw = 0;
46+
flexcop_ibi_value v0x0, v0x4, v0xc;
4747

48+
v0x0.raw = v0x4.raw = v0xc.raw = 0;
4849
v0x0.dma_0x0.dma_address0 = dma->dma_addr0 >> 2;
4950
v0xc.dma_0xc.dma_address1 = dma->dma_addr1 >> 2;
5051
v0x4.dma_0x4_write.dma_addr_size = dma->size / 4;
5152

5253
if ((dma_idx & FC_DMA_1) == dma_idx) {
53-
fc->write_ibi_reg(fc,dma1_000,v0x0);
54-
fc->write_ibi_reg(fc,dma1_004,v0x4);
55-
fc->write_ibi_reg(fc,dma1_00c,v0xc);
54+
fc->write_ibi_reg(fc, dma1_000, v0x0);
55+
fc->write_ibi_reg(fc, dma1_004, v0x4);
56+
fc->write_ibi_reg(fc, dma1_00c, v0xc);
5657
} else if ((dma_idx & FC_DMA_2) == dma_idx) {
57-
fc->write_ibi_reg(fc,dma2_010,v0x0);
58-
fc->write_ibi_reg(fc,dma2_014,v0x4);
59-
fc->write_ibi_reg(fc,dma2_01c,v0xc);
58+
fc->write_ibi_reg(fc, dma2_010, v0x0);
59+
fc->write_ibi_reg(fc, dma2_014, v0x4);
60+
fc->write_ibi_reg(fc, dma2_01c, v0xc);
6061
} else {
61-
err("either DMA1 or DMA2 can be configured within one flexcop_dma_config call.");
62+
err("either DMA1 or DMA2 can be configured within one %s call.",
63+
__func__);
6264
return -EINVAL;
6365
}
6466

@@ -72,8 +74,8 @@ int flexcop_dma_xfer_control(struct flexcop_device *fc,
7274
flexcop_dma_addr_index_t index,
7375
int onoff)
7476
{
75-
flexcop_ibi_value v0x0,v0xc;
76-
flexcop_ibi_register r0x0,r0xc;
77+
flexcop_ibi_value v0x0, v0xc;
78+
flexcop_ibi_register r0x0, r0xc;
7779

7880
if ((dma_idx & FC_DMA_1) == dma_idx) {
7981
r0x0 = dma1_000;
@@ -82,27 +84,28 @@ int flexcop_dma_xfer_control(struct flexcop_device *fc,
8284
r0x0 = dma2_010;
8385
r0xc = dma2_01c;
8486
} else {
85-
err("either transfer DMA1 or DMA2 can be started within one flexcop_dma_xfer_control call.");
87+
err("transfer DMA1 or DMA2 can be started within one %s call.",
88+
__func__);
8689
return -EINVAL;
8790
}
8891

89-
v0x0 = fc->read_ibi_reg(fc,r0x0);
90-
v0xc = fc->read_ibi_reg(fc,r0xc);
92+
v0x0 = fc->read_ibi_reg(fc, r0x0);
93+
v0xc = fc->read_ibi_reg(fc, r0xc);
9194

92-
deb_rdump("reg: %03x: %x\n",r0x0,v0x0.raw);
93-
deb_rdump("reg: %03x: %x\n",r0xc,v0xc.raw);
95+
deb_rdump("reg: %03x: %x\n", r0x0, v0x0.raw);
96+
deb_rdump("reg: %03x: %x\n", r0xc, v0xc.raw);
9497

9598
if (index & FC_DMA_SUBADDR_0)
9699
v0x0.dma_0x0.dma_0start = onoff;
97100

98101
if (index & FC_DMA_SUBADDR_1)
99102
v0xc.dma_0xc.dma_1start = onoff;
100103

101-
fc->write_ibi_reg(fc,r0x0,v0x0);
102-
fc->write_ibi_reg(fc,r0xc,v0xc);
104+
fc->write_ibi_reg(fc, r0x0, v0x0);
105+
fc->write_ibi_reg(fc, r0xc, v0xc);
103106

104-
deb_rdump("reg: %03x: %x\n",r0x0,v0x0.raw);
105-
deb_rdump("reg: %03x: %x\n",r0xc,v0xc.raw);
107+
deb_rdump("reg: %03x: %x\n", r0x0, v0x0.raw);
108+
deb_rdump("reg: %03x: %x\n", r0xc, v0xc.raw);
106109
return 0;
107110
}
108111
EXPORT_SYMBOL(flexcop_dma_xfer_control);
@@ -112,26 +115,27 @@ static int flexcop_dma_remap(struct flexcop_device *fc,
112115
int onoff)
113116
{
114117
flexcop_ibi_register r = (dma_idx & FC_DMA_1) ? dma1_00c : dma2_01c;
115-
flexcop_ibi_value v = fc->read_ibi_reg(fc,r);
116-
deb_info("%s\n",__func__);
118+
flexcop_ibi_value v = fc->read_ibi_reg(fc, r);
119+
120+
deb_info("%s\n", __func__);
117121
v.dma_0xc.remap_enable = onoff;
118-
fc->write_ibi_reg(fc,r,v);
122+
fc->write_ibi_reg(fc, r, v);
119123
return 0;
120124
}
121125

122126
int flexcop_dma_control_size_irq(struct flexcop_device *fc,
123127
flexcop_dma_index_t no,
124128
int onoff)
125129
{
126-
flexcop_ibi_value v = fc->read_ibi_reg(fc,ctrl_208);
130+
flexcop_ibi_value v = fc->read_ibi_reg(fc, ctrl_208);
127131

128132
if (no & FC_DMA_1)
129133
v.ctrl_208.DMA1_IRQ_Enable_sig = onoff;
130134

131135
if (no & FC_DMA_2)
132136
v.ctrl_208.DMA2_IRQ_Enable_sig = onoff;
133137

134-
fc->write_ibi_reg(fc,ctrl_208,v);
138+
fc->write_ibi_reg(fc, ctrl_208, v);
135139
return 0;
136140
}
137141
EXPORT_SYMBOL(flexcop_dma_control_size_irq);
@@ -140,15 +144,15 @@ int flexcop_dma_control_timer_irq(struct flexcop_device *fc,
140144
flexcop_dma_index_t no,
141145
int onoff)
142146
{
143-
flexcop_ibi_value v = fc->read_ibi_reg(fc,ctrl_208);
147+
flexcop_ibi_value v = fc->read_ibi_reg(fc, ctrl_208);
144148

145149
if (no & FC_DMA_1)
146150
v.ctrl_208.DMA1_Timer_Enable_sig = onoff;
147151

148152
if (no & FC_DMA_2)
149153
v.ctrl_208.DMA2_Timer_Enable_sig = onoff;
150154

151-
fc->write_ibi_reg(fc,ctrl_208,v);
155+
fc->write_ibi_reg(fc, ctrl_208, v);
152156
return 0;
153157
}
154158
EXPORT_SYMBOL(flexcop_dma_control_timer_irq);
@@ -158,13 +162,13 @@ int flexcop_dma_config_timer(struct flexcop_device *fc,
158162
flexcop_dma_index_t dma_idx, u8 cycles)
159163
{
160164
flexcop_ibi_register r = (dma_idx & FC_DMA_1) ? dma1_004 : dma2_014;
161-
flexcop_ibi_value v = fc->read_ibi_reg(fc,r);
165+
flexcop_ibi_value v = fc->read_ibi_reg(fc, r);
162166

163-
flexcop_dma_remap(fc,dma_idx,0);
167+
flexcop_dma_remap(fc, dma_idx, 0);
164168

165-
deb_info("%s\n",__func__);
169+
deb_info("%s\n", __func__);
166170
v.dma_0x4_write.dmatimer = cycles;
167-
fc->write_ibi_reg(fc,r,v);
171+
fc->write_ibi_reg(fc, r, v);
168172
return 0;
169173
}
170174
EXPORT_SYMBOL(flexcop_dma_config_timer);

0 commit comments

Comments
 (0)