From owner-svn-src-head@freebsd.org Mon Feb 13 21:33:51 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 D1796CDDC8D; Mon, 13 Feb 2017 21:33:51 +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 849F0F73; Mon, 13 Feb 2017 21:33:51 +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 v1DLXopA062604; Mon, 13 Feb 2017 21:33:50 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1DLXoLf062603; Mon, 13 Feb 2017 21:33:50 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201702132133.v1DLXoLf062603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 13 Feb 2017 21:33:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313710 - head/sys/boot/efi/libefi X-SVN-Group: head 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: Mon, 13 Feb 2017 21:33:51 -0000 Author: tsoome Date: Mon Feb 13 21:33:50 2017 New Revision: 313710 URL: https://svnweb.freebsd.org/changeset/base/313710 Log: loader: cstyle fixes and DIOCGMEDIASIZE should use uint64_t Cleaned up some spaces where tabs should be. efipart_ioctl() DIOCGMEDIASIZE needs to use uint64_t, not off_t Reviewed by: allanjude Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D9562 Modified: head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Mon Feb 13 20:56:53 2017 (r313709) +++ head/sys/boot/efi/libefi/efipart.c Mon Feb 13 21:33:50 2017 (r313710) @@ -254,7 +254,7 @@ efipart_cdinfo_add(EFI_HANDLE handle, EF } unit++; } - + cd = malloc(sizeof(pdinfo_t)); if (cd == NULL) { printf("Failed to add cd %d, out of memory\n", unit); @@ -290,7 +290,7 @@ efipart_updatecd(void) continue; if (efipart_floppy(node) != NULL) continue; - + status = BS->HandleProtocol(efipart_handles[i], &blkio_guid, (void **)&blkio); if (EFI_ERROR(status)) @@ -589,14 +589,14 @@ efipart_print_common(struct devsw *dev, if (STAILQ_EMPTY(pdlist)) return (0); - + printf("%s devices:", dev->dv_name); if ((ret = pager_output("\n")) != 0) return (ret); STAILQ_FOREACH(pd, pdlist, pd_link) { h = pd->pd_handle; - if (verbose) { /* Output the device path. */ + if (verbose) { /* Output the device path. */ text = efi_devpath_name(efi_lookup_devpath(h)); if (text != NULL) { printf(" %S", text); @@ -707,7 +707,7 @@ efipart_open(struct open_file *f, ...) pd = efiblk_get_pdinfo(pdi, dev->d_unit); if (pd == NULL) return (EIO); - + if (pd->pd_blkio == NULL) { status = BS->HandleProtocol(pd->pd_handle, &blkio_guid, (void **)&pd->pd_blkio); @@ -791,7 +791,7 @@ efipart_ioctl(struct open_file *f, u_lon *(u_int *)data = pd->pd_blkio->Media->BlockSize; break; case DIOCGMEDIASIZE: - *(off_t *)data = pd->pd_blkio->Media->BlockSize * + *(uint64_t *)data = pd->pd_blkio->Media->BlockSize * (pd->pd_blkio->Media->LastBlock + 1); break; default: @@ -915,9 +915,9 @@ efipart_realstrategy(void *devdata, int if (rsize != NULL) *rsize = size; - if ((size % blkio->Media->BlockSize == 0) && + if ((size % blkio->Media->BlockSize == 0) && ((blk * 512) % blkio->Media->BlockSize == 0)) - return (efipart_readwrite(blkio, rw, + return (efipart_readwrite(blkio, rw, blk * 512 / blkio->Media->BlockSize, size / blkio->Media->BlockSize, buf));