From patchwork Sat Oct 3 07:35:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOpbWV0aCBNw6FydG9u?= X-Patchwork-Id: 1796 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Sat, 03 Oct 2009 07:36:15 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra.chehab.org with IMAP (fetchmail-6.3.6) for (single-drop); Sat, 03 Oct 2009 18:17:13 -0300 (BRT) Received: from vger.kernel.org ([209.132.176.167]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1MtzA7-0008UL-0O; Sat, 03 Oct 2009 07:36:15 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753713AbZJCHft (ORCPT + 1 other); Sat, 3 Oct 2009 03:35:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753957AbZJCHfr (ORCPT ); Sat, 3 Oct 2009 03:35:47 -0400 Received: from mail00a.mail.t-online.hu ([84.2.40.5]:54227 "EHLO mail00a.mail.t-online.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753713AbZJCHfl (ORCPT ); Sat, 3 Oct 2009 03:35:41 -0400 Received: from [192.168.1.64] (dsl54029FEE.pool.t-online.hu [84.2.159.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail00a.mail.t-online.hu (Postfix) with ESMTPSA id 8DF952AF4DD; Sat, 3 Oct 2009 09:32:13 +0200 (CEST) Message-ID: <4AC6FECF.7050906@freemail.hu> Date: Sat, 03 Oct 2009 09:35:43 +0200 From: =?UTF-8?B?TsOpbWV0aCBNw6FydG9u?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; hu-HU; rv:1.8.1.21) Gecko/20090402 SeaMonkey/1.1.16 MIME-Version: 1.0 To: Jean-Francois Moine , Thomas Kaiser CC: V4L Mailing List , LKML Subject: [PATCH 2/3] pac7311: remove magic values for END_OF_SEQUENCE and LOAD_PAGE{3,4} X-DCC-mail.t-online.hu-Metrics: mail00a.mail.t-online.hu 32710; Body=4 Fuz1=4 Fuz2=4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Márton Németh Change the magic values 0, 254 and 255 to END_OF_SEQUENCE, LOAD_PAGE4 and LOAD_PAGE3 respectively for better source code readability. The change was tested with Labtec Webcam 2200. Signed-off-by: Márton Németh --- -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -upr b/drivers/media/video/gspca/pac7311.c c/drivers/media/video/gspca/pac7311.c --- b/drivers/media/video/gspca/pac7311.c 2009-10-03 08:27:36.000000000 +0200 +++ c/drivers/media/video/gspca/pac7311.c 2009-10-03 08:47:30.000000000 +0200 @@ -244,6 +244,10 @@ static const struct v4l2_pix_format vga_ .priv = 0}, }; +#define LOAD_PAGE3 255 +#define LOAD_PAGE4 254 +#define END_OF_SEQUENCE 0 + /* pac 7302 */ static const __u8 init_7302[] = { /* index,value */ @@ -302,7 +306,7 @@ static const __u8 start_7302[] = { 0xff, 1, 0x02, /* page 2 */ 0x22, 1, 0x00, 0xff, 1, 0x03, /* page 3 */ - 0x00, 255, /* load the page 3 */ + 0, LOAD_PAGE3, /* load the page 3 */ 0x11, 1, 0x01, 0xff, 1, 0x02, /* page 2 */ 0x13, 1, 0x00, @@ -313,7 +317,7 @@ static const __u8 start_7302[] = { 0x6e, 1, 0x08, 0xff, 1, 0x01, /* page 1 */ 0x78, 1, 0x00, - 0, 0 /* end of sequence */ + 0, END_OF_SEQUENCE /* end of sequence */ }; #define SKIP 0xaa @@ -379,9 +383,9 @@ static const __u8 start_7311[] = { 0xf0, 13, 0x01, 0x00, 0x00, 0x00, 0x22, 0x00, 0x20, 0x00, 0x3f, 0x00, 0x0a, 0x01, 0x00, 0xff, 1, 0x04, /* page 4 */ - 0x00, 254, /* load the page 4 */ + 0, LOAD_PAGE4, /* load the page 4 */ 0x11, 1, 0x01, - 0, 0 /* end of sequence */ + 0, END_OF_SEQUENCE /* end of sequence */ }; /* page 4 - the value SKIP says skip the index - see reg_w_page() */ @@ -461,12 +465,12 @@ static void reg_w_var(struct gspca_dev * index = *seq++; len = *seq++; switch (len) { - case 0: + case END_OF_SEQUENCE: return; - case 254: + case LOAD_PAGE4: reg_w_page(gspca_dev, page4_7311, sizeof page4_7311); break; - case 255: + case LOAD_PAGE3: reg_w_page(gspca_dev, page3_7302, sizeof page3_7302); break; default: