All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Peter Senna Tschudin <peter.senna@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	driverdevel <devel@driverdev.osuosl.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jun Tian <jun.j.tian@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Garret Kelly <garret.kelly@gmail.com>,
	Octavian Purdila <octavian.purdila@intel.com>,
	Nick Kralevich <nnk@google.com>, Alan <alan@linux.intel.com>
Subject: Re: [PATCH] Fix pointer cast for 32 bits arch
Date: Mon, 13 Apr 2015 15:31:09 +0300	[thread overview]
Message-ID: <20150413122911.GW10964@mwanda> (raw)
In-Reply-To: <CA+MoWDrQwhNwQNLgpzCaiW+Om6byWLpkGqkJNh96pvi3c1-H+Q@mail.gmail.com>

On Mon, Apr 13, 2015 at 01:25:15PM +0200, Peter Senna Tschudin wrote:
> Line 4677 of http://pastebin.com/2bi9Dg7k looks like a bug
> 
> diff -u -p a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
> -       regs->nip = (unsigned long) (unsigned long)ksig->ka.sa.sa_handler;

I don't know about "bug" but it does look uninentional, yes.

Double casting is probably a good thing to print a static checker
warning about.

Other static checkers complain about:

1)	~(char)foo;

	(char)foo is type promoted to an int before the bitwise NOT.

2)	(long *)&some_int

3)	some_function((struct foo *)ptr);

	Casting function arguments is almost always wrong.  I check this
	with Smatch.  I don't remember the details.

4)	(long long)(x + y)

	Probably it should be (long long)x + y

regards,
dan carpenter


  reply	other threads:[~2015-04-13 12:31 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-12  9:26 [PATCH] Fix pointer cast for 32 bits arch Peter Senna Tschudin
2015-04-12 13:05 ` Geert Uytterhoeven
2015-04-12 13:48   ` Peter Senna Tschudin
2015-04-12 15:38     ` Geert Uytterhoeven
2015-04-12 18:14       ` Joe Perches
2015-04-12 19:06         ` Geert Uytterhoeven
2015-04-13 11:14       ` Peter Senna Tschudin
2015-04-13 11:21         ` Geert Uytterhoeven
2015-04-13 11:25           ` Peter Senna Tschudin
2015-04-13 12:31             ` Dan Carpenter [this message]
2015-04-16 13:39               ` [PATCH V4] " Peter Senna Tschudin
2015-04-16 16:14                 ` Geert Uytterhoeven
2015-04-16 17:01                   ` Dan Carpenter
2015-04-16 17:05                     ` Alan Cox
2015-04-16 18:36                       ` Peter Senna Tschudin
2015-05-03 18:32                         ` Greg Kroah-Hartman
2015-05-04 13:11                           ` [PATCH V5] staging: goldfish: Fix pointer cast for 32 bits Peter Senna Tschudin
2015-05-04 13:34                             ` Dan Carpenter
2015-05-09 16:24                             ` Greg KH
2015-05-19  9:44                               ` [PATCH V6] " Peter Senna Tschudin
2015-04-17  8:11                       ` [PATCH V4] Fix pointer cast for 32 bits arch Dan Carpenter
2015-04-17  8:20                         ` Dan Carpenter
2015-04-17 13:31                           ` Alan Cox
2015-04-17 13:59                             ` Dan Carpenter
2015-04-17 14:10                               ` Alan Cox
2015-04-18 13:34                                 ` Peter Senna Tschudin
2015-04-18 13:59                                   ` Dan Carpenter
2015-04-13  9:10 ` [PATCH] " Dan Carpenter
2015-04-13  9:16   ` Peter Senna Tschudin
2015-04-13  9:21     ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150413122911.GW10964@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=alan@linux.intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=garret.kelly@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jun.j.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nnk@google.com \
    --cc=octavian.purdila@intel.com \
    --cc=peter.senna@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.