Skip to content

Commit

Permalink
pps: simplify conditions a bit
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
ago authored and torvalds committed Jan 13, 2011
1 parent 29f347c commit 818b9ee
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/pps/kapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event,

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

captured = ~0;
}
if ((event & PPS_CAPTURECLEAR) &
(pps->params.mode & PPS_CAPTURECLEAR)) {
if (event & pps->params.mode & PPS_CAPTURECLEAR) {
/* We have to add an offset? */
if (pps->params.mode & PPS_OFFSETCLEAR)
pps_add_offset(&ts_real,
Expand Down

0 comments on commit 818b9ee

Please sign in to comment.