From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753581Ab2IFG7I (ORCPT ); Thu, 6 Sep 2012 02:59:08 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:63089 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751156Ab2IFG7F (ORCPT ); Thu, 6 Sep 2012 02:59:05 -0400 Message-ID: <504849B4.4050303@suse.cz> Date: Thu, 06 Sep 2012 08:59:00 +0200 From: Jiri Slaby User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120825 Thunderbird/15.0 MIME-Version: 1.0 To: Fengguang Wu CC: linux-serial@vger.kernel.org, Alan Cox , Greg Kroah-Hartman , LKML Subject: Re: [PATCH] serial_core: fix sizeof(pointer) References: <20120906022751.GA16285@localhost> In-Reply-To: <20120906022751.GA16285@localhost> X-Enigmail-Version: 1.4.4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/06/2012 04:27 AM, Fengguang Wu wrote: > sizeof when applied to a pointer typed expression gives the > size of the pointer. > > Generated by: scripts/coccinelle/misc/noderef.cocci > > Signed-off-by: Fengguang Wu > --- > > cocci-output-38612-39d907-serial_core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- a/drivers/tty/serial/serial_core.c > +++ b/drivers/tty/serial/serial_core.c > @@ -640,7 +640,7 @@ static void uart_get_info(struct tty_por > { > struct uart_port *uport = state->uart_port; > > - memset(retinfo, 0, sizeof(retinfo)); > + memset(retinfo, 0, sizeof(*retinfo)); Hmm, what tree is this against? I have: memset(&tmp, 0, sizeof(tmp)); thanks, -- js suse labs