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-next>] [day] [month] [year] [list]
Message-ID: <1503938959.2040.6.camel@perches.com>
Date:   Mon, 28 Aug 2017 09:49:19 -0700
From:   Joe Perches <joe@...ches.com>
To:     cocci <cocci@...teme.lip6.fr>
Cc:     LKML <linux-kernel@...r.kernel.org>
Subject: cocci: remove unnecessary casts of void * while avoiding casts with
 __user or __force ?

A simple cocci script that removes unnecessary casts of
a void * will also remove casts with __force or __user

e.g.:

-       xemaclite_aligned_write(address_ptr, (u32 __force *) addr, ETH_ALEN);
+       xemaclite_aligned_write(address_ptr, addr, ETH_ALEN);

Is there a simple mechanism to avoid converting those?

$ cat void.cocci
@@
type T;
void *v;
expression e;
@@

-	e = (T *)v;
+	e = v;

@@
identifier f;
type T;
void *v;
@@

	f(...,
-	(T *)v,
+	v,
	...)

$


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ