* [PATCH 00/16] Make all drivers under drivers/media to build with COMPILE_TEST
@ 2018-04-05 17:54 Mauro Carvalho Chehab
2018-04-05 17:54 ` [PATCH 15/16] media: omapfb_dss.h: add stubs " Mauro Carvalho Chehab
0 siblings, 1 reply; 4+ messages in thread
From: Mauro Carvalho Chehab @ 2018-04-05 17:54 UTC (permalink / raw)
Cc: linux-fbdev, Sylwester Nawrocki, Stanimir Varbanov, dri-devel,
Lad, Prabhakar, Laurent Pinchart, Benjamin Gaignard,
linux-samsung-soc, Jonathan Corbet, Krzysztof Kozlowski,
Mauro Carvalho Chehab, Kukjin Kim, Hans Verkuil, Arvind Yadav,
Linux Media Mailing List, Kees Cook, Arnd Bergmann,
Bartlomiej Zolnierkiewicz, Geliang Tang, Mauro Carvalho Chehab,
Al Viro, linux-a
The current media policy has been for a while to only accept new drivers
that compile with COMPILE_TEST.
However, there are still several drivers under drivers/media that
doesn't build with COMPILE_TEST.
So, this series makes the existing ones also compatible with it.
Not building with COMPILE_TEST is a bad thing, for several reasons.
The main ones is that:
1) the licence the Kernel community has for Coverity only builds for
x86. So, drivers that don't build on such archtecture were likely
never tested by it.
2) That affects my per-patch handling process, with should be quick
enough to not delay my patch handling process. So, I only build for one
architecture (i386).
3) When appliying a patch, I always run two static code analyzers (W=1,
smatch and sparse). Those drivers weren't checked by me. At the end
of the day, that leads to a lower quality check for the drivers that
don't build on i386.
There are two situations on this patch series that proof the lower
quality of those drivers:
- There is a case of a driver that was added broken in 2013. Only two
years later, someone noticed and "fixed" it by markin it as BROKEN!
- 5 patches in this series (about 1/3) are just to fix build issues on
those drivers, most of them due to gcc warnings.
Mauro Carvalho Chehab (16):
omap: omap-iommu.h: allow building drivers with COMPILE_TEST
media: omap3isp: allow it to build with COMPILE_TEST
media: omap3isp/isp: remove an unused static var
media: fsl-viu: mark static functions as such
media: fsl-viu: allow building it with COMPILE_TEST
media: cec_gpio: allow building CEC_GPIO with COMPILE_TEST
media: exymos4-is: allow compile test for EXYNOS FIMC-LITE
media: mmp-camera.h: add missing platform data
media: marvel-ccic: re-enable mmp-driver build
media: mmp-driver: make two functions static
media: davinci: allow building isif code
media: davinci: allow build vpbe_display with COMPILE_TEST
media: vpbe_venc: don't store return codes if they won't be used
media: davinci: get rid of lots of kernel-doc warnings
media: omapfb_dss.h: add stubs to build with COMPILE_TEST
media: omap: allow building it with COMPILE_TEST
drivers/media/platform/Kconfig | 12 +++---
drivers/media/platform/davinci/Kconfig | 6 ++-
drivers/media/platform/davinci/isif.c | 2 -
drivers/media/platform/davinci/vpbe.c | 38 +++++++++--------
drivers/media/platform/davinci/vpbe_display.c | 21 +++++----
drivers/media/platform/davinci/vpbe_osd.c | 16 ++++---
drivers/media/platform/davinci/vpbe_venc.c | 9 ++--
drivers/media/platform/exynos4-is/Kconfig | 4 +-
drivers/media/platform/fsl-viu.c | 20 ++++++---
drivers/media/platform/marvell-ccic/Kconfig | 5 ++-
drivers/media/platform/marvell-ccic/mmp-driver.c | 4 +-
drivers/media/platform/omap/Kconfig | 6 +--
drivers/media/platform/omap3isp/isp.c | 14 +++---
include/linux/omap-iommu.h | 5 +++
include/linux/platform_data/media/mmp-camera.h | 19 +++++++++
include/video/omapfb_dss.h | 54 +++++++++++++++++++++++-
16 files changed, 162 insertions(+), 73 deletions(-)
--
2.14.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 15/16] media: omapfb_dss.h: add stubs to build with COMPILE_TEST
2018-04-05 17:54 [PATCH 00/16] Make all drivers under drivers/media to build with COMPILE_TEST Mauro Carvalho Chehab
@ 2018-04-05 17:54 ` Mauro Carvalho Chehab
2018-04-05 18:41 ` Laurent Pinchart
0 siblings, 1 reply; 4+ messages in thread
From: Mauro Carvalho Chehab @ 2018-04-05 17:54 UTC (permalink / raw)
Cc: linux-fbdev, Bartlomiej Zolnierkiewicz, dri-devel,
Mauro Carvalho Chehab, Mauro Carvalho Chehab,
Linux Media Mailing List
Add stubs for omapfb_dss.h, in the case it is included by
some driver when CONFIG_FB_OMAP2 is not defined.
That allows building such driver(s) with COMPILE_TEST.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
include/video/omapfb_dss.h | 54 ++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 52 insertions(+), 2 deletions(-)
diff --git a/include/video/omapfb_dss.h b/include/video/omapfb_dss.h
index 1d38901d599d..e9775144ff3b 100644
--- a/include/video/omapfb_dss.h
+++ b/include/video/omapfb_dss.h
@@ -774,6 +774,12 @@ struct omap_dss_driver {
const struct hdmi_avi_infoframe *avi);
};
+#define for_each_dss_dev(d) while ((d = omap_dss_get_next_device(d)) != NULL)
+
+typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
+
+#ifdef CONFIG_FB_OMAP2
+
enum omapdss_version omapdss_get_version(void);
bool omapdss_is_initialized(void);
@@ -785,7 +791,6 @@ void omapdss_unregister_display(struct omap_dss_device *dssdev);
struct omap_dss_device *omap_dss_get_device(struct omap_dss_device *dssdev);
void omap_dss_put_device(struct omap_dss_device *dssdev);
-#define for_each_dss_dev(d) while ((d = omap_dss_get_next_device(d)) != NULL)
struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from);
struct omap_dss_device *omap_dss_find_device(void *data,
int (*match)(struct omap_dss_device *dssdev, void *data));
@@ -826,7 +831,6 @@ int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev);
void omapdss_default_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings);
-typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
@@ -856,5 +860,51 @@ omapdss_of_get_first_endpoint(const struct device_node *parent);
struct omap_dss_device *
omapdss_of_find_source_for_first_ep(struct device_node *node);
+#else
+
+static inline enum omapdss_version omapdss_get_version(void)
+{ return OMAPDSS_VER_UNKNOWN; };
+
+static inline bool omapdss_is_initialized(void)
+{ return false; };
+
+static inline int omap_dispc_register_isr(omap_dispc_isr_t isr,
+ void *arg, u32 mask)
+{ return 0; };
+
+static inline int omap_dispc_unregister_isr(omap_dispc_isr_t isr,
+ void *arg, u32 mask)
+{ return 0; };
+
+static inline struct omap_dss_device
+*omap_dss_get_device(struct omap_dss_device *dssdev)
+{ return NULL; };
+
+static inline struct omap_dss_device
+*omap_dss_get_next_device(struct omap_dss_device *from)
+{return NULL; };
+
+static inline void omap_dss_put_device(struct omap_dss_device *dssdev) {};
+
+static inline int omapdss_compat_init(void)
+{ return 0; };
+
+static inline void omapdss_compat_uninit(void) {};
+
+static inline int omap_dss_get_num_overlay_managers(void)
+{ return 0; };
+
+static inline struct omap_overlay_manager *omap_dss_get_overlay_manager(int num)
+{ return NULL; };
+
+static inline int omap_dss_get_num_overlays(void)
+{ return 0; };
+
+static inline struct omap_overlay *omap_dss_get_overlay(int num)
+{ return NULL; };
+
+
+#endif /* FB_OMAP2 */
+
#endif /* __OMAPFB_DSS_H */
--
2.14.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 15/16] media: omapfb_dss.h: add stubs to build with COMPILE_TEST
2018-04-05 17:54 ` [PATCH 15/16] media: omapfb_dss.h: add stubs " Mauro Carvalho Chehab
@ 2018-04-05 18:41 ` Laurent Pinchart
2018-04-05 19:32 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2018-04-05 18:41 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: Bartlomiej Zolnierkiewicz, Mauro Carvalho Chehab, linux-fbdev,
dri-devel, Linux Media Mailing List
Hi Mauro,
Thank you for the patch.
On Thursday, 5 April 2018 20:54:15 EEST Mauro Carvalho Chehab wrote:
> Add stubs for omapfb_dss.h, in the case it is included by
> some driver when CONFIG_FB_OMAP2 is not defined.
The omapfb driver doesn't include any asm/ header, so it should probably build
fine on non-ARM architectures. Instead of adding stubs here, you can enable
compilation of the driver on all platforms, in which case the omap_vout driver
could keep depending on FB_OMAP2 as it should.
> That allows building such driver(s) with COMPILE_TEST.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
> ---
> include/video/omapfb_dss.h | 54 +++++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 52 insertions(+), 2 deletions(-)
>
> diff --git a/include/video/omapfb_dss.h b/include/video/omapfb_dss.h
> index 1d38901d599d..e9775144ff3b 100644
> --- a/include/video/omapfb_dss.h
> +++ b/include/video/omapfb_dss.h
> @@ -774,6 +774,12 @@ struct omap_dss_driver {
> const struct hdmi_avi_infoframe *avi);
> };
>
> +#define for_each_dss_dev(d) while ((d = omap_dss_get_next_device(d)) !> NULL) +
> +typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
> +
> +#ifdef CONFIG_FB_OMAP2
> +
> enum omapdss_version omapdss_get_version(void);
> bool omapdss_is_initialized(void);
>
> @@ -785,7 +791,6 @@ void omapdss_unregister_display(struct omap_dss_device
> *dssdev);
>
> struct omap_dss_device *omap_dss_get_device(struct omap_dss_device
> *dssdev); void omap_dss_put_device(struct omap_dss_device *dssdev);
> -#define for_each_dss_dev(d) while ((d = omap_dss_get_next_device(d)) !> NULL) struct omap_dss_device *omap_dss_get_next_device(struct
> omap_dss_device *from); struct omap_dss_device *omap_dss_find_device(void
> *data,
> int (*match)(struct omap_dss_device *dssdev, void *data));
> @@ -826,7 +831,6 @@ int omapdss_default_get_recommended_bpp(struct
> omap_dss_device *dssdev); void omapdss_default_get_timings(struct
> omap_dss_device *dssdev,
> struct omap_video_timings *timings);
>
> -typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
> int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
> int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
>
> @@ -856,5 +860,51 @@ omapdss_of_get_first_endpoint(const struct device_node
> *parent);
>
> struct omap_dss_device *
> omapdss_of_find_source_for_first_ep(struct device_node *node);
> +#else
> +
> +static inline enum omapdss_version omapdss_get_version(void)
> +{ return OMAPDSS_VER_UNKNOWN; };
> +
> +static inline bool omapdss_is_initialized(void)
> +{ return false; };
> +
> +static inline int omap_dispc_register_isr(omap_dispc_isr_t isr,
> + void *arg, u32 mask)
> +{ return 0; };
> +
> +static inline int omap_dispc_unregister_isr(omap_dispc_isr_t isr,
> + void *arg, u32 mask)
> +{ return 0; };
> +
> +static inline struct omap_dss_device
> +*omap_dss_get_device(struct omap_dss_device *dssdev)
> +{ return NULL; };
> +
> +static inline struct omap_dss_device
> +*omap_dss_get_next_device(struct omap_dss_device *from)
> +{return NULL; };
> +
> +static inline void omap_dss_put_device(struct omap_dss_device *dssdev) {};
> +
> +static inline int omapdss_compat_init(void)
> +{ return 0; };
> +
> +static inline void omapdss_compat_uninit(void) {};
> +
> +static inline int omap_dss_get_num_overlay_managers(void)
> +{ return 0; };
> +
> +static inline struct omap_overlay_manager *omap_dss_get_overlay_manager(int
> num) +{ return NULL; };
> +
> +static inline int omap_dss_get_num_overlays(void)
> +{ return 0; };
> +
> +static inline struct omap_overlay *omap_dss_get_overlay(int num)
> +{ return NULL; };
> +
> +
> +#endif /* FB_OMAP2 */
> +
>
> #endif /* __OMAPFB_DSS_H */
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 15/16] media: omapfb_dss.h: add stubs to build with COMPILE_TEST
2018-04-05 18:41 ` Laurent Pinchart
@ 2018-04-05 19:32 ` Mauro Carvalho Chehab
0 siblings, 0 replies; 4+ messages in thread
From: Mauro Carvalho Chehab @ 2018-04-05 19:32 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Bartlomiej Zolnierkiewicz, Mauro Carvalho Chehab, linux-fbdev,
dri-devel, Linux Media Mailing List
Em Thu, 05 Apr 2018 21:41:18 +0300
Laurent Pinchart <laurent.pinchart@ideasonboard.com> escreveu:
> Hi Mauro,
>
> Thank you for the patch.
>
> On Thursday, 5 April 2018 20:54:15 EEST Mauro Carvalho Chehab wrote:
> > Add stubs for omapfb_dss.h, in the case it is included by
> > some driver when CONFIG_FB_OMAP2 is not defined.
>
> The omapfb driver doesn't include any asm/ header, so it should probably build
> fine on non-ARM architectures. Instead of adding stubs here, you can enable
> compilation of the driver on all platforms, in which case the omap_vout driver
> could keep depending on FB_OMAP2 as it should.
True. The patch for that is simple.
Patch enclosed. Please notice that, now with W=1, several new warnings
will popup. I'll let to the others to touch there, as I don't have any
clue about what's there under omapfb.
Those are the new warnings:
drivers/video/fbdev/omap2/omapfb/omapfb-main.c: In function ‘omapfb_setup_overlay’:
drivers/video/fbdev/omap2/omapfb/omapfb-main.c:891:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (ofbi->rotation_type = OMAP_DSS_ROT_VRFB) {
^
drivers/video/fbdev/omap2/omapfb/omapfb-main.c:896:2: note: here
default:
^~~~~~~
drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c: In function ‘tpd_probe’:
drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c:221:26: warning: variable ‘in’ set but not used [-Wunused-but-set-variable]
struct omap_dss_device *in, *dssdev;
^~
drivers/video/fbdev/omap2/omapfb/dss/dispc.c: In function ‘calc_vrfb_rotation_offset’:
drivers/video/fbdev/omap2/omapfb/dss/dispc.c:1905:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (color_mode = OMAP_DSS_COLOR_YUV2 ||
^
drivers/video/fbdev/omap2/omapfb/dss/dispc.c:1908:2: note: here
case OMAP_DSS_ROT_90:
^~~~
drivers/video/fbdev/omap2/omapfb/dss/dispc.c:1927:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (color_mode = OMAP_DSS_COLOR_YUV2 ||
^
drivers/video/fbdev/omap2/omapfb/dss/dispc.c:1930:2: note: here
case OMAP_DSS_ROT_90 + 4:
^~~~
drivers/video/fbdev/omap2/omapfb/dss/venc.c:223:33: warning: ‘venc_config_pal_bdghi’ defined but not used [-Wunused-const-variable=]
static const struct venc_config venc_config_pal_bdghi = {
^~~~~~~~~~~~~~~~~~~~~
drivers/video/fbdev/omap2/omapfb/dss/dsi.c: In function ‘_dsi_print_reset_status’:
drivers/video/fbdev/omap2/omapfb/dss/dsi.c:1189:6: warning: variable ‘l’ set but not used [-Wunused-but-set-variable]
u32 l;
^
drivers/video/fbdev/omap2/omapfb/dss/dsi.c: In function ‘dsi_proto_timings’:
drivers/video/fbdev/omap2/omapfb/dss/dsi.c:3638:42: warning: variable ‘tclk_trail’ set but not used [-Wunused-but-set-variable]
unsigned tlpx, tclk_zero, tclk_prepare, tclk_trail;
^~~~~~~~~~
drivers/video/fbdev/omap2/omapfb/dss/dsi.c: In function ‘dsi_update’:
drivers/video/fbdev/omap2/omapfb/dss/dsi.c:4051:10: warning: variable ‘dh’ set but not used [-Wunused-but-set-variable]
u16 dw, dh;
^~
drivers/video/fbdev/omap2/omapfb/dss/dsi.c:4051:6: warning: variable ‘dw’ set but not used [-Wunused-but-set-variable]
u16 dw, dh;
^~
drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c: In function ‘hdmi4_audio_config’:
drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c:693:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
int err, n, cts, channel_count;
^~~
drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c: In function ‘hdmi5_audio_config’:
drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c:804:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
int err, n, cts, channel_count;
^~~
Thanks,
Mauro
---
[PATCH] omap2: omapfb: allow building it with COMPILE_TEST
This driver builds cleanly with COMPILE_TEST, and it is
needed in order to allow building drivers/media omap2
driver.
So, change the logic there to allow building it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
diff --git a/drivers/video/fbdev/omap2/Kconfig b/drivers/video/fbdev/omap2/Kconfig
index 0921c4de8407..82008699d253 100644
--- a/drivers/video/fbdev/omap2/Kconfig
+++ b/drivers/video/fbdev/omap2/Kconfig
@@ -1,4 +1,4 @@
-if ARCH_OMAP2PLUS
+if ARCH_OMAP2PLUS || COMPILE_TEST
source "drivers/video/fbdev/omap2/omapfb/Kconfig"
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-04-05 19:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-05 17:54 [PATCH 00/16] Make all drivers under drivers/media to build with COMPILE_TEST Mauro Carvalho Chehab
2018-04-05 17:54 ` [PATCH 15/16] media: omapfb_dss.h: add stubs " Mauro Carvalho Chehab
2018-04-05 18:41 ` Laurent Pinchart
2018-04-05 19:32 ` Mauro Carvalho Chehab
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).