This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/media_tree.git tree:

Subject: [media] vivid: don't use more than 1024 bytes of stack
Author:  Mauro Carvalho Chehab <[email protected]>
Date:    Fri Jun 5 07:24:22 2015 -0300

Remove the following compilation warnings:

        drivers/media/platform/vivid/vivid-tpg.c: In function 'tpg_gen_text':
        drivers/media/platform/vivid/vivid-tpg.c:1562:1: warning: the frame 
size of 1308 bytes is larger than 1024 bytes [-Wframe-larger-than=]
         }
         ^

This seems to be due to some bad optimization done by gcc.

Moving the for() loop to happen inside the macro solves the
issue.

While here, fix CodingStyle at the switch().

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Acked-by: Hans Verkuil <[email protected]>

 drivers/media/platform/vivid/vivid-tpg.c |   33 +++++++++++++++--------------
 1 files changed, 17 insertions(+), 16 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=84cb7be43cec12868e94163c99fdc34c0297c3b8

diff --git a/drivers/media/platform/vivid/vivid-tpg.c 
b/drivers/media/platform/vivid/vivid-tpg.c
index b1147f2..7a3ed58 100644
--- a/drivers/media/platform/vivid/vivid-tpg.c
+++ b/drivers/media/platform/vivid/vivid-tpg.c
@@ -1492,12 +1492,10 @@ void tpg_gen_text(const struct tpg_data *tpg, u8 
*basep[TPG_MAX_PLANES][2],
        else if (tpg->field == V4L2_FIELD_SEQ_TB || tpg->field == 
V4L2_FIELD_SEQ_BT)
                div = 2;
 
-       for (p = 0; p < tpg->planes; p++) {
-               unsigned vdiv = tpg->vdownsampling[p];
-               unsigned hdiv = tpg->hdownsampling[p];
-
-               /* Print text */
-#define PRINTSTR(PIXTYPE) do { \
+       /* Print text */
+#define PRINTSTR(PIXTYPE) for (p = 0; p < tpg->planes; p++) {  \
+       unsigned vdiv = tpg->vdownsampling[p];  \
+       unsigned hdiv = tpg->hdownsampling[p];  \
        PIXTYPE fg;     \
        PIXTYPE bg;     \
        memcpy(&fg, tpg->textfg[p], sizeof(PIXTYPE));   \
@@ -1548,16 +1546,19 @@ void tpg_gen_text(const struct tpg_data *tpg, u8 
*basep[TPG_MAX_PLANES][2],
        }       \
 } while (0)
 
-               switch (tpg->twopixelsize[p]) {
-               case 2:
-                       PRINTSTR(u8); break;
-               case 4:
-                       PRINTSTR(u16); break;
-               case 6:
-                       PRINTSTR(x24); break;
-               case 8:
-                       PRINTSTR(u32); break;
-               }
+       switch (tpg->twopixelsize[p]) {
+       case 2:
+               PRINTSTR(u8);
+               break;
+       case 4:
+               PRINTSTR(u16);
+               break;
+       case 6:
+               PRINTSTR(x24);
+               break;
+       case 8:
+               PRINTSTR(u32);
+               break;
        }
 }
 

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to