* [PATCH] video: Fix return value of fb_notifier_call_chain @ 2011-11-21 6:03 Joonyoung Shim 2011-11-21 6:55 ` Joonyoung Shim 0 siblings, 1 reply; 5+ messages in thread From: Joonyoung Shim @ 2011-11-21 6:03 UTC (permalink / raw) To: FlorianSchandinat; +Cc: linux-fbdev, linux-kernel The return value of blocking_notifier_call_chain isn't errno value, it is just notify return value. The ret of fb_notifier_call_chain should is restored to error value from notify return value using notifier_to_errno(). Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> --- drivers/video/fb_notify.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/video/fb_notify.c b/drivers/video/fb_notify.c index 74c2da5..49a64a3 100644 --- a/drivers/video/fb_notify.c +++ b/drivers/video/fb_notify.c @@ -42,6 +42,8 @@ EXPORT_SYMBOL(fb_unregister_client); */ int fb_notifier_call_chain(unsigned long val, void *v) { - return blocking_notifier_call_chain(&fb_notifier_list, val, v); + int ret = blocking_notifier_call_chain(&fb_notifier_list, val, v); + + return notifier_to_errno(ret); } EXPORT_SYMBOL_GPL(fb_notifier_call_chain); -- 1.7.5.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] video: Fix return value of fb_notifier_call_chain 2011-11-21 6:03 [PATCH] video: Fix return value of fb_notifier_call_chain Joonyoung Shim @ 2011-11-21 6:55 ` Joonyoung Shim 2011-11-21 23:08 ` Florian Tobias Schandinat 0 siblings, 1 reply; 5+ messages in thread From: Joonyoung Shim @ 2011-11-21 6:55 UTC (permalink / raw) To: FlorianSchandinat; +Cc: linux-fbdev, linux-kernel The return value of blocking_notifier_call_chain isn't errno value, it is just notify return value. The ret of fb_notifier_call_chain should is restored to error value from notify return value using notifier_to_errno(). Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> --- drivers/video/fb_notify.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/video/fb_notify.c b/drivers/video/fb_notify.c index 74c2da5..49a64a3 100644 --- a/drivers/video/fb_notify.c +++ b/drivers/video/fb_notify.c @@ -42,6 +42,8 @@ EXPORT_SYMBOL(fb_unregister_client); */ int fb_notifier_call_chain(unsigned long val, void *v) { - return blocking_notifier_call_chain(&fb_notifier_list, val, v); + int ret = blocking_notifier_call_chain(&fb_notifier_list, val, v); + + return notifier_to_errno(ret); } EXPORT_SYMBOL_GPL(fb_notifier_call_chain); -- 1.7.5.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] video: Fix return value of fb_notifier_call_chain 2011-11-21 6:55 ` Joonyoung Shim @ 2011-11-21 23:08 ` Florian Tobias Schandinat 2011-11-22 0:58 ` Joonyoung Shim 0 siblings, 1 reply; 5+ messages in thread From: Florian Tobias Schandinat @ 2011-11-21 23:08 UTC (permalink / raw) To: Joonyoung Shim; +Cc: linux-fbdev, linux-kernel On 11/21/2011 06:55 AM, Joonyoung Shim wrote: > The return value of blocking_notifier_call_chain isn't errno value, it > is just notify return value. The ret of fb_notifier_call_chain should is > restored to error value from notify return value using > notifier_to_errno(). If I'm not wrong this patch would rather break things than fix them. As I understand the notifier_calls would be required to encode the return value with notifier_from_errno. This does not happen at the moment for fb clients, for example fbcon_event_notify in drivers/video/console/fbcon.c, so this patch would screw up the return values, I think. Best regards, Florian Tobias Schandinat > Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> > --- > drivers/video/fb_notify.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/drivers/video/fb_notify.c b/drivers/video/fb_notify.c > index 74c2da5..49a64a3 100644 > --- a/drivers/video/fb_notify.c > +++ b/drivers/video/fb_notify.c > @@ -42,6 +42,8 @@ EXPORT_SYMBOL(fb_unregister_client); > */ > int fb_notifier_call_chain(unsigned long val, void *v) > { > - return blocking_notifier_call_chain(&fb_notifier_list, val, v); > + int ret = blocking_notifier_call_chain(&fb_notifier_list, val, v); > + > + return notifier_to_errno(ret); > } > EXPORT_SYMBOL_GPL(fb_notifier_call_chain); ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] video: Fix return value of fb_notifier_call_chain 2011-11-21 23:08 ` Florian Tobias Schandinat @ 2011-11-22 0:58 ` Joonyoung Shim 2011-11-22 1:20 ` Florian Tobias Schandinat 0 siblings, 1 reply; 5+ messages in thread From: Joonyoung Shim @ 2011-11-22 0:58 UTC (permalink / raw) To: Florian Tobias Schandinat; +Cc: linux-fbdev, linux-kernel 11/22/2011 08:08 AM, Florian Tobias Schandinat 쓴 글: > On 11/21/2011 06:55 AM, Joonyoung Shim wrote: >> The return value of blocking_notifier_call_chain isn't errno value, it >> is just notify return value. The ret of fb_notifier_call_chain should is >> restored to error value from notify return value using >> notifier_to_errno(). > If I'm not wrong this patch would rather break things than fix them. As I > understand the notifier_calls would be required to encode the return value with > notifier_from_errno. This does not happen at the moment for fb clients, for > example fbcon_event_notify in drivers/video/console/fbcon.c, so this patch would > screw up the return values, I think. OK, but it is wrong to return error value than notify value many callback of fb notify clients and some fb notify clients returns notify value, please see sh_mobile_lcdc_notify() and sh_hdmi_notify(). We should use only one, notify value or error value, i think it's right to use notify value. Thanks. > > Best regards, > > Florian Tobias Schandinat > >> Signed-off-by: Joonyoung Shim<jy0922.shim@samsung.com> >> --- >> drivers/video/fb_notify.c | 4 +++- >> 1 files changed, 3 insertions(+), 1 deletions(-) >> >> diff --git a/drivers/video/fb_notify.c b/drivers/video/fb_notify.c >> index 74c2da5..49a64a3 100644 >> --- a/drivers/video/fb_notify.c >> +++ b/drivers/video/fb_notify.c >> @@ -42,6 +42,8 @@ EXPORT_SYMBOL(fb_unregister_client); >> */ >> int fb_notifier_call_chain(unsigned long val, void *v) >> { >> - return blocking_notifier_call_chain(&fb_notifier_list, val, v); >> + int ret = blocking_notifier_call_chain(&fb_notifier_list, val, v); >> + >> + return notifier_to_errno(ret); >> } >> EXPORT_SYMBOL_GPL(fb_notifier_call_chain); > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] video: Fix return value of fb_notifier_call_chain 2011-11-22 0:58 ` Joonyoung Shim @ 2011-11-22 1:20 ` Florian Tobias Schandinat 0 siblings, 0 replies; 5+ messages in thread From: Florian Tobias Schandinat @ 2011-11-22 1:20 UTC (permalink / raw) To: Joonyoung Shim; +Cc: linux-fbdev, linux-kernel On 11/22/2011 12:58 AM, Joonyoung Shim wrote: > 11/22/2011 08:08 AM, Florian Tobias Schandinat 쓴 글: >> On 11/21/2011 06:55 AM, Joonyoung Shim wrote: >>> The return value of blocking_notifier_call_chain isn't errno value, it >>> is just notify return value. The ret of fb_notifier_call_chain should is >>> restored to error value from notify return value using >>> notifier_to_errno(). >> If I'm not wrong this patch would rather break things than fix them. As I >> understand the notifier_calls would be required to encode the return >> value with >> notifier_from_errno. This does not happen at the moment for fb >> clients, for >> example fbcon_event_notify in drivers/video/console/fbcon.c, so this >> patch would >> screw up the return values, I think. > > OK, but it is wrong to return error value than notify value many > callback of fb notify clients and some fb notify clients returns notify > value, please see sh_mobile_lcdc_notify() and sh_hdmi_notify(). > > We should use only one, notify value or error value, i think it's right > to use notify value. I agree. But all fb clients need to be checked and fixed up if needed at the same time you do the change you proposed, otherwise things are likely to break. $ grep -r fb_register_client . ./include/linux/fb.h:extern int fb_register_client(struct notifier_block *nb); ./arch/arm/mach-pxa/am200epd.c: fb_register_client(&am200_fb_notif); ./drivers/leds/ledtrig-backlight.c: ret = fb_register_client(&n->notifier); ./drivers/video/sh_mobile_hdmi.c: fb_register_client(&hdmi->notifier); ./drivers/video/fb_notify.c: * fb_register_client - register a client notifier ./drivers/video/fb_notify.c:int fb_register_client(struct notifier_block *nb) ./drivers/video/fb_notify.c:EXPORT_SYMBOL(fb_register_client); ./drivers/video/console/fbcon.c: fb_register_client(&fbcon_event_notifier); ./drivers/video/sh_mobile_lcdcfb.c: fb_register_client(&priv->notifier); ./drivers/video/omap/omapfb_main.c:int omapfb_register_client(struct omapfb_notifier_block *omapfb_nb, ./drivers/video/omap/omapfb_main.c:EXPORT_SYMBOL(omapfb_register_client); ./drivers/video/omap/omapfb.h:extern int omapfb_register_client(struct omapfb_notifier_block *nb, ./drivers/video/backlight/backlight.c: return fb_register_client(&bd->fb_notif); ./drivers/video/backlight/lcd.c: return fb_register_client(&ld->fb_notif); ./drivers/staging/olpc_dcon/olpc_dcon.c: fb_register_client(&dcon->fbevent_nb); Best regards, Florian Tobias Schandinat > > Thanks. > >> >> Best regards, >> >> Florian Tobias Schandinat >> >>> Signed-off-by: Joonyoung Shim<jy0922.shim@samsung.com> >>> --- >>> drivers/video/fb_notify.c | 4 +++- >>> 1 files changed, 3 insertions(+), 1 deletions(-) >>> >>> diff --git a/drivers/video/fb_notify.c b/drivers/video/fb_notify.c >>> index 74c2da5..49a64a3 100644 >>> --- a/drivers/video/fb_notify.c >>> +++ b/drivers/video/fb_notify.c >>> @@ -42,6 +42,8 @@ EXPORT_SYMBOL(fb_unregister_client); >>> */ >>> int fb_notifier_call_chain(unsigned long val, void *v) >>> { >>> - return blocking_notifier_call_chain(&fb_notifier_list, val, v); >>> + int ret = blocking_notifier_call_chain(&fb_notifier_list, val, v); >>> + >>> + return notifier_to_errno(ret); >>> } >>> EXPORT_SYMBOL_GPL(fb_notifier_call_chain); >> > > ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-11-22 1:20 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-11-21 6:03 [PATCH] video: Fix return value of fb_notifier_call_chain Joonyoung Shim 2011-11-21 6:55 ` Joonyoung Shim 2011-11-21 23:08 ` Florian Tobias Schandinat 2011-11-22 0:58 ` Joonyoung Shim 2011-11-22 1:20 ` Florian Tobias Schandinat
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).