diff for duplicates of <4CA76BAA.7020507@metafoo.de> diff --git a/a/1.txt b/N1/1.txt index 2c34cdb..fdc395c 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -34,16 +34,16 @@ Janusz Krzysztofik wrote: > > switch (event) { > case FB_EVENT_BLANK : -> - if (*blank && n->old_status = UNBLANK) { -> + if ((!n->invert && *blank && n->old_status = UNBLANK) || -> + (n->invert && !*blank && n->old_status = BLANK)) { +> - if (*blank && n->old_status == UNBLANK) { +> + if ((!n->invert && *blank && n->old_status == UNBLANK) || +> + (n->invert && !*blank && n->old_status == BLANK)) { > n->brightness = led->brightness; > led_set_brightness(led, LED_OFF); > - n->old_status = BLANK; -> - } else if (!*blank && n->old_status = BLANK) { +> - } else if (!*blank && n->old_status == BLANK) { > + n->old_status = n->invert ? UNBLANK : BLANK; -> + } else if ((!n->invert && !*blank && n->old_status = BLANK) || -> + (n->invert && *blank && n->old_status = UNBLANK)) { +> + } else if ((!n->invert && !*blank && n->old_status == BLANK) || +> + (n->invert && *blank && n->old_status == UNBLANK)) { > led_set_brightness(led, n->brightness); > - n->old_status = UNBLANK; > + n->old_status = n->invert ? BLANK : UNBLANK; @@ -56,7 +56,7 @@ How about some like: unsigned new_status = *blank ? BLANK : UNBLANK; if (new_status != n->old_status) { - if ((new_status ^ n->invert) = BLANK) { + if ((new_status ^ n->invert) == BLANK) { n->brightness = led->brightness; led_set_brightness(led, LED_OFF); } else { @@ -99,11 +99,11 @@ In my opinion that would be more readable. > + n->invert = !!invert; > + > + /* After inverting, we need to update the LED. */ -> + if ((!n->invert && n->old_status = UNBLANK) || -> + (n->invert && n->old_status = BLANK)) +> + if ((!n->invert && n->old_status == UNBLANK) || +> + (n->invert && n->old_status == BLANK)) > + led_set_brightness(led, n->brightness); -> + else if ((!n->invert && n->old_status = BLANK) || -> + (n->invert && n->old_status = UNBLANK)) +> + else if ((!n->invert && n->old_status == BLANK) || +> + (n->invert && n->old_status == UNBLANK)) > + led_set_brightness(led, LED_OFF); > + > + return num; @@ -111,7 +111,7 @@ In my opinion that would be more readable. Same here: -if ((n->old_status ^ n->invert) = BLANK) +if ((n->old_status ^ n->invert) == BLANK) led_set_brightness(led, LED_OFF); else led_set_brightness(led, n->brightness); diff --git a/a/content_digest b/N1/content_digest index d3f8dbc..05c96ec 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,7 +1,7 @@ "ref\0201009301404.18985.jkrzyszt@tis.icnet.pl\0" "From\0Lars-Peter Clausen <lars@metafoo.de>\0" - "Subject\0Re: [RESEND #2][PATCH] LEDS: Add output invertion option to backlight\0" - "Date\0Sat, 02 Oct 2010 17:28:10 +0000\0" + "Subject\0Re: [RESEND #2][PATCH] LEDS: Add output invertion option to backlight trigger\0" + "Date\0Sat, 02 Oct 2010 19:28:10 +0200\0" "To\0Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>\0" "Cc\0Richard Purdie <rpurdie@rpsys.net>" linux-fbdev@vger.kernel.org <linux-fbdev@vger.kernel.org> @@ -45,16 +45,16 @@ "> \n" "> \tswitch (event) {\n" "> \tcase FB_EVENT_BLANK :\n" - "> -\t\tif (*blank && n->old_status = UNBLANK) {\n" - "> +\t\tif ((!n->invert && *blank && n->old_status = UNBLANK) ||\n" - "> +\t\t\t (n->invert && !*blank && n->old_status = BLANK)) {\n" + "> -\t\tif (*blank && n->old_status == UNBLANK) {\n" + "> +\t\tif ((!n->invert && *blank && n->old_status == UNBLANK) ||\n" + "> +\t\t\t (n->invert && !*blank && n->old_status == BLANK)) {\n" "> \t\t\tn->brightness = led->brightness;\n" "> \t\t\tled_set_brightness(led, LED_OFF);\n" "> -\t\t\tn->old_status = BLANK;\n" - "> -\t\t} else if (!*blank && n->old_status = BLANK) {\n" + "> -\t\t} else if (!*blank && n->old_status == BLANK) {\n" "> +\t\t\tn->old_status = n->invert ? UNBLANK : BLANK;\n" - "> +\t\t} else if ((!n->invert && !*blank && n->old_status = BLANK) ||\n" - "> +\t\t\t (n->invert && *blank && n->old_status = UNBLANK)) {\n" + "> +\t\t} else if ((!n->invert && !*blank && n->old_status == BLANK) ||\n" + "> +\t\t\t (n->invert && *blank && n->old_status == UNBLANK)) {\n" "> \t\t\tled_set_brightness(led, n->brightness);\n" "> -\t\t\tn->old_status = UNBLANK;\n" "> +\t\t\tn->old_status = n->invert ? BLANK : UNBLANK;\n" @@ -67,7 +67,7 @@ "unsigned new_status = *blank ? BLANK : UNBLANK;\n" "\n" "if (new_status != n->old_status) {\n" - "\tif ((new_status ^ n->invert) = BLANK) {\n" + "\tif ((new_status ^ n->invert) == BLANK) {\n" "\t\tn->brightness = led->brightness;\n" "\t\tled_set_brightness(led, LED_OFF);\n" "\t} else {\n" @@ -110,11 +110,11 @@ "> +\tn->invert = !!invert;\n" "> +\n" "> +\t/* After inverting, we need to update the LED. */\n" - "> +\tif ((!n->invert && n->old_status = UNBLANK) ||\n" - "> +\t\t\t(n->invert && n->old_status = BLANK))\n" + "> +\tif ((!n->invert && n->old_status == UNBLANK) ||\n" + "> +\t\t\t(n->invert && n->old_status == BLANK))\n" "> +\t\tled_set_brightness(led, n->brightness);\n" - "> +\telse if ((!n->invert && n->old_status = BLANK) ||\n" - "> +\t\t\t(n->invert && n->old_status = UNBLANK))\n" + "> +\telse if ((!n->invert && n->old_status == BLANK) ||\n" + "> +\t\t\t(n->invert && n->old_status == UNBLANK))\n" "> +\t\tled_set_brightness(led, LED_OFF);\n" "> +\n" "> +\treturn num;\n" @@ -122,7 +122,7 @@ "\n" "Same here:\n" "\n" - "if ((n->old_status ^ n->invert) = BLANK)\n" + "if ((n->old_status ^ n->invert) == BLANK)\n" "\tled_set_brightness(led, LED_OFF);\n" "else\n" "\tled_set_brightness(led, n->brightness);\n" @@ -170,4 +170,4 @@ "> More majordomo info at http://vger.kernel.org/majordomo-info.html\n" > Please read the FAQ at http://www.tux.org/lkml/ -bce3bcd266e620771995f86a537e0d0b5f28536a9d676570bebc459adb4ef70e +4b9189f3cff0c501d43fc217cacd5f1605d75f2f8bfc0758ed9e3237aa87cb04
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.