scripts: Add coccinelle file to use BIT macro

This commit is contained in:
Tim Crawford
2021-02-23 20:05:17 -07:00
committed by Jeremy Soller
parent 7888f214bb
commit 9a3ecba010
3 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
// SPDX-License-Identifier: GPL-3.0-only
// Replace shifts with BIT macro
@@ expression val; @@
-(1 << val)
+BIT(val)
@@ expression val; @@
-(1U << val)
+BIT(val)
@@ expression val; @@
-1 << val
+BIT(val)

View File

@@ -0,0 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-only
// SDCC extenstions that need to be defined away for spatch
#define __at(x)
#define __code
#define __critical
#define __data
#define __reentrant
#define ___