zephyr/scripts/coccinelle
Himanshu Jha 58781d5782 coccinelle: Add script to check legal usage of sizeof expression
sizeof when applied to a pointer typed expression gives the size of
the pointer and not the size of the object associated with the pointer
expression leading to errors.

This scripts checks for inconsistencies where sizeof is incorrectly
used, especially while calculating size of memory to be allocated in
memory allocating functions.

Eg:

-	memset(pStr, 0, sizeof(pStr));
+	memset(pStr, 0, sizeof(*pStr));

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-07 10:34:24 -05:00
..
array_size.cocci coccinelle: Add script to enforce ARRAY_SIZE macro usage 2018-10-02 14:03:39 -07:00
deref_null.cocci coccinelle: Add script to report cases of NULL dereference 2018-11-07 10:28:58 -05:00
ignore_return.cocci coccinelle: ignore_return.cocci: Update script 2018-11-07 10:30:11 -05:00
irq_lock.cocci coccinelle: irq_lock.cocci: Update script 2018-11-07 10:31:41 -05:00
mini_lock.cocci coccinelle: Add script to find cases of missing locks 2018-11-07 10:32:59 -05:00
noderef.cocci coccinelle: Add script to check legal usage of sizeof expression 2018-11-07 10:34:24 -05:00
semicolon.cocci coccinelle: Add script to remove redundant semicolon 2018-11-07 10:34:06 -05:00
unsigned_lesser_than_zero.cocci coccinelle: Add script to find cases of unsigned < 0 2018-11-07 10:33:43 -05:00
unsigned_shift.cocci coccinelle: unsigned_shift.cocci: Update script 2018-11-07 10:27:44 -05:00