linux/fs/ubifs
Harvey Harrison 0ecb9529a4 UBIFS: endian handling fixes and annotations
Noticed by sparse:
fs/ubifs/file.c:75:2: warning: restricted __le64 degrades to integer
fs/ubifs/file.c:629:4: warning: restricted __le64 degrades to integer
fs/ubifs/dir.c:431:3: warning: restricted __le64 degrades to integer

This should be checked to ensure the ubifs_assert is working as
intended, I've done the suggested annotation in this patch.

fs/ubifs/sb.c:298:6: warning: incorrect type in assignment (different base types)
fs/ubifs/sb.c:298:6:    expected int [signed] [assigned] tmp
fs/ubifs/sb.c:298:6:    got restricted __le64 [usertype] <noident>
fs/ubifs/sb.c:299:19: warning: incorrect type in assignment (different base types)
fs/ubifs/sb.c:299:19:    expected restricted __le64 [usertype] atime_sec
fs/ubifs/sb.c:299:19:    got int [signed] [assigned] tmp
fs/ubifs/sb.c:300:19: warning: incorrect type in assignment (different base types)
fs/ubifs/sb.c:300:19:    expected restricted __le64 [usertype] ctime_sec
fs/ubifs/sb.c:300:19:    got int [signed] [assigned] tmp
fs/ubifs/sb.c:301:19: warning: incorrect type in assignment (different base types)
fs/ubifs/sb.c:301:19:    expected restricted __le64 [usertype] mtime_sec
fs/ubifs/sb.c:301:19:    got int [signed] [assigned] tmp

This looks like a bugfix as your tmp was a u32 so there was truncation in
the atime, mtime, ctime value, probably not intentional, add a tmp_le64
and use it here.

fs/ubifs/key.h:348:9: warning: cast to restricted __le32
fs/ubifs/key.h:348:9: warning: cast to restricted __le32
fs/ubifs/key.h:419:9: warning: cast to restricted __le32

Read from the annotated union member instead.

fs/ubifs/recovery.c:175:13: warning: incorrect type in assignment (different base types)
fs/ubifs/recovery.c:175:13:    expected unsigned int [unsigned] [usertype] save_flags
fs/ubifs/recovery.c:175:13:    got restricted __le32 [usertype] flags
fs/ubifs/recovery.c:186:13: warning: incorrect type in assignment (different base types)
fs/ubifs/recovery.c:186:13:    expected restricted __le32 [usertype] flags
fs/ubifs/recovery.c:186:13:    got unsigned int [unsigned] [usertype] save_flags

Do byteshifting at compile time of the flag value.  Annotate the saved_flags
as le32.

fs/ubifs/debug.c:368:10: warning: cast to restricted __le32
fs/ubifs/debug.c:368:10: warning: cast from restricted __le64

Should be checked if the truncation was intentional, I've changed the
printk to print the full width.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-11-06 11:06:19 +02:00
..
budget.c UBIFS: add a print, fix comments and more minor stuff 2008-09-30 11:12:55 +03:00
commit.c UBIFS: remove printk 2008-11-06 11:06:14 +02:00
compress.c UBIFS: fix ubifs_compress commentary 2008-10-19 13:01:37 +03:00
debug.c UBIFS: endian handling fixes and annotations 2008-11-06 11:06:19 +02:00
debug.h UBIFS: add more debugging messages for LPT 2008-09-30 11:12:59 +03:00
dir.c UBIFS: endian handling fixes and annotations 2008-11-06 11:06:19 +02:00
file.c UBIFS: endian handling fixes and annotations 2008-11-06 11:06:19 +02:00
find.c UBIFS: remove unneeded unlikely() 2008-09-30 11:12:55 +03:00
gc.c UBIFS: improve garbage collection 2008-09-30 11:12:59 +03:00
io.c UBIFS: check data CRC when in error state 2008-09-30 11:12:57 +03:00
ioctl.c
journal.c UBIFS: xattr bugfixes 2008-08-14 12:46:20 +03:00
Kconfig UBIFS: include to compilation 2008-07-15 17:35:24 +03:00
key.h UBIFS: endian handling fixes and annotations 2008-11-06 11:06:19 +02:00
log.c UBIFS: increment commit number earlier 2008-08-13 11:27:47 +03:00
lprops.c UBIFS: inline one-line functions 2008-09-30 11:12:56 +03:00
lpt_commit.c UBIFS: check buffer length when scanning for LPT nodes 2008-09-30 11:12:59 +03:00
lpt.c UBIFS: do not read unnecessary bytes when unpacking bits 2008-10-19 13:01:21 +03:00
Makefile UBIFS: include to compilation 2008-07-15 17:35:24 +03:00
master.c
misc.h UBIFS: inline one-line functions 2008-09-30 11:12:56 +03:00
orphan.c UBIFS: increment commit number earlier 2008-08-13 11:27:47 +03:00
recovery.c UBIFS: endian handling fixes and annotations 2008-11-06 11:06:19 +02:00
replay.c
sb.c UBIFS: endian handling fixes and annotations 2008-11-06 11:06:19 +02:00
scan.c UBIFS: add no_chk_data_crc mount option 2008-09-30 11:12:56 +03:00
shrinker.c
super.c Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6 2008-10-20 09:19:03 -07:00
tnc_commit.c UBIFS: minor tweaks in commit 2008-08-13 11:38:19 +03:00
tnc_misc.c UBIFS: correct key comparison 2008-09-30 11:12:57 +03:00
tnc.c UBIFS: correct condition to eliminate unecessary assignment 2008-09-30 11:12:59 +03:00
ubifs-media.h UBIFS: ensure data read beyond i_size is zeroed out correctly 2008-09-30 11:12:57 +03:00
ubifs.h UBIFS: add more debugging messages for LPT 2008-09-30 11:12:59 +03:00
xattr.c UBIFS: remove unneeded unlikely() 2008-09-30 11:12:55 +03:00