From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Subject: [PATCH 4/4] serial: pch_uart: Improve a size determination in pch_uart_init_port() Date: Fri, 8 Dec 2017 19:12:33 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: Content-Language: en-GB Sender: linux-kernel-owner@vger.kernel.org To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby Cc: LKML , kernel-janitors@vger.kernel.org List-Id: linux-serial@vger.kernel.org From: Markus Elfring Date: Fri, 8 Dec 2017 18:53:21 +0100 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 --- drivers/tty/serial/pch_uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c index 790a7aae331f..1c30309ef02c 100644 --- a/drivers/tty/serial/pch_uart.c +++ b/drivers/tty/serial/pch_uart.c @@ -1747,7 +1747,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev, board = &drv_dat[id->driver_data]; port_type = board->port_type; - priv = kzalloc(sizeof(struct eg20t_port), GFP_KERNEL); + priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (priv == NULL) goto init_port_alloc_err; -- 2.15.1