Re: [PATCH 2/6] BC: beancounters core (API)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 24 Aug 2006 16:06:11 +0400
Kirill Korotaev <[email protected]> wrote:

> >>+#define bc_charge_locked(bc, r, v, s)			(0)
> >>> +#define bc_charge(bc, r, v)				(0)
> >
> >akpm:/home/akpm> cat t.c
> >void foo(void)
> >{
> >	(0);
> >}
> >akpm:/home/akpm> gcc -c -Wall t.c
> >t.c: In function 'foo':
> >t.c:4: warning: statement with no effect
> 
> these functions return value should always be checked (!).

We have __must_check for that.

> i.e. it is never called like:
>   ub_charge(bc, r, v);

Also...

	if (bc_charge(tpyo, undefined_variable, syntax_error))

will happily compile if !CONFIG_BEANCOUNTER.

Turning these stubs into static inline __must_check functions fixes all this.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux