From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752575Ab3JDBxy (ORCPT ); Thu, 3 Oct 2013 21:53:54 -0400 Received: from mga02.intel.com ([134.134.136.20]:18570 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751600Ab3JDBxx (ORCPT ); Thu, 3 Oct 2013 21:53:53 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.90,1030,1371106800"; d="scan'208";a="405093692" Date: Fri, 4 Oct 2013 09:53:49 +0800 From: Fengguang Wu To: Greg Kroah-Hartman Cc: Alexander Shiyan , kbuild-all@01.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] serial: sccnxp: replace memcpy with struct assignment Message-ID: <20131004015349.GA5624@localhost> References: <5244e22f.VLBQtuO7RvNh9dWF%fengguang.wu@intel.com> <20131001020847.GA9317@kroah.com> <20131001113115.GB5525@localhost> <20131003230921.GA5559@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131003230921.GA5559@kroah.com> 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, Oct 03, 2013 at 04:09:21PM -0700, Greg KH wrote: > On Tue, Oct 01, 2013 at 07:31:15PM +0800, Fengguang Wu wrote: > > Generated by: coccinelle/misc/memcpy-assign.cocci > > > > CC: Alexander Shiyan > > Signed-off-by: Fengguang Wu > > --- > > > > drivers/tty/serial/sccnxp.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > --- linux-next.orig/drivers/tty/serial/sccnxp.c 2013-10-01 19:27:55.057537955 +0800 > > +++ linux-next/drivers/tty/serial/sccnxp.c 2013-10-01 19:28:17.873536923 +0800 > > @@ -907,7 +907,7 @@ static int sccnxp_probe(struct platform_ > > } > > > > if (pdata) > > - memcpy(&s->pdata, pdata, sizeof(struct sccnxp_pdata)); > > + s->pdata = *pdata; > > I don't think you compiled this, as it breaks the build :( Yeah, sorry! I'll take care next time.. drivers/tty/serial/sccnxp.c: In function 'sccnxp_probe': >> drivers/tty/serial/sccnxp.c:910:3: error: assignment of read-only member 'pdata' s->pdata = *pdata; ^ Thanks, Fengguang