From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761400AbdAKWB3 (ORCPT ); Wed, 11 Jan 2017 17:01:29 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33759 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752192AbdAKWBZ (ORCPT ); Wed, 11 Jan 2017 17:01:25 -0500 Subject: Re: [PATCH 02/18] mtd-cfi_cmdset_0001: Improve another size determination in cfi_intelext_partition_fixup() To: SF Markus Elfring , linux-mtd@lists.infradead.org, Boris Brezillon , Brian Norris , Cyrille Pitchen , David Woodhouse , Denys Vlasenko , Richard Weinberger References: <71189baa-8780-b80a-0b4d-9dae74763ba3@users.sourceforge.net> <6bc5e888-47e2-270c-10b7-9198513f1ca1@users.sourceforge.net> Cc: kernel-janitors@vger.kernel.org, LKML From: Marek Vasut Message-ID: Date: Wed, 11 Jan 2017 22:57:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <6bc5e888-47e2-270c-10b7-9198513f1ca1@users.sourceforge.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/11/2017 09:37 PM, SF Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 10 Jan 2017 19:09:58 +0100 Please drop this stuff ^^^^^ git send-email should do that for you. > Replace the specification of a data structure by a pointer dereference > as the parameter for the operator "sizeof" to make the corresponding size > determination a bit safer according to the Linux coding style convention. > > Signed-off-by: Markus Elfring > --- > drivers/mtd/chips/cfi_cmdset_0001.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c > index 68227aa74d22..0d7c2ef533d1 100644 > --- a/drivers/mtd/chips/cfi_cmdset_0001.c > +++ b/drivers/mtd/chips/cfi_cmdset_0001.c > @@ -753,7 +753,7 @@ static int cfi_intelext_partition_fixup(struct mtd_info *mtd, > kfree(newcfi); > return -ENOMEM; > } > - memcpy(newcfi, cfi, sizeof(struct cfi_private)); > + memcpy(newcfi, cfi, sizeof(*cfi)); > newcfi->numchips = numvirtchips; > newcfi->chipshift = partshift; > > -- Best regards, Marek Vasut