History

soc: mediatek: cmdq: remove OR opertaion from err return

Debugging gets harder if we OR two error return values. Return each error on it's own instead

Bibby Hsieh committed 6 years ago

Commit 01d1b401 parent e42617b1 file · +8 −3Browse files

Unified · Split

drivers/soc/mediatek/mtk-cmdq-helper.c+8−3
@@ -149,13 +149,16 @@ int cmdq_pkt_write_mask(struct cmdq_pkt *pkt, u8 subsys, · 148 unmodified lines
149149 u16 offset, u32 value, u32 mask)
150150 {
151151 u32 offset_mask = offset;
152− int err = 0;
152+ int err;
153153
154154 if (mask != 0xffffffff) {
155155 err = cmdq_pkt_append_command(pkt, CMDQ_CODE_MASK, 0, ~mask);
156+ if (err < 0)
157+ return err;
158+
156159 offset_mask |= CMDQ_WRITE_ENABLE_MASK;
157160 }
158− err |= cmdq_pkt_write(pkt, subsys, offset_mask, value);
161+ err = cmdq_pkt_write(pkt, subsys, offset_mask, value);
159162
160163 return err;
161164 }
@@ -197,9 +200,11 @@ static int cmdq_pkt_finalize(struct cmdq_pkt *pkt) · 35 unmodified lines
197200
198201 /* insert EOC and generate IRQ for each command iteration */
199202 err = cmdq_pkt_append_command(pkt, CMDQ_CODE_EOC, 0, CMDQ_EOC_IRQ_EN);
203+ if (err < 0)
204+ return err;
200205
201206 /* JUMP to end */
202− err |= cmdq_pkt_append_command(pkt, CMDQ_CODE_JUMP, 0, CMDQ_JUMP_PASS);
207+ err = cmdq_pkt_append_command(pkt, CMDQ_CODE_JUMP, 0, CMDQ_JUMP_PASS);
203208
204209 return err;
205210 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t