tuxedocomputers / tuxedo-keyboard

This repository will no longer get any updates as the code here is now part of tuxedo-drivers https://gitlab.com/tuxedocomputers/development/packages/tuxedo-drivers.
https://gitlab.com/tuxedocomputers/development/packages/tuxedo-drivers
GNU General Public License v3.0
300 stars 92 forks source link

Error in keyboard : clevo_leds.h "Default could not be before LABEL" #185

Closed sleepingtux closed 1 year ago

sleepingtux commented 1 year ago

Hello, there is a bug to compile it with obs studio.

It seems that you could not put an export label behind "default":

So i just remove the default case in this fonctions and it compile now:

int clevo_leds_suspend(struct platform_device *dev) { switch (clevo_kb_backlight_type) { case CLEVO_KB_BACKLIGHT_TYPE_1_ZONE_RGB: case CLEVO_KB_BACKLIGHT_TYPE_3_ZONE_RGB: clevo_evaluate_set_keyboard_status(0); break; } return 0; } EXPORT_SYMBOL(clevo_leds_suspend);

int clevo_leds_resume(struct platform_device *dev) { switch (clevo_kb_backlight_type) { case CLEVO_KB_BACKLIGHT_TYPE_1_ZONE_RGB: case CLEVO_KB_BACKLIGHT_TYPE_3_ZONE_RGB: clevo_evaluate_set_keyboard_status(1); break; } return 0; } EXPORT_SYMBOL(clevo_leds_resume);

sleepingtux commented 1 year ago

To add more information, the build with out this modification on opensuse build server works for tumbleweed, but not for leap.

Here is the error: /home/abuild/rpmbuild/BUILD/tuxedo-keyboard-3.2.9/obj/default/./src/clevo_leds.h: In function 'clevo_leds_suspend': [ 28s] /home/abuild/rpmbuild/BUILD/tuxedo-keyboard-3.2.9/obj/default/./src/clevo_leds.h:420:2: error: label at end of compound statement [ 28s] default: [ 28s] ^~~ [ 28s] /home/abuild/rpmbuild/BUILD/tuxedo-keyboard-3.2.9/obj/default/./src/clevo_leds.h: In function 'clevo_leds_resume': [ 28s] /home/abuild/rpmbuild/BUILD/tuxedo-keyboard-3.2.9/obj/default/./src/clevo_leds.h:433:2: error: label at end of compound statement [ 28s] default: [ 28s] ^~~

munix9 commented 1 year ago

https://build.opensuse.org/package/view_file/home:munix9/tuxedo-keyboard/fix-label-at-end-of-compound-statement.patch?expand=1

--- a/src/clevo_leds.h
+++ b/src/clevo_leds.h
@@ -417,7 +417,7 @@ int clevo_leds_suspend(struct platform_d
        case CLEVO_KB_BACKLIGHT_TYPE_3_ZONE_RGB:
                clevo_evaluate_set_keyboard_status(0);
                break;
-       default:
+       default: break;
        }
        return 0;
 }
@@ -430,7 +430,7 @@ int clevo_leds_resume(struct platform_de
        case CLEVO_KB_BACKLIGHT_TYPE_3_ZONE_RGB:
                clevo_evaluate_set_keyboard_status(1);
                break;
-       default:
+       default: break;
        }
        return 0;
 }
sleepingtux commented 1 year ago

Hello. Yep works too. But should be corrected on the repo.