Skip to content

Commit 29f347c

Browse files
agotorvalds
authored andcommitted
pps: use BUG_ON for kernel API safety checks
This way less overhead is involved when running production kernel. If you want to debug a pps client module please define DEBUG to enable the checks. 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 2a5cd6e commit 29f347c

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
@@ -166,10 +166,8 @@ void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event,
166166
int captured = 0;
167167
struct pps_ktime ts_real;
168168

169-
if ((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0) {
170-
dev_err(pps->dev, "unknown event (%x)\n", event);
171-
return;
172-
}
169+
/* check event type */
170+
BUG_ON((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0);
173171

174172
dev_dbg(pps->dev, "PPS event at %ld.%09ld\n",
175173
ts->ts_real.tv_sec, ts->ts_real.tv_nsec);

0 commit comments

Comments
 (0)