linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nubus: remove cast to void pointer
@ 2017-08-27  7:32 Himanshu Jha
  2019-09-27 12:45 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: Himanshu Jha @ 2017-08-27  7:32 UTC (permalink / raw)
  To: geert; +Cc: fthain, linux-kernel, Himanshu Jha

Casting void pointers to other pointer types in unnecessary.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
---
 drivers/nubus/nubus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nubus/nubus.c b/drivers/nubus/nubus.c
index df431e8..5450f1a 100644
--- a/drivers/nubus/nubus.c
+++ b/drivers/nubus/nubus.c
@@ -167,7 +167,7 @@ static unsigned char *nubus_dirptr(const struct nubus_dirent *nd)
 void nubus_get_rsrc_mem(void *dest, const struct nubus_dirent *dirent,
 			int len)
 {
-	unsigned char *t = (unsigned char *)dest;
+	unsigned char *t = dest;
 	unsigned char *p = nubus_dirptr(dirent);
 
 	while (len) {
@@ -180,7 +180,7 @@ EXPORT_SYMBOL(nubus_get_rsrc_mem);
 void nubus_get_rsrc_str(void *dest, const struct nubus_dirent *dirent,
 			int len)
 {
-	unsigned char *t = (unsigned char *)dest;
+	unsigned char *t = dest;
 	unsigned char *p = nubus_dirptr(dirent);
 
 	while (len) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] nubus: remove cast to void pointer
  2017-08-27  7:32 [PATCH] nubus: remove cast to void pointer Himanshu Jha
@ 2019-09-27 12:45 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2019-09-27 12:45 UTC (permalink / raw)
  To: Himanshu Jha; +Cc: Finn Thain, Linux Kernel Mailing List

Hi Himanshu,

On Sun, Aug 27, 2017 at 9:33 AM Himanshu Jha
<himanshujha199640@gmail.com> wrote:
> Casting void pointers to other pointer types in unnecessary.
>
> Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>

Thanks for your patch!

> --- a/drivers/nubus/nubus.c
> +++ b/drivers/nubus/nubus.c
> @@ -167,7 +167,7 @@ static unsigned char *nubus_dirptr(const struct nubus_dirent *nd)
>  void nubus_get_rsrc_mem(void *dest, const struct nubus_dirent *dirent,
>                         int len)
>  {
> -       unsigned char *t = (unsigned char *)dest;
> +       unsigned char *t = dest;
>         unsigned char *p = nubus_dirptr(dirent);
>
>         while (len) {
> @@ -180,7 +180,7 @@ EXPORT_SYMBOL(nubus_get_rsrc_mem);
>  void nubus_get_rsrc_str(void *dest, const struct nubus_dirent *dirent,
>                         int len)
>  {
> -       unsigned char *t = (unsigned char *)dest;
> +       unsigned char *t = dest;
>         unsigned char *p = nubus_dirptr(dirent);
>
>         while (len) {

The second chunk is no longer valid, but the first one still is.

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
i.e. will queue the first chunk for v5.5.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-27 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-27  7:32 [PATCH] nubus: remove cast to void pointer Himanshu Jha
2019-09-27 12:45 ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).