From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753675Ab2IFHIQ (ORCPT ); Thu, 6 Sep 2012 03:08:16 -0400 Received: from mga14.intel.com ([143.182.124.37]:47943 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751227Ab2IFHIN (ORCPT ); Thu, 6 Sep 2012 03:08:13 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,377,1344236400"; d="scan'208";a="189429150" Date: Thu, 6 Sep 2012 15:08:10 +0800 From: Fengguang Wu To: Jiri Slaby Cc: linux-serial@vger.kernel.org, Alan Cox , Greg Kroah-Hartman , LKML Subject: Re: [PATCH] serial_core: fix sizeof(pointer) Message-ID: <20120906070810.GA21359@localhost> References: <20120906022751.GA16285@localhost> <504849B4.4050303@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <504849B4.4050303@suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 06, 2012 at 08:59:00AM +0200, Jiri Slaby wrote: > 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: It's the tty:tty-next tree. git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-next > memset(&tmp, 0, sizeof(tmp)); Oh I didn't know it's a new bug introduced by commit commit 7ba2e769825fef035a943ed74d90379245508764 Author: Alan Cox AuthorDate: Tue Sep 4 16:34:45 2012 +0100 Commit: Greg Kroah-Hartman CommitDate: Wed Sep 5 13:11:03 2012 -0700 tty: Split the serial_core helpers for setserial into two Thanks, Fengguang