Skip to content

Commit 818b9ee

Browse files
agotorvalds
authored andcommitted
pps: simplify conditions a bit
Bitwise conjunction is distributive so we can simplify some conditions. Signed-off-by: Alexander Gordeev <[email protected]> Acked-by: Rodolfo Giometti <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 29f347c commit 818b9ee

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pps/kapi.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event,
182182

183183
/* Check the event */
184184
pps->current_mode = pps->params.mode;
185-
if ((event & PPS_CAPTUREASSERT) &
186-
(pps->params.mode & PPS_CAPTUREASSERT)) {
185+
if (event & pps->params.mode & PPS_CAPTUREASSERT) {
187186
/* We have to add an offset? */
188187
if (pps->params.mode & PPS_OFFSETASSERT)
189188
pps_add_offset(&ts_real,
@@ -197,8 +196,7 @@ void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event,
197196

198197
captured = ~0;
199198
}
200-
if ((event & PPS_CAPTURECLEAR) &
201-
(pps->params.mode & PPS_CAPTURECLEAR)) {
199+
if (event & pps->params.mode & PPS_CAPTURECLEAR) {
202200
/* We have to add an offset? */
203201
if (pps->params.mode & PPS_OFFSETCLEAR)
204202
pps_add_offset(&ts_real,

0 commit comments

Comments
 (0)