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
149 u16 offset, u32 value, u32 mask)149 u16 offset, u32 value, u32 mask)
150{150{
151 u32 offset_mask = offset;151 u32 offset_mask = offset;
152 int err = 0;152 int err;
153 153
154 if (mask != 0xffffffff) {154 if (mask != 0xffffffff) {
155 err = cmdq_pkt_append_command(pkt, CMDQ_CODE_MASK, 0, ~mask);155 err = cmdq_pkt_append_command(pkt, CMDQ_CODE_MASK, 0, ~mask);
156 if (err < 0)
157 return err;
158
156 offset_mask |= CMDQ_WRITE_ENABLE_MASK;159 offset_mask |= CMDQ_WRITE_ENABLE_MASK;
157 }160 }
158 err |= cmdq_pkt_write(pkt, subsys, offset_mask, value);161 err = cmdq_pkt_write(pkt, subsys, offset_mask, value);
159 162
160 return err;163 return err;
161}164}
@@ -197,9 +200,11 @@ static int cmdq_pkt_finalize(struct cmdq_pkt *pkt) · 35 unmodified lines
197 200
198 /* insert EOC and generate IRQ for each command iteration */201 /* insert EOC and generate IRQ for each command iteration */
199 err = cmdq_pkt_append_command(pkt, CMDQ_CODE_EOC, 0, CMDQ_EOC_IRQ_EN);202 err = cmdq_pkt_append_command(pkt, CMDQ_CODE_EOC, 0, CMDQ_EOC_IRQ_EN);
203 if (err < 0)
204 return err;
200 205
201 /* JUMP to end */206 /* 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);
203 208
204 return err;209 return err;
205}210}

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