All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] amixer no-range-checking option
@ 2005-02-03 20:20 Giuliano Pochini
  2005-02-04 15:35 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Giuliano Pochini @ 2005-02-03 20:20 UTC (permalink / raw)
  To: Alsa-devel



This patch adds the --nocheck option that disables range checking. It helps
debugging drivers.


Signed-off-by: Giuliano Pochini <pochini@shiny.it>

--- alsa-utils/amixer/amixer.c_old	Thu Feb  3 19:39:35 2005
+++ alsa-utils/amixer/amixer.c	Thu Feb  3 21:08:06 2005
@@ -38,6 +38,7 @@
 #define HELPID_INACTIVE		1004
 #define HELPID_DEBUG            1005
 #define HELPID_VERSION		1006
+#define HELPID_NOCHECK		1007
 
 #define LEVEL_BASIC		(1<<0)
 #define LEVEL_INACTIVE		(1<<1)
@@ -45,6 +46,7 @@
 
 int quiet = 0;
 int debugflag = 0;
+int no_check = 0;
 char card[64] = "default";
 
 static void error(const char *fmt,...)
@@ -66,6 +68,7 @@
 	printf("  -c,--card N     select the card\n");
 	printf("  -D,--device N   select the device, default '%s'\n", card);
 	printf("  -d,--debug      debug mode\n");
+	printf("  -n,--nocheck    do not perform range checking\n");
 	printf("  -v,--version    print version of this program\n");
 	printf("  -q,--quiet      be quiet\n");
 	printf("  -i,--inactive   show also inactive controls\n");
@@ -161,6 +164,8 @@
 
 static int check_range(int val, int min, int max)
 {
+	if (no_check)
+		return val;
 	if (val < min)
 		return min;
 	if (val > max)
@@ -1456,6 +1461,7 @@
 		{"quiet", 0, NULL, HELPID_QUIET},
 		{"inactive", 0, NULL, HELPID_INACTIVE},
 		{"debug", 0, NULL, HELPID_DEBUG},
+		{"nocheck", 0, NULL, HELPID_NOCHECK},
 		{"version", 0, NULL, HELPID_VERSION},
 		{NULL, 0, NULL, 0},
 	};
@@ -1464,7 +1470,7 @@
 	while (1) {
 		int c;
 
-		if ((c = getopt_long(argc, argv, "hc:D:qidv", long_option, NULL)) < 0)
+		if ((c = getopt_long(argc, argv, "hc:D:qidnv", long_option, NULL)) < 0)
 			break;
 		switch (c) {
 		case 'h':
@@ -1501,6 +1507,10 @@
 		case HELPID_DEBUG:
 			debugflag = 1;
 			break;
+		case 'n':
+		case HELPID_NOCHECK:
+			no_check = 1;
+			break;
 		case 'v':
 		case HELPID_VERSION:
 			printf("amixer version " SND_UTIL_VERSION_STR "\n");


--
Giuliano.


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] amixer no-range-checking option
  2005-02-03 20:20 [PATCH] amixer no-range-checking option Giuliano Pochini
@ 2005-02-04 15:35 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2005-02-04 15:35 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: Alsa-devel

At Thu, 3 Feb 2005 21:20:33 +0100,
Giuliano Pochini wrote:
> 
> 
> 
> This patch adds the --nocheck option that disables range checking. It helps
> debugging drivers.
> 
> 
> Signed-off-by: Giuliano Pochini <pochini@shiny.it>


Applied to CVS.  Thanks.


Takashi


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-02-04 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-03 20:20 [PATCH] amixer no-range-checking option Giuliano Pochini
2005-02-04 15:35 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.