On Tue Aug 12 11:53:02 2025 +0800, Qianfeng Rong wrote:
> Remove array_size() calls and replace vmalloc() with vmalloc_array() to
> simplify the code.
> 
> Signed-off-by: Qianfeng Rong <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/dvb-core/dmxdev.c    | 4 ++--
 drivers/media/dvb-core/dvb_demux.c | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

---

diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c
index 151177e5a06d..8c6f5aafda1d 100644
--- a/drivers/media/dvb-core/dmxdev.c
+++ b/drivers/media/dvb-core/dmxdev.c
@@ -1414,8 +1414,8 @@ int dvb_dmxdev_init(struct dmxdev *dmxdev, struct 
dvb_adapter *dvb_adapter)
        if (dmxdev->demux->open(dmxdev->demux) < 0)
                return -EUSERS;
 
-       dmxdev->filter = vmalloc(array_size(sizeof(struct dmxdev_filter),
-                                           dmxdev->filternum));
+       dmxdev->filter = vmalloc_array(dmxdev->filternum,
+                                      sizeof(struct dmxdev_filter));
        if (!dmxdev->filter)
                return -ENOMEM;
 
diff --git a/drivers/media/dvb-core/dvb_demux.c 
b/drivers/media/dvb-core/dvb_demux.c
index c93a3110a05d..290fc7961647 100644
--- a/drivers/media/dvb-core/dvb_demux.c
+++ b/drivers/media/dvb-core/dvb_demux.c
@@ -1244,14 +1244,14 @@ int dvb_dmx_init(struct dvb_demux *dvbdemux)
 
        dvbdemux->cnt_storage = NULL;
        dvbdemux->users = 0;
-       dvbdemux->filter = vmalloc(array_size(sizeof(struct dvb_demux_filter),
-                                             dvbdemux->filternum));
+       dvbdemux->filter = vmalloc_array(dvbdemux->filternum,
+                                        sizeof(struct dvb_demux_filter));
 
        if (!dvbdemux->filter)
                return -ENOMEM;
 
-       dvbdemux->feed = vmalloc(array_size(sizeof(struct dvb_demux_feed),
-                                           dvbdemux->feednum));
+       dvbdemux->feed = vmalloc_array(dvbdemux->feednum,
+                                      sizeof(struct dvb_demux_feed));
        if (!dvbdemux->feed) {
                vfree(dvbdemux->filter);
                dvbdemux->filter = NULL;
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to