Skip to content

Commit 234c607

Browse files
committed
Aadjust print function and fix compiler warning
Align the print function with the Simplefs print format for consistency. Also adjust variable declarations to fix compiler warnings when building under the C90 standard.
1 parent d969bb7 commit 234c607

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

bitmap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ static inline uint32_t get_free_blocks(struct super_block *sb, uint32_t len)
4848
struct simplefs_sb_info *sbi = SIMPLEFS_SB(sb);
4949
uint32_t ret = get_first_free_bits(sbi->bfree_bitmap, sbi->nr_blocks, len);
5050
uint32_t i;
51+
struct buffer_head *bh;
5152
if (!ret) /* No enough free blocks */
5253
return 0;
5354

5455
sbi->nr_free_blocks -= len;
55-
struct buffer_head *bh;
5656
for (i = 0; i < len; i++) {
5757
bh = sb_bread(sb, ret + i);
5858
if (!bh) {

inode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ static int simplefs_link(struct dentry *old_dentry,
996996
eblock = (struct simplefs_file_ei_block *) bh->b_data;
997997
if (eblock->nr_files == SIMPLEFS_MAX_SUBFILES) {
998998
ret = -EMLINK;
999-
printk(KERN_INFO "directory is full");
999+
pr_info("directory is full");
10001000
goto end;
10011001
}
10021002

@@ -1097,7 +1097,7 @@ static int simplefs_symlink(struct inode *dir,
10971097

10981098
if (eblock->nr_files == SIMPLEFS_MAX_SUBFILES) {
10991099
ret = -EMLINK;
1100-
printk(KERN_INFO "directory is full");
1100+
pr_info("directory is full");
11011101
goto end;
11021102
}
11031103

super.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,23 +293,21 @@ static journal_t *simplefs_get_dev_journal(struct super_block *sb,
293293

294294
#if SIMPLEFS_AT_LEAST(6, 9, 0)
295295
if (IS_ERR(bdev_file)) {
296-
printk(KERN_ERR
297-
"failed to open journal device unknown-block(%u,%u) %ld\n",
296+
pr_err("failed to open journal device unknown-block(%u,%u) %ld\n",
298297
MAJOR(journal_dev), MINOR(journal_dev), PTR_ERR(bdev_file));
299298
return ERR_CAST(bdev_file);
300299
}
301300
bdev = file_bdev(bdev_file);
302301
#elif SIMPLEFS_AT_LEAST(6, 7, 0)
303302
if (IS_ERR(bdev_handle)) {
304-
printk(KERN_ERR
305-
"failed to open journal device unknown-block(%u,%u) %ld\n",
303+
pr_err("failed to open journal device unknown-block(%u,%u) %ld\n",
306304
MAJOR(journal_dev), MINOR(journal_dev), PTR_ERR(bdev_handle));
307305
return ERR_CAST(bdev_handle);
308306
}
309307
bdev = bdev_handle->bdev;
310308
#elif SIMPLEFS_AT_LEAST(5, 10, 0)
311309
if (IS_ERR(bdev)) {
312-
printk(KERN_ERR "failed to open block device (%u:%u), error: %ld\n",
310+
pr_err("failed to open block device (%u:%u), error: %ld\n",
313311
MAJOR(journal_dev), MINOR(journal_dev), PTR_ERR(bdev));
314312
return ERR_CAST(bdev);
315313
}

0 commit comments

Comments
 (0)