login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
November
»
21
Re: [PATCHv4 10/17] pps: use BUG_ON for kernel API safety checks
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Alexander Gordeev
Subject:
Re: [PATCHv4 10/17] pps: use BUG_ON for kernel API safety checks
Date: Saturday, November 20, 2010 - 5:40 pm
В Sat, 20 Nov 2010 09:01:41 -0800 Joe Perches <joe@perches.com> пишет:
quoted text
> On Sat, 2010-11-20 at 17:13 +0100, Rodolfo Giometti wrote: > > On Thu, Nov 18, 2010 at 07:01:03PM +0300, Alexander Gordeev wrote: > > > 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 <lasaine@lvk.cs.msu.su> > [] > > > diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c > > > @@ -179,10 +168,8 @@ void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event, > > > int captured = 0; > > > struct pps_ktime ts_real; > > > > > > - if ((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0) { > > > - dev_err(pps->dev, "unknown event (%x)\n", event); > > > - return; > > > - } > > > + /* check event type */ > > > + BUG_ON((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0); > > > > Ack. > > > > This is a correct usage of BUG_ON. :) > > I don't think that's true. > > /* > * Don't use BUG() or BUG_ON() unless there's really no way out; one > * example might be detecting data structure corruption in the middle > * of an operation that can't be backed out of. If the (sub)system > * can somehow continue operating, perhaps with reduced functionality, > * it's probably not BUG-worthy. > * > * If you're tempted to BUG(), think again: is completely giving up > * really the *only* solution? There are usually better options, where > * users don't need to reboot ASAP and can mostly shut down cleanly. > */
Hmm, didn't check that before. What is more appropriate in this situation? -- Alexander
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCHv4 00/17] pps: several fixes and improvements
, Alexander Gordeev
, (Thu Nov 18, 9:00 am)
[PATCHv4 02/17] pps: declare variables where they are used ...
, Alexander Gordeev
, (Thu Nov 18, 9:00 am)
[PATCHv4 04/17] pps: unify timestamp gathering
, Alexander Gordeev
, (Thu Nov 18, 9:00 am)
[PATCHv4 05/17] pps: access pps device by direct pointer
, Alexander Gordeev
, (Thu Nov 18, 9:00 am)
[PATCHv4 06/17] pps: convert printk/pr_* to dev_*
, Alexander Gordeev
, (Thu Nov 18, 9:00 am)
[PATCHv4 07/17] pps: move idr stuff to pps.c
, Alexander Gordeev
, (Thu Nov 18, 9:01 am)
[PATCHv4 08/17] pps: add async PPS event handler
, Alexander Gordeev
, (Thu Nov 18, 9:01 am)
[PATCHv4 09/17] pps: don't disable interrupts when using s ...
, Alexander Gordeev
, (Thu Nov 18, 9:01 am)
[PATCHv4 10/17] pps: use BUG_ON for kernel API safety checks
, Alexander Gordeev
, (Thu Nov 18, 9:01 am)
[PATCHv4 11/17] pps: simplify conditions a bit
, Alexander Gordeev
, (Thu Nov 18, 9:01 am)
[PATCHv4 12/17] pps: timestamp is always passed to dcd_cha ...
, Alexander Gordeev
, (Thu Nov 18, 9:01 am)
[PATCHv4 13/17] ntp: add hardpps implementation
, Alexander Gordeev
, (Thu Nov 18, 9:01 am)
[PATCHv4 14/17] pps: capture MONOTONIC_RAW timestamps as well
, Alexander Gordeev
, (Thu Nov 18, 9:01 am)
[PATCHv4 15/17] pps: add kernel consumer support
, Alexander Gordeev
, (Thu Nov 18, 9:01 am)
[PATCHv4 16/17] pps: add parallel port PPS client
, Alexander Gordeev
, (Thu Nov 18, 9:01 am)
Re: [PATCHv4 14/17] pps: capture MONOTONIC_RAW timestamps ...
, john stultz
, (Thu Nov 18, 12:42 pm)
Re: [PATCHv4 05/17] pps: access pps device by direct pointer
, Rodolfo Giometti
, (Sat Nov 20, 8:44 am)
Re: [PATCHv4 06/17] pps: convert printk/pr_* to dev_*
, Rodolfo Giometti
, (Sat Nov 20, 8:49 am)
Re: [PATCHv4 07/17] pps: move idr stuff to pps.c
, Rodolfo Giometti
, (Sat Nov 20, 8:51 am)
Re: [PATCHv4 08/17] pps: add async PPS event handler
, Rodolfo Giometti
, (Sat Nov 20, 9:08 am)
Re: [PATCHv4 09/17] pps: don't disable interrupts when usi ...
, Rodolfo Giometti
, (Sat Nov 20, 9:09 am)
Re: [PATCHv4 10/17] pps: use BUG_ON for kernel API safety ...
, Rodolfo Giometti
, (Sat Nov 20, 9:13 am)
Re: [PATCHv4 11/17] pps: simplify conditions a bit
, Rodolfo Giometti
, (Sat Nov 20, 9:15 am)
Re: [PATCHv4 12/17] pps: timestamp is always passed to dcd ...
, Rodolfo Giometti
, (Sat Nov 20, 9:23 am)
Re: [PATCHv4 13/17] ntp: add hardpps implementation
, Rodolfo Giometti
, (Sat Nov 20, 9:27 am)
Re: [PATCHv4 10/17] pps: use BUG_ON for kernel API safety ...
, Joe Perches
, (Sat Nov 20, 10:01 am)
Re: [PATCHv4 10/17] pps: use BUG_ON for kernel API safety ...
, Rodolfo Giometti
, (Sat Nov 20, 11:30 am)
Re: [PATCHv4 06/17] pps: convert printk/pr_* to dev_*
, Alexander Gordeev
, (Sat Nov 20, 2:33 pm)
Re: [PATCHv4 06/17] pps: convert printk/pr_* to dev_*
, Joe Perches
, (Sat Nov 20, 2:42 pm)
Re: [PATCHv4 05/17] pps: access pps device by direct pointer
, Alexander Gordeev
, (Sat Nov 20, 3:33 pm)
Re: [PATCHv4 06/17] pps: convert printk/pr_* to dev_*
, Alexander Gordeev
, (Sat Nov 20, 3:38 pm)
Re: [PATCHv4 08/17] pps: add async PPS event handler
, Alexander Gordeev
, (Sat Nov 20, 4:23 pm)
Re: [PATCHv4 10/17] pps: use BUG_ON for kernel API safety ...
, Alexander Gordeev
, (Sat Nov 20, 5:13 pm)
Re: [PATCHv4 10/17] pps: use BUG_ON for kernel API safety ...
, Alexander Gordeev
, (Sat Nov 20, 5:40 pm)
Re: [PATCHv4 12/17] pps: timestamp is always passed to dcd ...
, Alexander Gordeev
, (Sat Nov 20, 5:44 pm)
Re: [PATCHv4 13/17] ntp: add hardpps implementation
, Alexander Gordeev
, (Sat Nov 20, 6:05 pm)
Re: [PATCHv4 10/17] pps: use BUG_ON for kernel API safety ...
, Joe Perches
, (Sat Nov 20, 6:18 pm)
Re: [PATCHv4 06/17] pps: convert printk/pr_* to dev_*
, Rodolfo Giometti
, (Sun Nov 21, 1:19 am)
Re: [PATCHv4 05/17] pps: access pps device by direct pointer
, Rodolfo Giometti
, (Sun Nov 21, 1:26 am)
Re: [PATCHv4 08/17] pps: add async PPS event handler
, Rodolfo Giometti
, (Sun Nov 21, 1:37 am)
Re: [PATCHv4 10/17] pps: use BUG_ON for kernel API safety ...
, Rodolfo Giometti
, (Sun Nov 21, 1:41 am)
Re: [PATCHv4 10/17] pps: use BUG_ON for kernel API safety ...
, Rodolfo Giometti
, (Sun Nov 21, 1:42 am)
Re: [PATCHv4 12/17] pps: timestamp is always passed to dcd ...
, Rodolfo Giometti
, (Sun Nov 21, 1:42 am)
Re: [PATCHv4 05/17] pps: access pps device by direct pointer
, Alan Cox
, (Sun Nov 21, 7:12 am)
Re: [PATCHv4 05/17] pps: access pps device by direct pointer
, Alexander Gordeev
, (Mon Nov 22, 7:55 am)
Re: [PATCHv4 05/17] pps: access pps device by direct pointer
, Alexander Gordeev
, (Mon Nov 22, 8:01 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Paul Turner
[tg_shares_up rewrite v4 11/11] sched: update tg->shares after cpu.shares write
Pete/Piet Delaney
Re: [Kgdb-bugreport] 2.6.23-rc3-mm1: kgdb build failure on powerpc
H. Peter Anvin
Re: [patch 0/2] Immediate Values - jump patching update
Adrian Bunk
2.6.23-rc3-mm1: m32r defconfig compile error
Hugh Dickins
Re: [PATCH -v8 3/4] Enable the MS_ASYNC functionality in sys_msync()
git
:
Han-Wen Nienhuys
Re: Cleaning up git user-interface warts
Brandon Casey
Re: [PATCH] git-relink: avoid hard linking in objects/info directory
Johannes Schindelin
Re: [PATCH] Documentation: config: add 'help.*' and 'instaweb.*' variables.
Steffen Prohaska
Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
Felipe Contreras
Re: [PATCH v3 01/10] config: Codestyle cleanups.
git-commits-head
:
Linux Kernel Mailing List
ALSA: hda - Enable beep on Realtek codecs with PCI SSID override
Linux Kernel Mailing List
vhost: Fix host panic if ioctl called with wrong index
Linux Kernel Mailing List
ACPI : Disable the device's ability to wake the sleeping system in the boot phase
Linux Kernel Mailing List
Staging: add poch driver
Linux Kernel Mailing List
Staging: epl: remove NEAR
linux-netdev
:
Marcel Holtmann
Re: [PATCH 1/1] iwmc3200: add more SDIO device ids
David Miller
Re: [PATCH 1/3] f_phonet: dev_kfree_skb instead of dev_kfree_skb_any in TX callback
Eric Dumazet
Re: TCP-MD5 checksum failure on x86_64 SMP
Jarek Poplawski
Re: rib_trie / Fix inflate_threshold_root. Now=15 size=11 bits
Ilpo Järvinen
Re: [RFC] TCP illinois max rtt aging
freebsd-current
:
Rui Paulo
802.11s (wireless mesh) project status report
Andrew Thompson
Re: Apparent moused regression since r189490
Aryeh Friedman
SATA and PATA drives are mutually exclusive
Robert Kent
Re: [HEADSUP] amd64 suspend/resume code to be comitted
Remko Lodder
[Fwd: Re: kern/118258 sysctl causing panics on 7.0-xxx]
Colocation donated by:
Syndicate