lkml.org 
[lkml]   [2018]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] partitions/efi: Fix partition name parsing in GUID partition entry
Hi Nikolai,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on block/for-next]
[also build test WARNING on v4.20-rc3 next-20181123]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Nikolai-Merinov/partitions-efi-Fix-partition-name-parsing-in-GUID-partition-entry/20181125-060728
base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

All warnings (new ones prefixed by >>):

include/linux/slab.h:332:43: warning: dubious: x & !y
include/linux/slab.h:332:43: warning: dubious: x & !y
include/linux/slab.h:332:43: warning: dubious: x & !y
>> block/partitions/efi.c:732:32: warning: cast to restricted __le16

vim +732 block/partitions/efi.c

672
673 /**
674 * efi_partition(struct parsed_partitions *state)
675 * @state: disk parsed partitions
676 *
677 * Description: called from check.c, if the disk contains GPT
678 * partitions, sets up partition entries in the kernel.
679 *
680 * If the first block on the disk is a legacy MBR,
681 * it will get handled by msdos_partition().
682 * If it's a Protective MBR, we'll handle it here.
683 *
684 * We do not create a Linux partition for GPT, but
685 * only for the actual data partitions.
686 * Returns:
687 * -1 if unable to read the partition table
688 * 0 if this isn't our partition table
689 * 1 if successful
690 *
691 */
692 int efi_partition(struct parsed_partitions *state)
693 {
694 gpt_header *gpt = NULL;
695 gpt_entry *ptes = NULL;
696 u32 i;
697 unsigned ssz = bdev_logical_block_size(state->bdev) / 512;
698
699 if (!find_valid_gpt(state, &gpt, &ptes) || !gpt || !ptes) {
700 kfree(gpt);
701 kfree(ptes);
702 return 0;
703 }
704
705 pr_debug("GUID Partition Table is valid! Yea!\n");
706
707 for (i = 0; i < le32_to_cpu(gpt->num_partition_entries) && i < state->limit-1; i++) {
708 struct partition_meta_info *info;
709 unsigned label_count = 0;
710 unsigned label_max;
711 u64 start = le64_to_cpu(ptes[i].starting_lba);
712 u64 size = le64_to_cpu(ptes[i].ending_lba) -
713 le64_to_cpu(ptes[i].starting_lba) + 1ULL;
714
715 if (!is_pte_valid(&ptes[i], last_lba(state->bdev)))
716 continue;
717
718 put_partition(state, i+1, start * ssz, size * ssz);
719
720 /* If this is a RAID volume, tell md */
721 if (!efi_guidcmp(ptes[i].partition_type_guid, PARTITION_LINUX_RAID_GUID))
722 state->parts[i + 1].flags = ADDPART_FLAG_RAID;
723
724 info = &state->parts[i + 1].info;
725 efi_guid_to_str(&ptes[i].unique_partition_guid, info->uuid);
726
727 /* Naively convert UTF16-LE to 7 bits. */
728 label_max = min(ARRAY_SIZE(info->volname) - 1,
729 ARRAY_SIZE(ptes[i].partition_name));
730 info->volname[label_max] = 0;
731 while (label_count < label_max) {
> 732 u8 c = le16_to_cpu(ptes[i].partition_name[label_count]) & 0xff;

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2018-11-25 22:19    [W:0.125 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site