[song-md:md-next 6/6] mm/mmap.c:1453:31: error: called object type 'void is not a function or function pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   git://git.kernel.org/pub/scm/linux/kernel/git/song/md.git md-next
head:   49c4d345c81f149a29b3db6e521e5191e55f02b6
commit: 49c4d345c81f149a29b3db6e521e5191e55f02b6 [6/6] thp test
config: mips-randconfig-r036-20210315 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a28facba1ccdc957f386b7753f4958307f1bfde8)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/song/md.git/commit/?id=49c4d345c81f149a29b3db6e521e5191e55f02b6
        git remote add song-md git://git.kernel.org/pub/scm/linux/kernel/git/song/md.git
        git fetch --no-tags song-md md-next
        git checkout 49c4d345c81f149a29b3db6e521e5191e55f02b6
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> mm/mmap.c:1453:31: error: called object type 'void *' is not a function or function pointer
                   addr = thp_get_unmapped_area(file, addr, len, pgoff, flags);
                          ~~~~~~~~~~~~~~~~~~~~~^
   1 error generated.


vim +1453 mm/mmap.c

  1398	
  1399	/*
  1400	 * The caller must write-lock current->mm->mmap_lock.
  1401	 */
  1402	unsigned long do_mmap(struct file *file, unsigned long addr,
  1403				unsigned long len, unsigned long prot,
  1404				unsigned long flags, unsigned long pgoff,
  1405				unsigned long *populate, struct list_head *uf)
  1406	{
  1407		struct mm_struct *mm = current->mm;
  1408		vm_flags_t vm_flags;
  1409		int pkey = 0;
  1410	
  1411		*populate = 0;
  1412	
  1413		if (!len)
  1414			return -EINVAL;
  1415	
  1416		/*
  1417		 * Does the application expect PROT_READ to imply PROT_EXEC?
  1418		 *
  1419		 * (the exception is when the underlying filesystem is noexec
  1420		 *  mounted, in which case we dont add PROT_EXEC.)
  1421		 */
  1422		if ((prot & PROT_READ) && (current->personality & READ_IMPLIES_EXEC))
  1423			if (!(file && path_noexec(&file->f_path)))
  1424				prot |= PROT_EXEC;
  1425	
  1426		/* force arch specific MAP_FIXED handling in get_unmapped_area */
  1427		if (flags & MAP_FIXED_NOREPLACE)
  1428			flags |= MAP_FIXED;
  1429	
  1430		if (!(flags & MAP_FIXED))
  1431			addr = round_hint_to_min(addr);
  1432	
  1433		/* Careful about overflows.. */
  1434		len = PAGE_ALIGN(len);
  1435		if (!len)
  1436			return -ENOMEM;
  1437	
  1438		/* offset overflow? */
  1439		if ((pgoff + (len >> PAGE_SHIFT)) < pgoff)
  1440			return -EOVERFLOW;
  1441	
  1442		/* Too many mappings? */
  1443		if (mm->map_count > sysctl_max_map_count)
  1444			return -ENOMEM;
  1445	
  1446		/* Obtain the address to map to. we verify (or select) it and ensure
  1447		 * that it represents a valid section of the address space.
  1448		 */
  1449		if ((prot & PROT_READ) && (prot & PROT_EXEC) && (!(prot & PROT_WRITE)) &&
  1450		    (len >= HPAGE_PMD_SIZE) && (flags & MAP_PRIVATE)) {
  1451			/* potential THP large page */
  1452			pr_info("%s do thp for addr %lx pgoff %lx\n", __func__, addr, pgoff);
> 1453			addr = thp_get_unmapped_area(file, addr, len, pgoff, flags);
  1454		} else {
  1455			addr = get_unmapped_area(file, addr, len, pgoff, flags);
  1456		}
  1457		if (IS_ERR_VALUE(addr))
  1458			return addr;
  1459	
  1460		if (flags & MAP_FIXED_NOREPLACE) {
  1461			struct vm_area_struct *vma = find_vma(mm, addr);
  1462	
  1463			if (vma && vma->vm_start < addr + len)
  1464				return -EEXIST;
  1465		}
  1466	
  1467		if (prot == PROT_EXEC) {
  1468			pkey = execute_only_pkey(mm);
  1469			if (pkey < 0)
  1470				pkey = 0;
  1471		}
  1472	
  1473		/* Do simple checking here so the lower-level routines won't have
  1474		 * to. we assume access permissions have been handled by the open
  1475		 * of the memory object, so we don't do any here.
  1476		 */
  1477		vm_flags = calc_vm_prot_bits(prot, pkey) | calc_vm_flag_bits(flags) |
  1478				mm->def_flags | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC;
  1479	
  1480		if (flags & MAP_LOCKED)
  1481			if (!can_do_mlock())
  1482				return -EPERM;
  1483	
  1484		if (mlock_future_check(mm, vm_flags, len))
  1485			return -EAGAIN;
  1486	
  1487		if (file) {
  1488			struct inode *inode = file_inode(file);
  1489			unsigned long flags_mask;
  1490	
  1491			if (!file_mmap_ok(file, inode, pgoff, len))
  1492				return -EOVERFLOW;
  1493	
  1494			flags_mask = LEGACY_MAP_MASK | file->f_op->mmap_supported_flags;
  1495	
  1496			switch (flags & MAP_TYPE) {
  1497			case MAP_SHARED:
  1498				/*
  1499				 * Force use of MAP_SHARED_VALIDATE with non-legacy
  1500				 * flags. E.g. MAP_SYNC is dangerous to use with
  1501				 * MAP_SHARED as you don't know which consistency model
  1502				 * you will get. We silently ignore unsupported flags
  1503				 * with MAP_SHARED to preserve backward compatibility.
  1504				 */
  1505				flags &= LEGACY_MAP_MASK;
  1506				fallthrough;
  1507			case MAP_SHARED_VALIDATE:
  1508				if (flags & ~flags_mask)
  1509					return -EOPNOTSUPP;
  1510				if (prot & PROT_WRITE) {
  1511					if (!(file->f_mode & FMODE_WRITE))
  1512						return -EACCES;
  1513					if (IS_SWAPFILE(file->f_mapping->host))
  1514						return -ETXTBSY;
  1515				}
  1516	
  1517				/*
  1518				 * Make sure we don't allow writing to an append-only
  1519				 * file..
  1520				 */
  1521				if (IS_APPEND(inode) && (file->f_mode & FMODE_WRITE))
  1522					return -EACCES;
  1523	
  1524				/*
  1525				 * Make sure there are no mandatory locks on the file.
  1526				 */
  1527				if (locks_verify_locked(file))
  1528					return -EAGAIN;
  1529	
  1530				vm_flags |= VM_SHARED | VM_MAYSHARE;
  1531				if (!(file->f_mode & FMODE_WRITE))
  1532					vm_flags &= ~(VM_MAYWRITE | VM_SHARED);
  1533				fallthrough;
  1534			case MAP_PRIVATE:
  1535				if (!(file->f_mode & FMODE_READ))
  1536					return -EACCES;
  1537				if (path_noexec(&file->f_path)) {
  1538					if (vm_flags & VM_EXEC)
  1539						return -EPERM;
  1540					vm_flags &= ~VM_MAYEXEC;
  1541				}
  1542	
  1543				if (!file->f_op->mmap)
  1544					return -ENODEV;
  1545				if (vm_flags & (VM_GROWSDOWN|VM_GROWSUP))
  1546					return -EINVAL;
  1547				break;
  1548	
  1549			default:
  1550				return -EINVAL;
  1551			}
  1552		} else {
  1553			switch (flags & MAP_TYPE) {
  1554			case MAP_SHARED:
  1555				if (vm_flags & (VM_GROWSDOWN|VM_GROWSUP))
  1556					return -EINVAL;
  1557				/*
  1558				 * Ignore pgoff.
  1559				 */
  1560				pgoff = 0;
  1561				vm_flags |= VM_SHARED | VM_MAYSHARE;
  1562				break;
  1563			case MAP_PRIVATE:
  1564				/*
  1565				 * Set pgoff according to addr for anon_vma.
  1566				 */
  1567				pgoff = addr >> PAGE_SHIFT;
  1568				break;
  1569			default:
  1570				return -EINVAL;
  1571			}
  1572		}
  1573	
  1574		/*
  1575		 * Set 'VM_NORESERVE' if we should not account for the
  1576		 * memory use of this mapping.
  1577		 */
  1578		if (flags & MAP_NORESERVE) {
  1579			/* We honor MAP_NORESERVE if allowed to overcommit */
  1580			if (sysctl_overcommit_memory != OVERCOMMIT_NEVER)
  1581				vm_flags |= VM_NORESERVE;
  1582	
  1583			/* hugetlb applies strict overcommit unless MAP_NORESERVE */
  1584			if (file && is_file_hugepages(file))
  1585				vm_flags |= VM_NORESERVE;
  1586		}
  1587	
  1588		addr = mmap_region(file, addr, len, vm_flags, pgoff, uf);
  1589		if (!IS_ERR_VALUE(addr) &&
  1590		    ((vm_flags & VM_LOCKED) ||
  1591		     (flags & (MAP_POPULATE | MAP_NONBLOCK)) == MAP_POPULATE))
  1592			*populate = len;
  1593		return addr;
  1594	}
  1595	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux