From patchwork Thu Apr 21 09:51:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 724331 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3LA3aim013387 for ; Thu, 21 Apr 2011 10:04:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752079Ab1DUJvx (ORCPT ); Thu, 21 Apr 2011 05:51:53 -0400 Received: from smtp204.alice.it ([82.57.200.100]:44511 "EHLO smtp204.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751858Ab1DUJvw (ORCPT ); Thu, 21 Apr 2011 05:51:52 -0400 Received: from jcn (87.3.13.82) by smtp204.alice.it (8.5.124.08) id 4D7E0F64034C1D77; Thu, 21 Apr 2011 11:51:50 +0200 Received: from ao2 by jcn with local (Exim 4.75) (envelope-from ) id 1QCqY9-0003Mh-Av; Thu, 21 Apr 2011 11:51:49 +0200 From: Antonio Ospite To: linux-media@vger.kernel.org Cc: Drew Fisher , Jean-Francois Moine , Mauro Carvalho Chehab , Antonio Ospite Subject: [PATCH 1/3] gspca - kinect: move communications buffers out of stack Date: Thu, 21 Apr 2011 11:51:34 +0200 Message-Id: <1303379496-12899-2-git-send-email-ospite@studenti.unina.it> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1303379496-12899-1-git-send-email-ospite@studenti.unina.it> References: <4DADF1CB.4050504@redhat.com> <1303379496-12899-1-git-send-email-ospite@studenti.unina.it> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 21 Apr 2011 10:04:08 +0000 (UTC) From: Drew Fisher 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 Signed-off-by: Drew Fisher Signed-off-by: Antonio Ospite --- drivers/media/video/gspca/kinect.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/video/gspca/kinect.c b/drivers/media/video/gspca/kinect.c index f85e746..79c4ef5 100644 --- a/drivers/media/video/gspca/kinect.c +++ b/drivers/media/video/gspca/kinect.c @@ -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 */ @@ -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;