From owner-svn-src-head@freebsd.org Thu Sep 21 23:14:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C20A7E29140; Thu, 21 Sep 2017 23:14:08 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F3676F1D5; Thu, 21 Sep 2017 23:14:08 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LNE7Or099160; Thu, 21 Sep 2017 23:14:07 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LNE73t099157; Thu, 21 Sep 2017 23:14:07 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201709212314.v8LNE73t099157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 21 Sep 2017 23:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323885 - head/sys/boot/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/boot/efi/libefi X-SVN-Commit-Revision: 323885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Sep 2017 23:14:08 -0000 Author: tsoome Date: Thu Sep 21 23:14:07 2017 New Revision: 323885 URL: https://svnweb.freebsd.org/changeset/base/323885 Log: libefi: efi_devpath_match() should return bool The current implementation of efi_devpath_match() is returning values 0 or 1, so it should be updated to return bool. Modified: head/sys/boot/efi/libefi/devpath.c head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/devpath.c ============================================================================== --- head/sys/boot/efi/libefi/devpath.c Thu Sep 21 23:10:59 2017 (r323884) +++ head/sys/boot/efi/libefi/devpath.c Thu Sep 21 23:14:07 2017 (r323885) @@ -139,30 +139,30 @@ efi_devpath_handle(EFI_DEVICE_PATH *devpath) return (h); } -int +bool efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVICE_PATH *devpath2) { int len; if (devpath1 == NULL || devpath2 == NULL) - return (0); + return (false); - while (1) { + while (true) { if (DevicePathType(devpath1) != DevicePathType(devpath2) || DevicePathSubType(devpath1) != DevicePathSubType(devpath2)) - return (0); + return (false); len = DevicePathNodeLength(devpath1); if (len != DevicePathNodeLength(devpath2)) - return (0); + return (false); if (memcmp(devpath1, devpath2, (size_t)len) != 0) - return (0); + return (false); if (IsDevicePathEnd(devpath1)) break; devpath1 = NextDevicePathNode(devpath1); devpath2 = NextDevicePathNode(devpath2); } - return (1); + return (true); } Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Thu Sep 21 23:10:59 2017 (r323884) +++ head/sys/boot/efi/libefi/efipart.c Thu Sep 21 23:14:07 2017 (r323885) @@ -264,7 +264,7 @@ efipart_cdinfo_add(EFI_HANDLE handle, EFI_HANDLE alias unit = 0; STAILQ_FOREACH(pd, &cdinfo, pd_link) { - if (efi_devpath_match(pd->pd_devpath, devpath) != 0) { + if (efi_devpath_match(pd->pd_devpath, devpath) == true) { pd->pd_handle = handle; pd->pd_alias = alias; return (0); @@ -394,7 +394,7 @@ efipart_hdinfo_add(EFI_HANDLE disk_handle, EFI_HANDLE STAILQ_INIT(&pd->pd_part); STAILQ_FOREACH(hd, &hdinfo, pd_link) { - if (efi_devpath_match(hd->pd_devpath, disk_devpath) != 0) { + if (efi_devpath_match(hd->pd_devpath, disk_devpath) == true) { /* Add the partition. */ pd->pd_handle = part_handle; pd->pd_unit = node->PartitionNumber;