Commit b25943b2 authored by Andrew Morton's avatar Andrew Morton Committed by james toy

may as well depukify it a bit while we're there.



WARNING: plain inline is preferred over __inline__
#22: FILE: lib/crc32.c:47:
+static __inline__ u32

ERROR: space prohibited after that open square bracket '['
#26: FILE: lib/crc32.c:51:
+#  define DO_CRC(x) crc = tab[ (crc ^ (x)) & 255 ] ^ (crc>>8)

ERROR: space prohibited before that close square bracket ']'
#26: FILE: lib/crc32.c:51:
+#  define DO_CRC(x) crc = tab[ (crc ^ (x)) & 255 ] ^ (crc>>8)

ERROR: Macros with complex values should be enclosed in parenthesis
#26: FILE: lib/crc32.c:51:
+#  define DO_CRC(x) crc = tab[ (crc ^ (x)) & 255 ] ^ (crc>>8)

ERROR: space prohibited after that open square bracket '['
#28: FILE: lib/crc32.c:53:
+#  define DO_CRC(x) crc = tab[ ((crc >> 24) ^ (x)) & 255] ^ (crc<<8)

ERROR: Macros with complex values should be enclosed in parenthesis
#28: FILE: lib/crc32.c:53:
+#  define DO_CRC(x) crc = tab[ ((crc >> 24) ^ (x)) & 255] ^ (crc<<8)

ERROR: spaces required around that '=' (ctx:WxV)
#30: FILE: lib/crc32.c:55:
+	const u32 *b =(u32 *)buf;
 	             ^

ERROR: space required before the open parenthesis '('
#34: FILE: lib/crc32.c:59:
+	if(unlikely(((long)b)&3 && len)) {

ERROR: space required before the open parenthesis '('
#53: FILE: lib/crc32.c:78:
+	if(len) {

total: 8 errors, 1 warnings, 145 lines checked

./patches/crc32-minor-optimizations-and-cleanup.patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 528c9ce8
......@@ -44,19 +44,19 @@ MODULE_LICENSE("GPL");
#if CRC_LE_BITS == 8 || CRC_BE_BITS == 8
static __inline__ u32
static inline u32
crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 *tab)
{
# ifdef __LITTLE_ENDIAN
# define DO_CRC(x) crc = tab[ (crc ^ (x)) & 255 ] ^ (crc>>8)
# define DO_CRC(x) crc = tab[(crc ^ (x)) & 255 ] ^ (crc >> 8)
# else
# define DO_CRC(x) crc = tab[ ((crc >> 24) ^ (x)) & 255] ^ (crc<<8)
# define DO_CRC(x) crc = tab[((crc >> 24) ^ (x)) & 255] ^ (crc << 8)
# endif
const u32 *b =(u32 *)buf;
const u32 *b = (const u32 *)buf;
size_t rem_len;
/* Align it */
if(unlikely(((long)b)&3 && len)) {
if (unlikely((long)b & 3 && len)) {
u8 *p = (u8 *)b;
do {
DO_CRC(*p++);
......@@ -75,7 +75,7 @@ crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 *tab)
}
len = rem_len;
/* And the last few bytes */
if(len) {
if (len) {
u8 *p = (u8 *)(b + 1) - 1;
do {
DO_CRC(*++p); /* use pre increment for speed */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment