All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: SF Markus Elfring <elfring@users.sourceforge.net>,
	linuxppc-dev@lists.ozlabs.org,
	Alistair Popple <alistair@popple.id.au>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	David Gibson <david@gibson.dropbear.id.au>,
	Gavin Shan <gwshan@linux.vnet.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Paul Mackerras <paulus@samba.org>, Rob Herring <robh@kernel.org>,
	Russell Currey <ruscur@russell.cc>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 3/3] powernv/pci: Improve a size determination in pnv_pci_init_ioda_phb()
Date: Wed, 18 Oct 2017 16:21:51 +1100	[thread overview]
Message-ID: <485415d5-1b3c-2603-89d1-0ebe0ccad274@ozlabs.ru> (raw)
In-Reply-To: <03b68902-629e-65ab-a5e8-d90a3613f596@users.sourceforge.net>

On 18/10/17 02:40, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> 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 <elfring@users.sourceforge.net>
> ---
>  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 <aik@ozlabs.ru>



-- 
Alexey

WARNING: multiple messages have this Message-ID (diff)
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: SF Markus Elfring <elfring@users.sourceforge.net>,
	linuxppc-dev@lists.ozlabs.org,
	Alistair Popple <alistair@popple.id.au>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	David Gibson <david@gibson.dropbear.id.au>,
	Gavin Shan <gwshan@linux.vnet.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Paul Mackerras <paulus@samba.org>, Rob Herring <robh@kernel.org>,
	Russell Currey <ruscur@russell.cc>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 3/3] powernv/pci: Improve a size determination in pnv_pci_init_ioda_phb()
Date: Wed, 18 Oct 2017 05:21:51 +0000	[thread overview]
Message-ID: <485415d5-1b3c-2603-89d1-0ebe0ccad274@ozlabs.ru> (raw)
In-Reply-To: <03b68902-629e-65ab-a5e8-d90a3613f596@users.sourceforge.net>

On 18/10/17 02:40, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> 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 <elfring@users.sourceforge.net>
> ---
>  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 <aik@ozlabs.ru>



-- 
Alexey

  reply	other threads:[~2017-10-18  5:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17 15:35 [PATCH 0/3] PowerNV-PCI: Adjustments for two function implementations SF Markus Elfring
2017-10-17 15:35 ` SF Markus Elfring
2017-10-17 15:37 ` [PATCH 1/3] powernv/pci: Delete an error message for a failed memory allocation in pnv_ioda_pick_m64_pe() SF Markus Elfring
2017-10-17 15:37   ` [PATCH 1/3] powernv/pci: Delete an error message for a failed memory allocation in pnv_ioda_pick_m64 SF Markus Elfring
2017-10-18  5:21   ` [PATCH 1/3] powernv/pci: Delete an error message for a failed memory allocation in pnv_ioda_pick_m64_pe() Alexey Kardashevskiy
2017-10-18  5:21     ` [PATCH 1/3] powernv/pci: Delete an error message for a failed memory allocation in pnv_ioda_pick Alexey Kardashevskiy
2017-10-17 15:39 ` [PATCH 2/3] powernv/pci: Use common code in pnv_ioda_pick_m64_pe() SF Markus Elfring
2017-10-17 15:39   ` SF Markus Elfring
2017-10-18  5:24   ` Alexey Kardashevskiy
2017-10-18  5:24     ` Alexey Kardashevskiy
2017-10-17 15:40 ` [PATCH 3/3] powernv/pci: Improve a size determination in pnv_pci_init_ioda_phb() SF Markus Elfring
2017-10-17 15:40   ` SF Markus Elfring
2017-10-18  5:21   ` Alexey Kardashevskiy [this message]
2017-10-18  5:21     ` Alexey Kardashevskiy
2018-03-20 10:15   ` [3/3] " Michael Ellerman
2018-03-20 10:15     ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=485415d5-1b3c-2603-89d1-0ebe0ccad274@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=alistair@popple.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=elfring@users.sourceforge.net \
    --cc=gwshan@linux.vnet.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=robh@kernel.org \
    --cc=ruscur@russell.cc \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.