Commit dec5cd13 authored by Theodore Ts'o's avatar Theodore Ts'o
Browse files

Fix gcc -Wall complaints in libext2fs

Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 2694f319
No related merge requests found
2006-11-14 Theodore Tso <tytso@mit.edu>
* namei.c (open_namei): Rename internal variable basename to
base_name to prevent gcc -Wall complaints.
* kernel-jbd.h (tid_gt, tid_geq): Add function declaration to
avoid gcc -Wall complaints.
* ext2_ext_attr.h (EXT2_EXT_ATTR_PAD): Make unsigned to fix gcc
-Wall complaints.
* bitops.h (ext2fs_test_bit): Add missing const to fix gcc -Wall
complaint.
* ext2fs.h (ext2fs_get_mem, ext2fs_free_mem): Avoid type punning
which causes problems on the ARM processor. (Addresses
Debian Bug: #397044)
......
......@@ -21,6 +21,7 @@ extern void ext2fs_fast_set_bit(unsigned int nr,void * addr);
extern void ext2fs_fast_clear_bit(unsigned int nr, void * addr);
extern __u16 ext2fs_swab16(__u16 val);
extern __u32 ext2fs_swab32(__u32 val);
extern __u64 ext2fs_swab64(__u64 val);
#ifdef WORDS_BIGENDIAN
#define ext2fs_cpu_to_le64(x) ext2fs_swab64((x))
......@@ -205,7 +206,7 @@ _INLINE_ int ext2fs_test_bit(unsigned int nr, const void * addr)
{
int oldbit;
addr = (void *) (((unsigned char *) addr) + (nr >> 3));
addr = (const void *) (((const unsigned char *) addr) + (nr >> 3));
__asm__ __volatile__("btl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit)
:"m" (EXT2FS_CONST_ADDR),"r" (nr & 7));
......
......@@ -36,7 +36,7 @@ struct ext2_ext_attr_entry {
};
#define EXT2_EXT_ATTR_PAD_BITS 2
#define EXT2_EXT_ATTR_PAD (1<<EXT2_EXT_ATTR_PAD_BITS)
#define EXT2_EXT_ATTR_PAD ((unsigned) 1<<EXT2_EXT_ATTR_PAD_BITS)
#define EXT2_EXT_ATTR_ROUND (EXT2_EXT_ATTR_PAD-1)
#define EXT2_EXT_ATTR_LEN(name_len) \
(((name_len) + EXT2_EXT_ATTR_ROUND + \
......
......@@ -794,6 +794,9 @@ extern void journal_brelse_array(struct buffer_head *b[], int n);
extern void journal_destroy_revoke(journal_t *);
#endif /* __KERNEL__ */
static inline int tid_gt(tid_t x, tid_t y) EXT2FS_ATTR((unused));
static inline int tid_geq(tid_t x, tid_t y) EXT2FS_ATTR((unused));
/* Comparison functions for transaction IDs: perform comparisons using
* modulo arithmetic so that they work over sequence number wraps. */
......
......@@ -114,7 +114,7 @@ static errcode_t open_namei(ext2_filsys fs, ext2_ino_t root, ext2_ino_t base,
const char *pathname, size_t pathlen, int follow,
int link_count, char *buf, ext2_ino_t *res_inode)
{
const char *basename;
const char *base_name;
int namelen;
ext2_ino_t dir, inode;
errcode_t retval;
......@@ -124,13 +124,13 @@ static errcode_t open_namei(ext2_filsys fs, ext2_ino_t root, ext2_ino_t base,
root, base, pathlen, pathname, link_count);
#endif
retval = dir_namei(fs, root, base, pathname, pathlen,
link_count, buf, &basename, &namelen, &dir);
link_count, buf, &base_name, &namelen, &dir);
if (retval) return retval;
if (!namelen) { /* special case: '/usr/' etc */
*res_inode=dir;
return 0;
}
retval = ext2fs_lookup (fs, dir, basename, namelen, buf, &inode);
retval = ext2fs_lookup (fs, dir, base_name, namelen, buf, &inode);
if (retval)
return retval;
if (follow) {
......
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