Message ID | 20230425142846.730-4-tzimmermann@suse.de (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | drm,fbdev: Use fbdev's I/O helpers | expand |
Thomas Zimmermann <tzimmermann@suse.de> writes: > The file-op entry points fb_read() and fb_write() verify that > info->state has been set to FBINFO_STATE_RUNNING. Remove the same > test from the implementations of struct fb_ops.{fb_read,fb_write}. > > Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> > --- Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Tested-by: Sui Jingfeng <suijingfeng@loongson.cn> On 2023/4/25 22:28, Thomas Zimmermann wrote: > The file-op entry points fb_read() and fb_write() verify that > info->state has been set to FBINFO_STATE_RUNNING. Remove the same > test from the implementations of struct fb_ops.{fb_read,fb_write}. > > Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> > Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> > --- > drivers/video/fbdev/core/fb_sys_fops.c | 6 ------ > drivers/video/fbdev/sm712fb.c | 6 ------ > 2 files changed, 12 deletions(-) > > diff --git a/drivers/video/fbdev/core/fb_sys_fops.c b/drivers/video/fbdev/core/fb_sys_fops.c > index 6589123f4127..7dee5d3c7fb1 100644 > --- a/drivers/video/fbdev/core/fb_sys_fops.c > +++ b/drivers/video/fbdev/core/fb_sys_fops.c > @@ -22,9 +22,6 @@ ssize_t fb_sys_read(struct fb_info *info, char __user *buf, size_t count, > unsigned long total_size, c; > ssize_t ret; > > - if (info->state != FBINFO_STATE_RUNNING) > - return -EPERM; > - > total_size = info->screen_size; > > if (total_size == 0) > @@ -64,9 +61,6 @@ ssize_t fb_sys_write(struct fb_info *info, const char __user *buf, > unsigned long total_size, c; > size_t ret; > > - if (info->state != FBINFO_STATE_RUNNING) > - return -EPERM; > - > total_size = info->screen_size; > > if (total_size == 0) > diff --git a/drivers/video/fbdev/sm712fb.c b/drivers/video/fbdev/sm712fb.c > index b528776c7612..6f852cd756c5 100644 > --- a/drivers/video/fbdev/sm712fb.c > +++ b/drivers/video/fbdev/sm712fb.c > @@ -1031,9 +1031,6 @@ static ssize_t smtcfb_read(struct fb_info *info, char __user *buf, > if (!info || !info->screen_base) > return -ENODEV; > > - if (info->state != FBINFO_STATE_RUNNING) > - return -EPERM; > - > total_size = info->screen_size; > > if (total_size == 0) > @@ -1097,9 +1094,6 @@ static ssize_t smtcfb_write(struct fb_info *info, const char __user *buf, > if (!info || !info->screen_base) > return -ENODEV; > > - if (info->state != FBINFO_STATE_RUNNING) > - return -EPERM; > - > total_size = info->screen_size; > > if (total_size == 0)
Hi Thomas, On Tue, Apr 25, 2023 at 4:28 PM Thomas Zimmermann <tzimmermann@suse.de> wrote: > The file-op entry points fb_read() and fb_write() verify that > info->state has been set to FBINFO_STATE_RUNNING. Remove the same > test from the implementations of struct fb_ops.{fb_read,fb_write}. > > Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Thanks for your patch! > drivers/video/fbdev/core/fb_sys_fops.c | 6 ------ > drivers/video/fbdev/sm712fb.c | 6 ------ Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> But there are several other fbdev drivers to fix: drivers/media/pci/ivtv/ivtvfb.c drivers/video/fbdev/broadsheetfb.c drivers/video/fbdev/hecubafb.c drivers/video/fbdev/metronomefb.c Gr{oetje,eeting}s, Geert
Hi Am 26.04.23 um 16:49 schrieb Geert Uytterhoeven: > Hi Thomas, > > On Tue, Apr 25, 2023 at 4:28 PM Thomas Zimmermann <tzimmermann@suse.de> wrote: >> The file-op entry points fb_read() and fb_write() verify that >> info->state has been set to FBINFO_STATE_RUNNING. Remove the same >> test from the implementations of struct fb_ops.{fb_read,fb_write}. >> >> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> > > Thanks for your patch! > >> drivers/video/fbdev/core/fb_sys_fops.c | 6 ------ >> drivers/video/fbdev/sm712fb.c | 6 ------ > > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> > > But there are several other fbdev drivers to fix: > drivers/media/pci/ivtv/ivtvfb.c > drivers/video/fbdev/broadsheetfb.c > drivers/video/fbdev/hecubafb.c > drivers/video/fbdev/metronomefb.c Ok, I'll go through the various patches in this patchset and check if they need to be done elsewhere as well. Best regards Thomas > > Gr{oetje,eeting}s, > > Geert >
diff --git a/drivers/video/fbdev/core/fb_sys_fops.c b/drivers/video/fbdev/core/fb_sys_fops.c index 6589123f4127..7dee5d3c7fb1 100644 --- a/drivers/video/fbdev/core/fb_sys_fops.c +++ b/drivers/video/fbdev/core/fb_sys_fops.c @@ -22,9 +22,6 @@ ssize_t fb_sys_read(struct fb_info *info, char __user *buf, size_t count, unsigned long total_size, c; ssize_t ret; - if (info->state != FBINFO_STATE_RUNNING) - return -EPERM; - total_size = info->screen_size; if (total_size == 0) @@ -64,9 +61,6 @@ ssize_t fb_sys_write(struct fb_info *info, const char __user *buf, unsigned long total_size, c; size_t ret; - if (info->state != FBINFO_STATE_RUNNING) - return -EPERM; - total_size = info->screen_size; if (total_size == 0) diff --git a/drivers/video/fbdev/sm712fb.c b/drivers/video/fbdev/sm712fb.c index b528776c7612..6f852cd756c5 100644 --- a/drivers/video/fbdev/sm712fb.c +++ b/drivers/video/fbdev/sm712fb.c @@ -1031,9 +1031,6 @@ static ssize_t smtcfb_read(struct fb_info *info, char __user *buf, if (!info || !info->screen_base) return -ENODEV; - if (info->state != FBINFO_STATE_RUNNING) - return -EPERM; - total_size = info->screen_size; if (total_size == 0) @@ -1097,9 +1094,6 @@ static ssize_t smtcfb_write(struct fb_info *info, const char __user *buf, if (!info || !info->screen_base) return -ENODEV; - if (info->state != FBINFO_STATE_RUNNING) - return -EPERM; - total_size = info->screen_size; if (total_size == 0)
The file-op entry points fb_read() and fb_write() verify that info->state has been set to FBINFO_STATE_RUNNING. Remove the same test from the implementations of struct fb_ops.{fb_read,fb_write}. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> --- drivers/video/fbdev/core/fb_sys_fops.c | 6 ------ drivers/video/fbdev/sm712fb.c | 6 ------ 2 files changed, 12 deletions(-)