Skip to contentSkip to conversation

staging: davinci_vpfe: fix W=1 build warnings

PATCH In review Arnd Bergmann 2 participants 2 messages Jun 20, 2016 – Nov 22, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: davinci_vpfe: fix W=1 build warnings

When building with "make W=1", we get multiple harmless build warnings for the vpfe driver:

drivers/staging/media/davinci_vpfe/dm365_resizer.c:241:1: error: 'static' is not at beginning of declaration [-Werror=old-style-declaration] drivers/staging/media/davinci_vpfe/dm365_resizer.c: In function 'resizer_set_defualt_configuration':
drivers/staging/media/davinci_vpfe/dm365_resizer.c:831:16: error: initialized field overwritten [-Werror=override-init] drivers/staging/media/davinci_vpfe/dm365_resizer.c:831:16: note: (near initialization for 'rsz_default_config.rsz_rsc_param[0].h_typ_c') drivers/staging/media/davinci_vpfe/dm365_resizer.c:849:16: error: initialized field overwritten [-Werror=override-init] drivers/staging/media/davinci_vpfe/dm365_resizer.c:849:16: note: (near initialization for 'rsz_default_config.rsz_rsc_param[1].h_typ_c')

All of them are trivial to fix without changing the behavior of the driver, as "static const" is interpreted the same as "const static", and VPFE_RSZ_INTP_CUBIC is defined as zero, so the initializations are not really needed.

---
 drivers/staging/media/davinci_vpfe/dm365_resizer.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/staging/media/davinci_vpfe/dm365_resizer.c +4 -5
index 3cd56cc132c7..567f995fd0f9 100644
@@ -237,9 +237,8 @@ resizer_calculate_resize_ratios(struct vpfe_resizer_device *resizer, int index)
 			((informat->width) * 256) / (outformat->width);
 }
 
-void
-static resizer_enable_422_420_conversion(struct resizer_params *param,
-					 int index, bool en)
+static void resizer_enable_422_420_conversion(struct resizer_params *param,
+					      int index, bool en)
 {
 	param->rsz_rsc_param[index].cen = en;
 	param->rsz_rsc_param[index].yen = en;
@@ -825,7 +824,7 @@ resizer_set_defualt_configuration(struct vpfe_resizer_device *resizer)
 				.o_hsz = WIDTH_O - 1,
 				.v_dif = 256,
 				.v_typ_y = VPFE_RSZ_INTP_CUBIC,
-				.h_typ_c = VPFE_RSZ_INTP_CUBIC,
+				.v_typ_c = VPFE_RSZ_INTP_CUBIC,
 				.h_dif = 256,
 				.h_typ_y = VPFE_RSZ_INTP_CUBIC,
 				.h_typ_c = VPFE_RSZ_INTP_CUBIC,
@@ -843,7 +842,7 @@ resizer_set_defualt_configuration(struct vpfe_resizer_device *resizer)
 				.o_hsz = WIDTH_O - 1,
 				.v_dif = 256,
 				.v_typ_y = VPFE_RSZ_INTP_CUBIC,
-				.h_typ_c = VPFE_RSZ_INTP_CUBIC,
+				.v_typ_c = VPFE_RSZ_INTP_CUBIC,
 				.h_dif = 256,
 				.h_typ_y = VPFE_RSZ_INTP_CUBIC,
 				.h_typ_c = VPFE_RSZ_INTP_CUBIC,
Signature · 1 line
2.9.0
Acked-by on v1 1/1
#1 lore raw

Hi Arnd,

Thank you for the patch, and sorry for the late reply.

Quoted 16 lines · On Monday 20 Jun 2016 17:47:56 Arnd Bergmann wrote:

When building with "make W=1", we get multiple harmless build warnings for the vpfe driver:

drivers/staging/media/davinci_vpfe/dm365_resizer.c:241:1: error: 'static' is not at beginning of declaration [-Werror=old-style-declaration] drivers/staging/media/davinci_vpfe/dm365_resizer.c: In function 'resizer_set_defualt_configuration':
drivers/staging/media/davinci_vpfe/dm365_resizer.c:831:16: error:
initialized field overwritten [-Werror=override-init] drivers/staging/media/davinci_vpfe/dm365_resizer.c:831:16: note: (near initialization for 'rsz_default_config.rsz_rsc_param[0].h_typ_c') drivers/staging/media/davinci_vpfe/dm365_resizer.c:849:16: error:
initialized field overwritten [-Werror=override-init] drivers/staging/media/davinci_vpfe/dm365_resizer.c:849:16: note: (near initialization for 'rsz_default_config.rsz_rsc_param[1].h_typ_c')

Quoted 6 lines

All of them are trivial to fix without changing the behavior of the driver, as "static const" is interpreted the same as "const static", and VPFE_RSZ_INTP_CUBIC is defined as zero, so the initializations are not really needed.

and applied to my tree. I will send a pull request for v4.11.

Quoted 40 lines
---
 drivers/staging/media/davinci_vpfe/dm365_resizer.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/drivers/staging/media/davinci_vpfe/dm365_resizer.c index 3cd56cc132c7..567f995fd0f9 100644

drivers/staging/media/davinci_vpfe/dm365_resizer.c +0 -0
@@ -237,9 +237,8 @@ resizer_calculate_resize_ratios(struct

vpfe_resizer_device *resizer, int index) ((informat->width) * 256) / (outformat->width);
}

drivers/staging/media/davinci_vpfe/dm365_resizer.c +4 -5
-void
-static resizer_enable_422_420_conversion(struct resizer_params *param,
-					 int index, bool en)
+static void resizer_enable_422_420_conversion(struct resizer_params *param,
+					      int index, bool en)
 {
 	param->rsz_rsc_param[index].cen = en;
 	param->rsz_rsc_param[index].yen = en;
@@ -825,7 +824,7 @@ resizer_set_defualt_configuration(struct
 vpfe_resizer_device *resizer) .o_hsz = WIDTH_O - 1,
 				.v_dif = 256,
 				.v_typ_y = VPFE_RSZ_INTP_CUBIC,
-				.h_typ_c = VPFE_RSZ_INTP_CUBIC,
+				.v_typ_c = VPFE_RSZ_INTP_CUBIC,
 				.h_dif = 256,
 				.h_typ_y = VPFE_RSZ_INTP_CUBIC,
 				.h_typ_c = VPFE_RSZ_INTP_CUBIC,
@@ -843,7 +842,7 @@ resizer_set_defualt_configuration(struct
 vpfe_resizer_device *resizer) .o_hsz = WIDTH_O - 1,
 				.v_dif = 256,
 				.v_typ_y = VPFE_RSZ_INTP_CUBIC,
-				.h_typ_c = VPFE_RSZ_INTP_CUBIC,
+				.v_typ_c = VPFE_RSZ_INTP_CUBIC,
 				.h_dif = 256,
 				.h_typ_y = VPFE_RSZ_INTP_CUBIC,
 				.h_typ_c = VPFE_RSZ_INTP_CUBIC,
Signature · 3 lines
Regards,

Laurent Pinchart