Skip to content

Commit

Permalink
JFS: simplify types to get rid of sparse warning
Browse files Browse the repository at this point in the history
jfs_metapage.c was using uints and unsigned ints inconsistently when
regular ints suffice.

Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
  • Loading branch information
Dave Kleikamp committed Jan 10, 2008
1 parent da8a41d commit 967c9ec
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions fs/jfs/jfs_metapage.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ struct meta_anchor {
};
#define mp_anchor(page) ((struct meta_anchor *)page_private(page))

static inline struct metapage *page_to_mp(struct page *page, uint offset)
static inline struct metapage *page_to_mp(struct page *page, int offset)
{
if (!PagePrivate(page))
return NULL;
Expand Down Expand Up @@ -153,7 +153,7 @@ static inline void dec_io(struct page *page, void (*handler) (struct page *))
}

#else
static inline struct metapage *page_to_mp(struct page *page, uint offset)
static inline struct metapage *page_to_mp(struct page *page, int offset)
{
return PagePrivate(page) ? (struct metapage *)page_private(page) : NULL;
}
Expand Down Expand Up @@ -249,7 +249,7 @@ static inline void drop_metapage(struct page *page, struct metapage *mp)
*/

static sector_t metapage_get_blocks(struct inode *inode, sector_t lblock,
unsigned int *len)
int *len)
{
int rc = 0;
int xflag;
Expand Down Expand Up @@ -352,11 +352,11 @@ static void metapage_write_end_io(struct bio *bio, int err)
static int metapage_writepage(struct page *page, struct writeback_control *wbc)
{
struct bio *bio = NULL;
unsigned int block_offset; /* block offset of mp within page */
int block_offset; /* block offset of mp within page */
struct inode *inode = page->mapping->host;
unsigned int blocks_per_mp = JFS_SBI(inode->i_sb)->nbperpage;
unsigned int len;
unsigned int xlen;
int blocks_per_mp = JFS_SBI(inode->i_sb)->nbperpage;
int len;
int xlen;
struct metapage *mp;
int redirty = 0;
sector_t lblock;
Expand All @@ -366,7 +366,7 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
sector_t page_start;
unsigned long bio_bytes = 0;
unsigned long bio_offset = 0;
unsigned int offset;
int offset;

page_start = (sector_t)page->index <<
(PAGE_CACHE_SHIFT - inode->i_blkbits);
Expand Down Expand Up @@ -428,7 +428,7 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
continue;
}
set_bit(META_io, &mp->flag);
len = min(xlen, (uint) JFS_SBI(inode->i_sb)->nbperpage);
len = min(xlen, (int)JFS_SBI(inode->i_sb)->nbperpage);

bio = bio_alloc(GFP_NOFS, 1);
bio->bi_bdev = inode->i_sb->s_bdev;
Expand Down Expand Up @@ -480,13 +480,13 @@ static int metapage_readpage(struct file *fp, struct page *page)
{
struct inode *inode = page->mapping->host;
struct bio *bio = NULL;
unsigned int block_offset;
unsigned int blocks_per_page = PAGE_CACHE_SIZE >> inode->i_blkbits;
int block_offset;
int blocks_per_page = PAGE_CACHE_SIZE >> inode->i_blkbits;
sector_t page_start; /* address of page in fs blocks */
sector_t pblock;
unsigned int xlen;
int xlen;
unsigned int len;
unsigned int offset;
int offset;

BUG_ON(!PageLocked(page));
page_start = (sector_t)page->index <<
Expand Down Expand Up @@ -535,7 +535,7 @@ static int metapage_releasepage(struct page *page, gfp_t gfp_mask)
{
struct metapage *mp;
int ret = 1;
unsigned int offset;
int offset;

for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) {
mp = page_to_mp(page, offset);
Expand Down

0 comments on commit 967c9ec

Please sign in to comment.