lkml.org 
[lkml]   [2011]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/7] Add assertion checking macros
Date
David Howells <dhowells@redhat.com> writes:
>
> There is no need to display val here in the case the expression fails
> since it can only be 0. If this fails, it produces an error like the
> following:
>
> ------------[ cut here ]------------
> kernel BUG at fs/fscache/main.c:109!
> ASSERTION FAILED

It would be nice to display the expression here like an user space
assert. While it can be looked up in the source it would
make quick eyeballing easier.

Probably wouldn't cost too much additional text size?

>
> (e) ASSERTIFCMP(C, X, OP, Y)
>
> This is a combination of ASSERTIF and ASSERTCMP. For example:
>
> ASSERTIFCMP(test_bit(FSCACHE_OP_EXCLUSIVE, &op->flags),
> object->n_exclusive, >, 0);

You probably want a checkpatch rule with those to only allow a few
selected functions like test_bit. Otherwise people will put real side
effects in there.

-Andi

--
ak@linux.intel.com -- Speaking for myself only


\
 
 \ /
  Last update: 2011-12-16 22:41    [W:0.850 / U:0.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site