Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Nov 2017 05:01:56 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326384 - head/stand/powerpc/kboot
Message-ID:  <201711300501.vAU51uH1095955@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Thu Nov 30 05:01:56 2017
New Revision: 326384
URL: https://svnweb.freebsd.org/changeset/base/326384

Log:
  Use const pointers to avoid casting away constness.
  
  The host_open interface was a legitimate mismatch to the userboot
  function, while the other pointers didn't need to be non-const.
  
  This makes the powerpc warning free again.
  
  Sponsored by: Netflix

Modified:
  head/stand/powerpc/kboot/host_syscall.h
  head/stand/powerpc/kboot/kbootfdt.c

Modified: head/stand/powerpc/kboot/host_syscall.h
==============================================================================
--- head/stand/powerpc/kboot/host_syscall.h	Thu Nov 30 01:40:07 2017	(r326383)
+++ head/stand/powerpc/kboot/host_syscall.h	Thu Nov 30 05:01:56 2017	(r326384)
@@ -33,7 +33,7 @@
 ssize_t host_read(int fd, void *buf, size_t nbyte);
 ssize_t host_write(int fd, const void *buf, size_t nbyte);
 ssize_t host_seek(int fd, int64_t offset, int whence);
-int host_open(char *path, int flags, int mode);
+int host_open(const char *path, int flags, int mode);
 int host_close(int fd);
 void *host_mmap(void *addr, size_t len, int prot, int flags, int fd, int);
 #define host_getmem(size) host_mmap(0, size, 3 /* RW */, 0x22 /* ANON */, -1, 0);

Modified: head/stand/powerpc/kboot/kbootfdt.c
==============================================================================
--- head/stand/powerpc/kboot/kbootfdt.c	Thu Nov 30 01:40:07 2017	(r326383)
+++ head/stand/powerpc/kboot/kbootfdt.c	Thu Nov 30 05:01:56 2017	(r326384)
@@ -119,7 +119,7 @@ fdt_linux_fixups(void *fdtp)
 
 	offset = fdt_path_offset(fdtp, "/ibm,opal");
 	if (offset > 0) {
-		uint64_t *base, *size;
+		const uint64_t *base, *size;
 		base = fdt_getprop(fdtp, offset, "opal-base-address",
 		    &len);
 		size = fdt_getprop(fdtp, offset, "opal-runtime-size",
@@ -130,7 +130,7 @@ fdt_linux_fixups(void *fdtp)
 	}
 	offset = fdt_path_offset(fdtp, "/rtas");
 	if (offset > 0) {
-		uint32_t *base, *size;
+		const uint32_t *base, *size;
 		base = fdt_getprop(fdtp, offset, "linux,rtas-base", &len);
 		size = fdt_getprop(fdtp, offset, "rtas-size", &len);
 		if (base != NULL && size != NULL)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711300501.vAU51uH1095955>