Skip to content

Commit beb7996

Browse files
veidongrayyivies
and
yivies
authored
Flush kernel messages immediately (#11)
Co-authored-by: yivies <[email protected]>
1 parent 1ed317d commit beb7996

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fibdrv.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static long long fib_sequence(long long k)
4242
static int fib_open(struct inode *inode, struct file *file)
4343
{
4444
if (!mutex_trylock(&fib_mutex)) {
45-
printk(KERN_ALERT "fibdrv is in use");
45+
printk(KERN_ALERT "fibdrv is in use\n");
4646
return -EBUSY;
4747
}
4848
return 0;
@@ -113,7 +113,7 @@ static int __init init_fib_dev(void)
113113
// This will dynamically allocate the major number
114114
rc = major = register_chrdev(major, DEV_FIBONACCI_NAME, &fib_fops);
115115
if (rc < 0) {
116-
printk(KERN_ALERT "Failed to add cdev");
116+
printk(KERN_ALERT "Failed to add cdev\n");
117117
rc = -2;
118118
goto failed_cdev;
119119
}
@@ -122,13 +122,13 @@ static int __init init_fib_dev(void)
122122
fib_class = class_create(THIS_MODULE, DEV_FIBONACCI_NAME);
123123

124124
if (!fib_class) {
125-
printk(KERN_ALERT "Failed to create device class");
125+
printk(KERN_ALERT "Failed to create device class\n");
126126
rc = -3;
127127
goto failed_class_create;
128128
}
129129

130130
if (!device_create(fib_class, NULL, fib_dev, NULL, DEV_FIBONACCI_NAME)) {
131-
printk(KERN_ALERT "Failed to create device");
131+
printk(KERN_ALERT "Failed to create device\n");
132132
rc = -4;
133133
goto failed_device_create;
134134
}

0 commit comments

Comments
 (0)