RE: a small doubt

Bret Indrelee (bindrelee@sbs-cp.com)
Fri, 8 Oct 1999 09:57:51 -0500


Alex Nicolaou [mailto:anicolao@cgl.uwaterloo.ca] wrote:
> Bret Indrelee wrote:
> > Oliver Xymoron [mailto:oxymoron@waste.org] wrote:
> > > #ifndef OOPS
> > > #define OOPS() (*(int *)0=0)
> > > #endif
> >
> > What is wrong with just using the existing panic() from kernel.h?
>
> Why reboot the machine when an Ooops message would do?

I thought the original code came from a driver running in the kernel.
Dereferencing a NULL pointer in kernel typically causes the system to crash
and reboot.

If this was happening in a normal application, I would recommend something
like:
assert(TRUE)
or assert with the condition that caused you to roll over and die.

In either case, there is no reason to add a new macro to handle a situation
that can be better handled either by assert (for application code) or panic
(for kernel code).

-Bret

-------------------------------------------------------------
SBS Technologies, Connectivity Products
... solutions for real-time connectivity

Bret Indrelee, Engineer
SBS Technologies, Inc., Connectivity Products
1284 Corporate Center Drive, St. Paul MN 55121
Direct: (651) 905-4731
Main: (651) 905-4700 Fax: (651) 905-4701
E-mail: bindrelee@sbs-cp.com http://www.sbs.com
-------------------------------------------------------------

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/