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

Markus Elfring Markus.Elfring at web.de
Tue May 23 17:44:14 UTC 2023


From: Markus Elfring <elfring at 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 at users.sourceforge.net>
---
 drivers/video/fbdev/imsttfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;

--
2.40.1



More information about the dri-devel mailing list