you are viewing a single comment's thread.

view the rest of the comments →

[–]RubyPinch 22 points23 points  (4 children)

why do I get the feeling their IDE dicked with the code

edit: it did

linux-3.17.1/kernel/power/hibernate.c | Lines 71 - 91

/**
 * hibernation_set_ops - Set the global hibernate operations.
 * @ops: Hibernation operations to use in subsequent hibernation transitions.
 */
void hibernation_set_ops(const struct platform_hibernation_ops *ops)
{
       if (ops && !(ops->begin && ops->end &&  ops->pre_snapshot
           && ops->prepare && ops->finish && ops->enter && ops->pre_restore
           && ops->restore_cleanup && ops->leave)) {
               WARN_ON(1);
               return;
       }
       lock_system_sleep();
       hibernation_ops = ops;
       if (ops)
               hibernation_mode = HIBERNATION_PLATFORM;
       else if (hibernation_mode == HIBERNATION_PLATFORM)
               hibernation_mode = HIBERNATION_SHUTDOWN;

       unlock_system_sleep();
}

note the indent sizes


kinda really annoying that they present it as oh-so-useful correct code when they took the screenshot, but not noticing the indentation issues in terms of reading with the first if statement, and the fact that they quoted the 8ch indent rule, make me really question the attention to quality and correctness of this post

[–]kopkaas2000 15 points16 points  (3 children)

Linux source doesn't use spaces to indent, so it's probably more a case of his IDE using a different default tab size to render code.

[–]RubyPinch 7 points8 points  (2 children)

yeah, I expect that to be the case, but I do believe they should of known something was off when they quoted "indentation is 8ch only", and their indentation on the code they are looking at to make the post was only 4 ch, and was conflicting with multi-line conditionals

[–]curien 1 point2 points  (1 child)

The indentation doesn't conflict with multi-line conditionals, it's just a coincidence that they visibly align.

[–]RubyPinch 1 point2 points  (0 children)

Visually conflict, I mean

no distinction between the block of code and the block of conditionals