Skip to content

Commit

Permalink
[media] gspca - kinect: move communications buffers out of stack
Browse files Browse the repository at this point in the history
Move large communications buffers out of stack and into device
structure. This prevents the frame size from being >1kB and fixes a
compiler warning when CONFIG_FRAME_WARN=1024:

drivers/media/video/gspca/kinect.c: In function ‘send_cmd.clone.0’:
drivers/media/video/gspca/kinect.c:202: warning: the frame size of 1548 bytes is larger than 1024 bytes

Reported-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Drew Fisher authored and Mauro Carvalho Chehab committed May 20, 2011
1 parent aff8ab5 commit bb06646
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/media/video/gspca/kinect.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ struct sd {
struct gspca_dev gspca_dev; /* !! must be the first item */
uint16_t cam_tag; /* a sequence number for packets */
uint8_t stream_flag; /* to identify different steram types */
uint8_t obuf[0x400]; /* output buffer for control commands */
uint8_t ibuf[0x200]; /* input buffer for control commands */
};

/* V4L2 controls supported by the driver */
Expand Down Expand Up @@ -133,8 +135,8 @@ static int send_cmd(struct gspca_dev *gspca_dev, uint16_t cmd, void *cmdbuf,
struct sd *sd = (struct sd *) gspca_dev;
struct usb_device *udev = gspca_dev->dev;
int res, actual_len;
uint8_t obuf[0x400];
uint8_t ibuf[0x200];
uint8_t *obuf = sd->obuf;
uint8_t *ibuf = sd->ibuf;
struct cam_hdr *chdr = (void *)obuf;
struct cam_hdr *rhdr = (void *)ibuf;

Expand Down

0 comments on commit bb06646

Please sign in to comment.