Merge branch 'torvalds/master'
[firefly-linux-kernel-4.4.55.git] / block / partitions / check.c
index 19ba207ea7d12de48ae0a6182c71df3d188c2b3a..16118d11dbfc002cdc11463c3ee4024685615420 100644 (file)
@@ -34,6 +34,7 @@
 #include "efi.h"
 #include "karma.h"
 #include "sysv68.h"
+#include "cmdline.h"
 
 int warn_no_part = 1; /*This is ugly: should make genhd removable media aware*/
 
@@ -65,6 +66,9 @@ static int (*check_part[])(struct parsed_partitions *) = {
        adfspart_check_ADFS,
 #endif
 
+#ifdef CONFIG_CMDLINE_PARTITION
+       cmdline_partition,
+#endif
 #ifdef CONFIG_EFI_PARTITION
        efi_partition,          /* this must come before msdos */
 #endif
@@ -180,12 +184,12 @@ check_partition(struct gendisk *hd, struct block_device *bdev)
        if (err)
        /* The partition is unrecognized. So report I/O errors if there were any */
                res = err;
-       if (!res)
-               strlcat(state->pp_buf, " unknown partition table\n", PAGE_SIZE);
-       else if (warn_no_part)
-               strlcat(state->pp_buf, " unable to read partition table\n", PAGE_SIZE);
-
-       printk(KERN_INFO "%s", state->pp_buf);
+       if (res) {
+               if (warn_no_part)
+                       strlcat(state->pp_buf,
+                               " unable to read partition table\n", PAGE_SIZE);
+               printk(KERN_INFO "%s", state->pp_buf);
+       }
 
        free_page((unsigned long)state->pp_buf);
        free_partitions(state);