Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754251AbbDMMbj (ORCPT ); Mon, 13 Apr 2015 08:31:39 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:38750 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753847AbbDMMbg (ORCPT ); Mon, 13 Apr 2015 08:31:36 -0400 Date: Mon, 13 Apr 2015 15:31:09 +0300 From: Dan Carpenter To: Peter Senna Tschudin Cc: Geert Uytterhoeven , driverdevel , Greg Kroah-Hartman , Jun Tian , "linux-kernel@vger.kernel.org" , Garret Kelly , Octavian Purdila , Nick Kralevich , Alan Subject: Re: [PATCH] Fix pointer cast for 32 bits arch Message-ID: <20150413122911.GW10964@mwanda> References: <1428830803-30896-1-git-send-email-peter.senna@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1060 Lines: 36 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/