diff mbox series

[4/4] fbdev: imsttfb: Improve a size determination in imsttfb_probe()

Message ID b924f0b9-c769-3f9d-6242-c478408663fd@web.de (mailing list archive)
State New, archived
Headers show
Series fbdev: imsttfb: Adjustments for two function implementations | expand

Commit Message

Markus Elfring May 23, 2023, 5:44 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 23 May 2023 18:50:53 +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.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/video/fbdev/imsttfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.40.1
diff mbox series

Patch

diff --git a/drivers/video/fbdev/imsttfb.c b/drivers/video/fbdev/imsttfb.c
index 90c72428e8d7..346e0166c711 100644
--- a/drivers/video/fbdev/imsttfb.c
+++ b/drivers/video/fbdev/imsttfb.c
@@ -1491,7 +1491,7 @@  static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	else if (IS_ENABLED(CONFIG_OF))
 		printk(KERN_ERR "imsttfb: no OF node for pci device\n");

-	info = framebuffer_alloc(sizeof(struct imstt_par), &pdev->dev);
+	info = framebuffer_alloc(sizeof(*par), &pdev->dev);
 	if (!info)
 		return -ENOMEM;