From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964996AbdJRFWB (ORCPT ); Wed, 18 Oct 2017 01:22:01 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:48887 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964939AbdJRFV6 (ORCPT ); Wed, 18 Oct 2017 01:21:58 -0400 X-Google-Smtp-Source: AOwi7QBTgYl8M3l5MCxbO5Atk9HN83ILvd4ygUKXgmqgZdgKpSuKBYYIdAbttI3CSul2JOVdvdByXQ== Subject: Re: [PATCH 3/3] powernv/pci: Improve a size determination in pnv_pci_init_ioda_phb() To: SF Markus Elfring , linuxppc-dev@lists.ozlabs.org, Alistair Popple , Benjamin Herrenschmidt , David Gibson , Gavin Shan , Michael Ellerman , Paul Mackerras , Rob Herring , Russell Currey Cc: LKML , kernel-janitors@vger.kernel.org References: <549d0b6b-f875-c524-d867-742745117c1e@users.sourceforge.net> <03b68902-629e-65ab-a5e8-d90a3613f596@users.sourceforge.net> From: Alexey Kardashevskiy Message-ID: <485415d5-1b3c-2603-89d1-0ebe0ccad274@ozlabs.ru> Date: Wed, 18 Oct 2017 16:21:51 +1100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <03b68902-629e-65ab-a5e8-d90a3613f596@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-AU Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/10/17 02:40, SF Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 17 Oct 2017 17:18:10 +0200 > > 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. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring > --- > arch/powerpc/platforms/powernv/pci-ioda.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c > index 98d9435240f4..2febdf06a237 100644 > --- a/arch/powerpc/platforms/powernv/pci-ioda.c > +++ b/arch/powerpc/platforms/powernv/pci-ioda.c > @@ -3802,7 +3802,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np, > phb_id = be64_to_cpup(prop64); > pr_debug(" PHB-ID : 0x%016llx\n", phb_id); > > - phb = memblock_virt_alloc(sizeof(struct pnv_phb), 0); > + phb = memblock_virt_alloc(sizeof(*phb), 0); > > /* Allocate PCI controller */ > phb->hose = hose = pcibios_alloc_controller(np); > Reviewed-by: Alexey Kardashevskiy -- Alexey From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Kardashevskiy Date: Wed, 18 Oct 2017 05:21:51 +0000 Subject: Re: [PATCH 3/3] powernv/pci: Improve a size determination in pnv_pci_init_ioda_phb() Message-Id: <485415d5-1b3c-2603-89d1-0ebe0ccad274@ozlabs.ru> List-Id: References: <549d0b6b-f875-c524-d867-742745117c1e@users.sourceforge.net> <03b68902-629e-65ab-a5e8-d90a3613f596@users.sourceforge.net> In-Reply-To: <03b68902-629e-65ab-a5e8-d90a3613f596@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: SF Markus Elfring , linuxppc-dev@lists.ozlabs.org, Alistair Popple , Benjamin Herrenschmidt , David Gibson , Gavin Shan , Michael Ellerman , Paul Mackerras , Rob Herring , Russell Currey Cc: LKML , kernel-janitors@vger.kernel.org On 18/10/17 02:40, SF Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 17 Oct 2017 17:18:10 +0200 > > 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. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring > --- > arch/powerpc/platforms/powernv/pci-ioda.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c > index 98d9435240f4..2febdf06a237 100644 > --- a/arch/powerpc/platforms/powernv/pci-ioda.c > +++ b/arch/powerpc/platforms/powernv/pci-ioda.c > @@ -3802,7 +3802,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np, > phb_id = be64_to_cpup(prop64); > pr_debug(" PHB-ID : 0x%016llx\n", phb_id); > > - phb = memblock_virt_alloc(sizeof(struct pnv_phb), 0); > + phb = memblock_virt_alloc(sizeof(*phb), 0); > > /* Allocate PCI controller */ > phb->hose = hose = pcibios_alloc_controller(np); > Reviewed-by: Alexey Kardashevskiy -- Alexey