-----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160
Hi,
I changed a function in sandbox.c to not use a goto statement. I didn't understood what use it had. Attached the patch file.
I did the usual tests and didn't found any error at first and second glance. Please consider to test it yourself and if fit include it into production.
best regards Hartmut
PS: I try to remove some more gotos, if this patch is ok.
- -- Ideas are the only things that can change the world. The rest is details. -- Scott Adams
https://netzpolitik.org/2013/anleitung-so-verschlusselt-ihr-eure-e-mails-mit... new Key ID since 26.07.13: 0xD8C361E6 Fingerprint: E5B3 302B 1BE1 D0B4 F190 E739 A365 60A9 D8C3 61E6
Hartmut Prochaska:
I changed a function in sandbox.c to not use a goto statement. I didn't understood what use it had. Attached the patch file.
See https://www.kernel.org/doc/Documentation/CodingStyle, Chapter 7, “Centralized exiting of functions” for a rationale.
-----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160
Hi,
See https://www.kernel.org/doc/Documentation/CodingStyle, Chapter 7, “Centralized exiting of functions” for a rationale.
I saw some functions where the idea above seems fitting. But there had also been some code parts, like this from the sandbox, where it didn't made any sense to me.
Like in the lines 1012, 1055, 1098 and 1138 of sandbox.c where we could just also use a break statement to leave the while loops.
For the lines 1273, 1278, 1284, 1290 and 1296 of sandbox.c I could understand the use of goto, although it would also work with "else if" very well.
It had been just an idea to improve the code base, although only from my point of view as it seems :)
Then I just keep reading the source code to understand it and somtimes also contribute to it, I hope.
bye Hartmut
- -- Ideas are the only things that can change the world. The rest is details. -- Scott Adams
https://netzpolitik.org/2013/anleitung-so-verschlusselt-ihr-eure-e-mails-mit... new Key ID since 26.07.13: 0xD8C361E6 Fingerprint: E5B3 302B 1BE1 D0B4 F190 E739 A365 60A9 D8C3 61E6