lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1450741676-5865-81-git-send-email-viro@ZenIV.linux.org.uk>
Date:	Mon, 21 Dec 2015 23:47:54 +0000
From:	Al Viro <viro@...IV.linux.org.uk>
To:	linux-kernel@...r.kernel.org
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: [POC][PATCH 81/83] sba_iommu: get rid of pointless casts

From: Al Viro <viro@...iv.linux.org.uk>

Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
---
 drivers/parisc/sba_iommu.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index 10ca71d..a6e76ba 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -1113,11 +1113,11 @@ PAT_MOD(mod)->mod_info.ioc         = PAT_GET_IOC(temp);
 static void *
 sba_alloc_pdir(unsigned int pdir_size)
 {
-        unsigned long pdir_base;
+        void *pdir_base;
 	unsigned long pdir_order = get_order(pdir_size);
 
-	pdir_base = __get_free_pages(GFP_KERNEL, pdir_order);
-	if (NULL == (void *) pdir_base)	{
+	pdir_base = get_free_pages(GFP_KERNEL, pdir_order);
+	if (!pdir_base)	{
 		panic("%s() could not allocate I/O Page Table\n",
 			__func__);
 	}
@@ -1131,7 +1131,7 @@ sba_alloc_pdir(unsigned int pdir_size)
 	if ( ((boot_cpu_data.pdc.cpuid >> 5) & 0x7f) != 0x13
 			|| (boot_cpu_data.pdc.versions > 0x202)
 			|| (boot_cpu_data.pdc.capabilities & 0x08L) )
-		return (void *) pdir_base;
+		return pdir_base;
 
 	/*
 	 * PA8700 (PCX-W2, aka piranha) silent data corruption fix
@@ -1154,16 +1154,16 @@ sba_alloc_pdir(unsigned int pdir_size)
 	if (pdir_order <= (19-12)) {
 		if (((virt_to_phys(pdir_base)+pdir_size-1) & PIRANHA_ADDR_MASK) == PIRANHA_ADDR_VAL) {
 			/* allocate a new one on 512k alignment */
-			unsigned long new_pdir = __get_free_pages(GFP_KERNEL, (19-12));
+			void *new_pdir = get_free_pages(GFP_KERNEL, (19-12));
 			/* release original */
-			free_pages((void *)pdir_base, pdir_order);
+			free_pages(pdir_base, pdir_order);
 
 			pdir_base = new_pdir;
 
 			/* release excess */
 			while (pdir_order < (19-12)) {
 				new_pdir += pdir_size;
-				free_pages((void *)new_pdir, pdir_order);
+				free_pages(new_pdir, pdir_order);
 				pdir_order +=1;
 				pdir_size <<=1;
 			}
@@ -1173,13 +1173,13 @@ sba_alloc_pdir(unsigned int pdir_size)
 		** 1MB or 2MB Pdir
 		** Needs to be aligned on an "odd" 1MB boundary.
 		*/
-		unsigned long new_pdir = __get_free_pages(GFP_KERNEL, pdir_order+1); /* 2 or 4MB */
+		void *new_pdir = get_free_pages(GFP_KERNEL, pdir_order+1); /* 2 or 4MB */
 
 		/* release original */
-		free_pages((void *)pdir_base, pdir_order);
+		free_pages(pdir_base, pdir_order);
 
 		/* release first 1MB */
-		free_pages((void *)new_pdir, 20-12);
+		free_pages(new_pdir, 20-12);
 
 		pdir_base = new_pdir + 1024*1024;
 
@@ -1194,17 +1194,17 @@ sba_alloc_pdir(unsigned int pdir_size)
 
 			new_pdir += 3*1024*1024;
 			/* release last 1MB */
-			free_pages((void *)new_pdir, 20-12);
+			free_pages(new_pdir, 20-12);
 
 			/* release unusable 128KB */
-			free_pages((void *)new_pdir - 128*1024 , 17-12);
+			free_pages(new_pdir - 128*1024 , 17-12);
 
 			pdir_size -= 128*1024;
 		}
 	}
 
-	memset((void *) pdir_base, 0, pdir_size);
-	return (void *) pdir_base;
+	memset(pdir_base, 0, pdir_size);
+	return pdir_base;
 }
 
 struct ibase_data_struct {
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ