Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
On Thu, 22 Sep 2016 10:49:47 -0700, Joe Perches wrote: > On Thu, 2016-09-22 at 13:57 +0200, Jean Delvare wrote: > > Sure. But I'm afraid you keep changing topics and I have no idea where > > you are going. We started with "should there be a space before jump > > labels", then out of nowhere we were discussing the wording of the > > output of checkpatch (how is that related?) and now you pull statistics > > out of your hat, like these numbers imply anything. > > No, not out of a hat. Those are the results of a silly script that > runs checkpatch on every .[ch] kernel file (but not tools/) with: > > --show-types --terse --emacs --strict --no-summary --quiet -f Silly is the key word here. Just don't do it. > The magnitude of "ERRORS" is high and it's not necessary or useful > to modify old or obsolete code just to reduce that magnitude. I agree. Just don't do it. > > checkpatch was called checkPATCH for a reason. > > That's why I promote the --force option to limit using checkpatch on > files outside of staging. > > https://patchwork.kernel.org/patch/9332205/ > > Andrew? Are you going to apply that one day? I hope not. Looks plain wrong to me. This wont prevents idiots from being idiots. All it does is make things more difficult for the rest of us. > > ERROR means that the new code isn't allowed to do that. Period. > > Disagree. The compiler doesn't care. Which is good, because this has nothing to do with the compiler. > The value of consistency in reducing defects is very hard to quantify. That's not the only purpose of consistency. -- Jean Delvare SUSE L3 Support
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
On Thu, 22 Sep 2016 10:49:47 -0700, Joe Perches wrote: > On Thu, 2016-09-22 at 13:57 +0200, Jean Delvare wrote: > > Sure. But I'm afraid you keep changing topics and I have no idea where > > you are going. We started with "should there be a space before jump > > labels", then out of nowhere we were discussing the wording of the > > output of checkpatch (how is that related?) and now you pull statistics > > out of your hat, like these numbers imply anything. > > No, not out of a hat. Those are the results of a silly script that > runs checkpatch on every .[ch] kernel file (but not tools/) with: > > --show-types --terse --emacs --strict --no-summary --quiet -f Silly is the key word here. Just don't do it. > The magnitude of "ERRORS" is high and it's not necessary or useful > to modify old or obsolete code just to reduce that magnitude. I agree. Just don't do it. > > checkpatch was called checkPATCH for a reason. > > That's why I promote the --force option to limit using checkpatch on > files outside of staging. > > https://patchwork.kernel.org/patch/9332205/ > > Andrew? Are you going to apply that one day? I hope not. Looks plain wrong to me. This wont prevents idiots from being idiots. All it does is make things more difficult for the rest of us. > > ERROR means that the new code isn't allowed to do that. Period. > > Disagree. The compiler doesn't care. Which is good, because this has nothing to do with the compiler. > The value of consistency in reducing defects is very hard to quantify. That's not the only purpose of consistency. -- Jean Delvare SUSE L3 Support
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
On Thu, 2016-09-22 at 13:57 +0200, Jean Delvare wrote: > Sure. But I'm afraid you keep changing topics and I have no idea where > you are going. We started with "should there be a space before jump > labels", then out of nowhere we were discussing the wording of the > output of checkpatch (how is that related?) and now you pull statistics > out of your hat, like these numbers imply anything. No, not out of a hat. Those are the results of a silly script that runs checkpatch on every .[ch] kernel file (but not tools/) with: --show-types --terse --emacs --strict --no-summary --quiet -f The magnitude of "ERRORS" is high and it's not necessary or useful to modify old or obsolete code just to reduce that magnitude. > checkpatch was called checkPATCH for a reason. That's why I promote the --force option to limit using checkpatch on files outside of staging. https://patchwork.kernel.org/patch/9332205/ Andrew? Are you going to apply that one day? > ERROR means that the new code isn't allowed to do that. Period. Disagree. The compiler doesn't care. The value of consistency in reducing defects is very hard to quantify.
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
On Thu, 2016-09-22 at 13:57 +0200, Jean Delvare wrote: > Sure. But I'm afraid you keep changing topics and I have no idea where > you are going. We started with "should there be a space before jump > labels", then out of nowhere we were discussing the wording of the > output of checkpatch (how is that related?) and now you pull statistics > out of your hat, like these numbers imply anything. No, not out of a hat. Those are the results of a silly script that runs checkpatch on every .[ch] kernel file (but not tools/) with: --show-types --terse --emacs --strict --no-summary --quiet -f The magnitude of "ERRORS" is high and it's not necessary or useful to modify old or obsolete code just to reduce that magnitude. > checkpatch was called checkPATCH for a reason. That's why I promote the --force option to limit using checkpatch on files outside of staging. https://patchwork.kernel.org/patch/9332205/ Andrew? Are you going to apply that one day? > ERROR means that the new code isn't allowed to do that. Period. Disagree. The compiler doesn't care. The value of consistency in reducing defects is very hard to quantify.
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
On Thu, 2016-09-22 at 14:11 +0100, Al Viro wrote: > The main intent of checkpatch these days appears to be providing an easy > way of thoughtless inflation of commit counts, everything else be damned. You've made this statement several times over many years. I don't believe it's true. I doubt anyone is getting paid per commit. Who really cares enough to game some stupid little metric? If it's really a big deal, name some names. Otherwise please stop with this dubious argument/point. > Some of these checks are common-sense, some are > absolutely arbitrary, Essentially all of the checkpatch rules are arbitrary. The compiler doesn't care one way or another. All the checks exist just to make code appear more consistent. The conceit being that more consistent code is easier for humans to read and spot potential defects and possible reuse patterns.
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
On Thu, 2016-09-22 at 14:11 +0100, Al Viro wrote: > The main intent of checkpatch these days appears to be providing an easy > way of thoughtless inflation of commit counts, everything else be damned. You've made this statement several times over many years. I don't believe it's true. I doubt anyone is getting paid per commit. Who really cares enough to game some stupid little metric? If it's really a big deal, name some names. Otherwise please stop with this dubious argument/point. > Some of these checks are common-sense, some are > absolutely arbitrary, Essentially all of the checkpatch rules are arbitrary. The compiler doesn't care one way or another. All the checks exist just to make code appear more consistent. The conceit being that more consistent code is easier for humans to read and spot potential defects and possible reuse patterns.
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
> > The main intent of checkpatch these days appears to be providing an easy > > way of thoughtless inflation of commit counts, everything else be damned. > > Make-work, in other words. > > Yes, I've noticed the trend too :-( But that's a problem with the > people using the tool, mostly, not with the tool itself. With respect to at least one person in this category, I don't think that their main original inspiration was checkpatch in the first place. More random information collected from developer comments, that person's own notion of what good code is, etc. So there may be limits to what one can do to checkpatch that will have an impact on this issue. Furthermore, probably people who use checkpatch in the right way, ie to check their patches, don't actually mention their use of checkpatch. They just fix up their commits and move on. julia
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
> > The main intent of checkpatch these days appears to be providing an easy > > way of thoughtless inflation of commit counts, everything else be damned. > > Make-work, in other words. > > Yes, I've noticed the trend too :-( But that's a problem with the > people using the tool, mostly, not with the tool itself. With respect to at least one person in this category, I don't think that their main original inspiration was checkpatch in the first place. More random information collected from developer comments, that person's own notion of what good code is, etc. So there may be limits to what one can do to checkpatch that will have an impact on this issue. Furthermore, probably people who use checkpatch in the right way, ie to check their patches, don't actually mention their use of checkpatch. They just fix up their commits and move on. julia
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
On Thu, 22 Sep 2016 14:11:03 +0100, Al Viro wrote: > On Thu, Sep 22, 2016 at 01:57:58PM +0200, Jean Delvare wrote: > > > > > > MUST is much stronger language than I would prefer. > > > > That's what error means, really. When your compiler fails with an > > error, you have no choice but to fix your code. Warnings on the other > > hand may be ignored sometimes. > > And they are errors, because of...? Because we decided they were important. Of course there is some subjectivity to this decision, much like all gcc warnings could be errors and some errors could be warnings. Which is why gcc allows enabling/disabling individually. I assume the current set of errors vs. warnings is the result of some consensus amongst kernel developers. It can certainly be adjusted if the consensus changes for whatever reason. > > Sure. But I'm afraid you keep changing topics and I have no idea where > > you are going. We started with "should there be a space before jump > > labels", then out of nowhere we were discussing the wording of the > > output of checkpatch (how is that related?) and now you pull statistics > > out of your hat, like these numbers imply anything. > > > > checkpatch was called checkPATCH for a reason. It's main intent was to > > prevent NEW (coding-style mostly) errors from creeping into the kernel. > > The fact that old code does now always follow these recommendations is > > unfortunate but that doesn't make checkpatch wrong or bad. > > > > ERROR means that the new code isn't allowed to do that. Period. > > The main intent of checkpatch these days appears to be providing an easy > way of thoughtless inflation of commit counts, everything else be damned. > Make-work, in other words. Yes, I've noticed the trend too :-( But that's a problem with the people using the tool, mostly, not with the tool itself. > The _only_ criterion for adding new checks should be a strong consensus in > the core kernel. IOW, it should be descriptive, not prescriptive. "Some > people do it this way, some - that" is not a valid reason for "let's make it > uniform; that way is just better, so from now on it's a new requirement". > Especially when the rationale behind the choice has all the intellectual > rigour of feng shui. Some of these checks are common-sense, some are > absolutely arbitrary, there are far too many of them (...) That I agree with, I've complained about the same before. But that doesn't mean checkpatch is not a wonderfully useful tool. It really is, if used properly. > and elevating them > to the level of compiler errors like you seem to do is rather dishonest. I see. Well clearly this discussion isn't going anywhere so I'll go back working on things that really matter. See you. -- Jean Delvare SUSE L3 Support
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
On Thu, 22 Sep 2016 14:11:03 +0100, Al Viro wrote: > On Thu, Sep 22, 2016 at 01:57:58PM +0200, Jean Delvare wrote: > > > > > > MUST is much stronger language than I would prefer. > > > > That's what error means, really. When your compiler fails with an > > error, you have no choice but to fix your code. Warnings on the other > > hand may be ignored sometimes. > > And they are errors, because of...? Because we decided they were important. Of course there is some subjectivity to this decision, much like all gcc warnings could be errors and some errors could be warnings. Which is why gcc allows enabling/disabling individually. I assume the current set of errors vs. warnings is the result of some consensus amongst kernel developers. It can certainly be adjusted if the consensus changes for whatever reason. > > Sure. But I'm afraid you keep changing topics and I have no idea where > > you are going. We started with "should there be a space before jump > > labels", then out of nowhere we were discussing the wording of the > > output of checkpatch (how is that related?) and now you pull statistics > > out of your hat, like these numbers imply anything. > > > > checkpatch was called checkPATCH for a reason. It's main intent was to > > prevent NEW (coding-style mostly) errors from creeping into the kernel. > > The fact that old code does now always follow these recommendations is > > unfortunate but that doesn't make checkpatch wrong or bad. > > > > ERROR means that the new code isn't allowed to do that. Period. > > The main intent of checkpatch these days appears to be providing an easy > way of thoughtless inflation of commit counts, everything else be damned. > Make-work, in other words. Yes, I've noticed the trend too :-( But that's a problem with the people using the tool, mostly, not with the tool itself. > The _only_ criterion for adding new checks should be a strong consensus in > the core kernel. IOW, it should be descriptive, not prescriptive. "Some > people do it this way, some - that" is not a valid reason for "let's make it > uniform; that way is just better, so from now on it's a new requirement". > Especially when the rationale behind the choice has all the intellectual > rigour of feng shui. Some of these checks are common-sense, some are > absolutely arbitrary, there are far too many of them (...) That I agree with, I've complained about the same before. But that doesn't mean checkpatch is not a wonderfully useful tool. It really is, if used properly. > and elevating them > to the level of compiler errors like you seem to do is rather dishonest. I see. Well clearly this discussion isn't going anywhere so I'll go back working on things that really matter. See you. -- Jean Delvare SUSE L3 Support
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
On Thu, Sep 22, 2016 at 01:57:58PM +0200, Jean Delvare wrote: > > > > MUST is much stronger language than I would prefer. > > That's what error means, really. When your compiler fails with an > error, you have no choice but to fix your code. Warnings on the other > hand may be ignored sometimes. And they are errors, because of...? > Sure. But I'm afraid you keep changing topics and I have no idea where > you are going. We started with "should there be a space before jump > labels", then out of nowhere we were discussing the wording of the > output of checkpatch (how is that related?) and now you pull statistics > out of your hat, like these numbers imply anything. > > checkpatch was called checkPATCH for a reason. It's main intent was to > prevent NEW (coding-style mostly) errors from creeping into the kernel. > The fact that old code does now always follow these recommendations is > unfortunate but that doesn't make checkpatch wrong or bad. > > ERROR means that the new code isn't allowed to do that. Period. The main intent of checkpatch these days appears to be providing an easy way of thoughtless inflation of commit counts, everything else be damned. Make-work, in other words. The _only_ criterion for adding new checks should be a strong consensus in the core kernel. IOW, it should be descriptive, not prescriptive. "Some people do it this way, some - that" is not a valid reason for "let's make it uniform; that way is just better, so from now on it's a new requirement". Especially when the rationale behind the choice has all the intellectual rigour of feng shui. Some of these checks are common-sense, some are absolutely arbitrary, there are far too many of them and elevating them to the level of compiler errors like you seem to do is rather dishonest.
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
On Thu, Sep 22, 2016 at 01:57:58PM +0200, Jean Delvare wrote: > > > > MUST is much stronger language than I would prefer. > > That's what error means, really. When your compiler fails with an > error, you have no choice but to fix your code. Warnings on the other > hand may be ignored sometimes. And they are errors, because of...? > Sure. But I'm afraid you keep changing topics and I have no idea where > you are going. We started with "should there be a space before jump > labels", then out of nowhere we were discussing the wording of the > output of checkpatch (how is that related?) and now you pull statistics > out of your hat, like these numbers imply anything. > > checkpatch was called checkPATCH for a reason. It's main intent was to > prevent NEW (coding-style mostly) errors from creeping into the kernel. > The fact that old code does now always follow these recommendations is > unfortunate but that doesn't make checkpatch wrong or bad. > > ERROR means that the new code isn't allowed to do that. Period. The main intent of checkpatch these days appears to be providing an easy way of thoughtless inflation of commit counts, everything else be damned. Make-work, in other words. The _only_ criterion for adding new checks should be a strong consensus in the core kernel. IOW, it should be descriptive, not prescriptive. "Some people do it this way, some - that" is not a valid reason for "let's make it uniform; that way is just better, so from now on it's a new requirement". Especially when the rationale behind the choice has all the intellectual rigour of feng shui. Some of these checks are common-sense, some are absolutely arbitrary, there are far too many of them and elevating them to the level of compiler errors like you seem to do is rather dishonest.
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
On Thu, 22 Sep 2016, Jean Delvarewrote: > Hi Jani, > > On Thu, 22 Sep 2016 13:43:42 +0300, Jani Nikula wrote: >> >> You could make checkpatch have different defaults for patches and files, >> to encourage better style in new code, but to discourage finding >> problems in existing code. > > Fixing old code isn't wrong per se. It's good actually. But only if > done the right way by the right person. I don't think it makes any > sense to use this task as an introduction to kernel development for > newcomers. It doesn't teach them anything about the kernel, really. Mostly agreed, though I'd go as far as saying certain classes of (checkpatch) issues aren't worth fixing, at all, by anyone, except perhaps while changing the code anyway for some other purpose. BR, Jani. -- Jani Nikula, Intel Open Source Technology Center
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
On Thu, 22 Sep 2016, Jean Delvare wrote: > Hi Jani, > > On Thu, 22 Sep 2016 13:43:42 +0300, Jani Nikula wrote: >> >> You could make checkpatch have different defaults for patches and files, >> to encourage better style in new code, but to discourage finding >> problems in existing code. > > Fixing old code isn't wrong per se. It's good actually. But only if > done the right way by the right person. I don't think it makes any > sense to use this task as an introduction to kernel development for > newcomers. It doesn't teach them anything about the kernel, really. Mostly agreed, though I'd go as far as saying certain classes of (checkpatch) issues aren't worth fixing, at all, by anyone, except perhaps while changing the code anyway for some other purpose. BR, Jani. -- Jani Nikula, Intel Open Source Technology Center
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
Hi Jani, On Thu, 22 Sep 2016 13:43:42 +0300, Jani Nikula wrote: > On Thu, 22 Sep 2016, Jean Delvarewrote: > > You need to think in terms of actual use cases. Who uses checkpatch and > > why? I think there are 3 groups of users: > > * Beginners. They won't run the script by themselves, instead they will > > submit a patch which infringes a lot of coding style rules, and the > > maintainer will point them to checkpatch and ask for a resubmission > > which makes checkpatch happy. Being beginners, they can only rely on > > the script itself to only report things which need to be fixed, by > > default. > > * Experienced developers. Who simply want to make sure they did not > > overlook anything before they post their work for review. They have > > the knowledge to decide if they want to ignore some of the warnings. > > * People with too much spare time, looking for anything they could > > "contribute" to the kernel. They will use --subjective and piss off > > every maintainer they can find. > > > > Sadly there's not much we can do about the third category, short of > > killing option --subjective altogether. > > You could make checkpatch have different defaults for patches and files, > to encourage better style in new code, but to discourage finding > problems in existing code. Fixing old code isn't wrong per se. It's good actually. But only if done the right way by the right person. I don't think it makes any sense to use this task as an introduction to kernel development for newcomers. It doesn't teach them anything about the kernel, really. -- Jean Delvare SUSE L3 Support
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
Hi Jani, On Thu, 22 Sep 2016 13:43:42 +0300, Jani Nikula wrote: > On Thu, 22 Sep 2016, Jean Delvare wrote: > > You need to think in terms of actual use cases. Who uses checkpatch and > > why? I think there are 3 groups of users: > > * Beginners. They won't run the script by themselves, instead they will > > submit a patch which infringes a lot of coding style rules, and the > > maintainer will point them to checkpatch and ask for a resubmission > > which makes checkpatch happy. Being beginners, they can only rely on > > the script itself to only report things which need to be fixed, by > > default. > > * Experienced developers. Who simply want to make sure they did not > > overlook anything before they post their work for review. They have > > the knowledge to decide if they want to ignore some of the warnings. > > * People with too much spare time, looking for anything they could > > "contribute" to the kernel. They will use --subjective and piss off > > every maintainer they can find. > > > > Sadly there's not much we can do about the third category, short of > > killing option --subjective altogether. > > You could make checkpatch have different defaults for patches and files, > to encourage better style in new code, but to discourage finding > problems in existing code. Fixing old code isn't wrong per se. It's good actually. But only if done the right way by the right person. I don't think it makes any sense to use this task as an introduction to kernel development for newcomers. It doesn't teach them anything about the kernel, really. -- Jean Delvare SUSE L3 Support
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
On Thu, 22 Sep 2016 03:42:10 -0700, Joe Perches wrote: > On Thu, 2016-09-22 at 11:24 +0200, Jean Delvare wrote: > > I would rather suggest: > > > > ERROR -> MUST_FIX > > WARNING -> SHOULD_FIX > > CHECK -> MAY_FIX > > MUST is much stronger language than I would prefer. That's what error means, really. When your compiler fails with an error, you have no choice but to fix your code. Warnings on the other hand may be ignored sometimes. > There are still about a quarter million ERRORs just for > spacing issues in the kernel tree. > > Here are the top 10 ERROR checkpatch messages treewide as of > a few days ago, > > $ grep ERROR checkpatch.short_sorted_20160917 > 268308 ERROR:SPACING > 37340 ERROR:CODE_INDENT > 27678 ERROR:TRAILING_WHITESPACE > 21024 ERROR:COMPLEX_MACRO > 14048 ERROR:POINTER_LOCATION > 12207 ERROR:TRAILING_STATEMENTS > 11079 ERROR:OPEN_BRACE >6802 ERROR:ASSIGN_IN_IF >3940 ERROR:RETURN_PARENTHESES >2322 ERROR:NON_OCTAL_PERMISSIONS > > Maybe there could be some better classifications of the various > messages. > > But there are about two million checkpatch messages overall in > the kernel tree. > > That's a lot. Sure. But I'm afraid you keep changing topics and I have no idea where you are going. We started with "should there be a space before jump labels", then out of nowhere we were discussing the wording of the output of checkpatch (how is that related?) and now you pull statistics out of your hat, like these numbers imply anything. checkpatch was called checkPATCH for a reason. It's main intent was to prevent NEW (coding-style mostly) errors from creeping into the kernel. The fact that old code does now always follow these recommendations is unfortunate but that doesn't make checkpatch wrong or bad. ERROR means that the new code isn't allowed to do that. Period. -- Jean Delvare SUSE L3 Support
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
On Thu, 22 Sep 2016 03:42:10 -0700, Joe Perches wrote: > On Thu, 2016-09-22 at 11:24 +0200, Jean Delvare wrote: > > I would rather suggest: > > > > ERROR -> MUST_FIX > > WARNING -> SHOULD_FIX > > CHECK -> MAY_FIX > > MUST is much stronger language than I would prefer. That's what error means, really. When your compiler fails with an error, you have no choice but to fix your code. Warnings on the other hand may be ignored sometimes. > There are still about a quarter million ERRORs just for > spacing issues in the kernel tree. > > Here are the top 10 ERROR checkpatch messages treewide as of > a few days ago, > > $ grep ERROR checkpatch.short_sorted_20160917 > 268308 ERROR:SPACING > 37340 ERROR:CODE_INDENT > 27678 ERROR:TRAILING_WHITESPACE > 21024 ERROR:COMPLEX_MACRO > 14048 ERROR:POINTER_LOCATION > 12207 ERROR:TRAILING_STATEMENTS > 11079 ERROR:OPEN_BRACE >6802 ERROR:ASSIGN_IN_IF >3940 ERROR:RETURN_PARENTHESES >2322 ERROR:NON_OCTAL_PERMISSIONS > > Maybe there could be some better classifications of the various > messages. > > But there are about two million checkpatch messages overall in > the kernel tree. > > That's a lot. Sure. But I'm afraid you keep changing topics and I have no idea where you are going. We started with "should there be a space before jump labels", then out of nowhere we were discussing the wording of the output of checkpatch (how is that related?) and now you pull statistics out of your hat, like these numbers imply anything. checkpatch was called checkPATCH for a reason. It's main intent was to prevent NEW (coding-style mostly) errors from creeping into the kernel. The fact that old code does now always follow these recommendations is unfortunate but that doesn't make checkpatch wrong or bad. ERROR means that the new code isn't allowed to do that. Period. -- Jean Delvare SUSE L3 Support
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
On Thu, 22 Sep 2016, Jean Delvarewrote: > Hi Joe, > > On Mon, 19 Sep 2016 23:32:03 -0700, Joe Perches wrote: >> On Tue, 2016-09-20 at 07:53 +0200, Julia Lawall wrote: >> > I think it is better to be clear. CHECK was never really clear to me, >> > especially if you see it in isolation, on a file that doesn't also have >> > ERROR or WARNING. NITS is a common word in this context, but not FLEAS >> > and GNATS, as far as I know. >> > There could also be a severity level: high medium and low >> >> I agree clarity is good. >> >> The seriousness with which some beginners take these message >> types though is troublesome, > > You need to think in terms of actual use cases. Who uses checkpatch and > why? I think there are 3 groups of users: > * Beginners. They won't run the script by themselves, instead they will > submit a patch which infringes a lot of coding style rules, and the > maintainer will point them to checkpatch and ask for a resubmission > which makes checkpatch happy. Being beginners, they can only rely on > the script itself to only report things which need to be fixed, by > default. > * Experienced developers. Who simply want to make sure they did not > overlook anything before they post their work for review. They have > the knowledge to decide if they want to ignore some of the warnings. > * People with too much spare time, looking for anything they could > "contribute" to the kernel. They will use --subjective and piss off > every maintainer they can find. > > Sadly there's not much we can do about the third category, short of > killing option --subjective altogether. You could make checkpatch have different defaults for patches and files, to encourage better style in new code, but to discourage finding problems in existing code. BR, Jani. > > The default settings should work out of the box for for the first > category. > >> Maybe prefix various different types of style messages. >> >> Something like: >> >> ERROR-> CODE_STYLE_DEFECT >> WARNING -> CODE_STYLE_UNPREFERRED >> CHECK-> CODE_STYLE_NIT > > I don't think you clarify anything with these changes, as they do not > carry the requirement from a submitter's perspective. If you really > want to change the names, I would rather suggest: > > ERROR -> MUST_FIX > WARNING -> SHOULD_FIX > CHECK -> MAY_FIX > > Or explain the categories in plain English, see below. > >> I doubt additional external documentation would help much. > > I agree. If anything needs to be explained, it should be included in > the output of checkpatch directly. For example, if any ERROR was > printed, include the following after the count summary: > > "ERROR means the code is infringing a core coding style rule. This MUST > be fixed before the patch is submitted upstream." > > And if any WARNING was printed, include the following: > > "WARNING means the code is not following the best practice. This SHOULD > be fixed before the patch is submitted upstream, unless the maintainer > agreed otherwise." > > Not sure if we need something for CHECK, as these messages are not > printed by default so I'd assume people who get them know what they > asked for. But apparently these confused Julia so maybe a similar > explanation would be needed for them too. -- Jani Nikula, Intel Open Source Technology Center
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
On Thu, 22 Sep 2016, Jean Delvare wrote: > Hi Joe, > > On Mon, 19 Sep 2016 23:32:03 -0700, Joe Perches wrote: >> On Tue, 2016-09-20 at 07:53 +0200, Julia Lawall wrote: >> > I think it is better to be clear. CHECK was never really clear to me, >> > especially if you see it in isolation, on a file that doesn't also have >> > ERROR or WARNING. NITS is a common word in this context, but not FLEAS >> > and GNATS, as far as I know. >> > There could also be a severity level: high medium and low >> >> I agree clarity is good. >> >> The seriousness with which some beginners take these message >> types though is troublesome, > > You need to think in terms of actual use cases. Who uses checkpatch and > why? I think there are 3 groups of users: > * Beginners. They won't run the script by themselves, instead they will > submit a patch which infringes a lot of coding style rules, and the > maintainer will point them to checkpatch and ask for a resubmission > which makes checkpatch happy. Being beginners, they can only rely on > the script itself to only report things which need to be fixed, by > default. > * Experienced developers. Who simply want to make sure they did not > overlook anything before they post their work for review. They have > the knowledge to decide if they want to ignore some of the warnings. > * People with too much spare time, looking for anything they could > "contribute" to the kernel. They will use --subjective and piss off > every maintainer they can find. > > Sadly there's not much we can do about the third category, short of > killing option --subjective altogether. You could make checkpatch have different defaults for patches and files, to encourage better style in new code, but to discourage finding problems in existing code. BR, Jani. > > The default settings should work out of the box for for the first > category. > >> Maybe prefix various different types of style messages. >> >> Something like: >> >> ERROR-> CODE_STYLE_DEFECT >> WARNING -> CODE_STYLE_UNPREFERRED >> CHECK-> CODE_STYLE_NIT > > I don't think you clarify anything with these changes, as they do not > carry the requirement from a submitter's perspective. If you really > want to change the names, I would rather suggest: > > ERROR -> MUST_FIX > WARNING -> SHOULD_FIX > CHECK -> MAY_FIX > > Or explain the categories in plain English, see below. > >> I doubt additional external documentation would help much. > > I agree. If anything needs to be explained, it should be included in > the output of checkpatch directly. For example, if any ERROR was > printed, include the following after the count summary: > > "ERROR means the code is infringing a core coding style rule. This MUST > be fixed before the patch is submitted upstream." > > And if any WARNING was printed, include the following: > > "WARNING means the code is not following the best practice. This SHOULD > be fixed before the patch is submitted upstream, unless the maintainer > agreed otherwise." > > Not sure if we need something for CHECK, as these messages are not > printed by default so I'd assume people who get them know what they > asked for. But apparently these confused Julia so maybe a similar > explanation would be needed for them too. -- Jani Nikula, Intel Open Source Technology Center
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
On Thu, 2016-09-22 at 11:24 +0200, Jean Delvare wrote: [] > > The seriousness with which some beginners take these message > > types though is troublesome, [] > You need to think in terms of actual use cases. Who uses checkpatch and > why? I think there are 3 groups of users: > * Beginners. They won't run the script by themselves, instead they will > submit a patch which infringes a lot of coding style rules, and the > maintainer will point them to checkpatch and ask for a resubmission > which makes checkpatch happy. Being beginners, they can only rely on > the script itself to only report things which need to be fixed, by > default. > * Experienced developers. Who simply want to make sure they did not > overlook anything before they post their work for review. They have > the knowledge to decide if they want to ignore some of the warnings. > * People with too much spare time, looking for anything they could > "contribute" to the kernel. They will use --subjective and piss off > every maintainer they can find. I think you overlook the category of a beginner submitting "my first kernel patch" which is a "coding style" defect of some type. The Eudyptula and Outreachy programs seem to encourage these sorts of patches. This is where "scripts/checkpatch.pl -f " is most used. I believe adding the --force option might be useful to restrict cleanup-style-only patches outside of staging. There's nothing wrong with cleanup style patches, it can be good introduction to compiler/config tool & kernel setup. > I would rather suggest: > > ERROR -> MUST_FIX > WARNING -> SHOULD_FIX > CHECK -> MAY_FIX MUST is much stronger language than I would prefer. There are still about a quarter million ERRORs just for spacing issues in the kernel tree. Here are the top 10 ERROR checkpatch messages treewide as of a few days ago, $ grep ERROR checkpatch.short_sorted_20160917 268308 ERROR:SPACING 37340 ERROR:CODE_INDENT 27678 ERROR:TRAILING_WHITESPACE 21024 ERROR:COMPLEX_MACRO 14048 ERROR:POINTER_LOCATION 12207 ERROR:TRAILING_STATEMENTS 11079 ERROR:OPEN_BRACE 6802 ERROR:ASSIGN_IN_IF 3940 ERROR:RETURN_PARENTHESES 2322 ERROR:NON_OCTAL_PERMISSIONS Maybe there could be some better classifications of the various messages. But there are about two million checkpatch messages overall in the kernel tree. That's a lot.
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
On Thu, 2016-09-22 at 11:24 +0200, Jean Delvare wrote: [] > > The seriousness with which some beginners take these message > > types though is troublesome, [] > You need to think in terms of actual use cases. Who uses checkpatch and > why? I think there are 3 groups of users: > * Beginners. They won't run the script by themselves, instead they will > submit a patch which infringes a lot of coding style rules, and the > maintainer will point them to checkpatch and ask for a resubmission > which makes checkpatch happy. Being beginners, they can only rely on > the script itself to only report things which need to be fixed, by > default. > * Experienced developers. Who simply want to make sure they did not > overlook anything before they post their work for review. They have > the knowledge to decide if they want to ignore some of the warnings. > * People with too much spare time, looking for anything they could > "contribute" to the kernel. They will use --subjective and piss off > every maintainer they can find. I think you overlook the category of a beginner submitting "my first kernel patch" which is a "coding style" defect of some type. The Eudyptula and Outreachy programs seem to encourage these sorts of patches. This is where "scripts/checkpatch.pl -f " is most used. I believe adding the --force option might be useful to restrict cleanup-style-only patches outside of staging. There's nothing wrong with cleanup style patches, it can be good introduction to compiler/config tool & kernel setup. > I would rather suggest: > > ERROR -> MUST_FIX > WARNING -> SHOULD_FIX > CHECK -> MAY_FIX MUST is much stronger language than I would prefer. There are still about a quarter million ERRORs just for spacing issues in the kernel tree. Here are the top 10 ERROR checkpatch messages treewide as of a few days ago, $ grep ERROR checkpatch.short_sorted_20160917 268308 ERROR:SPACING 37340 ERROR:CODE_INDENT 27678 ERROR:TRAILING_WHITESPACE 21024 ERROR:COMPLEX_MACRO 14048 ERROR:POINTER_LOCATION 12207 ERROR:TRAILING_STATEMENTS 11079 ERROR:OPEN_BRACE 6802 ERROR:ASSIGN_IN_IF 3940 ERROR:RETURN_PARENTHESES 2322 ERROR:NON_OCTAL_PERMISSIONS Maybe there could be some better classifications of the various messages. But there are about two million checkpatch messages overall in the kernel tree. That's a lot.
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
Hi Joe, On Mon, 19 Sep 2016 23:32:03 -0700, Joe Perches wrote: > On Tue, 2016-09-20 at 07:53 +0200, Julia Lawall wrote: > > I think it is better to be clear. CHECK was never really clear to me, > > especially if you see it in isolation, on a file that doesn't also have > > ERROR or WARNING. NITS is a common word in this context, but not FLEAS > > and GNATS, as far as I know. > > There could also be a severity level: high medium and low > > I agree clarity is good. > > The seriousness with which some beginners take these message > types though is troublesome, You need to think in terms of actual use cases. Who uses checkpatch and why? I think there are 3 groups of users: * Beginners. They won't run the script by themselves, instead they will submit a patch which infringes a lot of coding style rules, and the maintainer will point them to checkpatch and ask for a resubmission which makes checkpatch happy. Being beginners, they can only rely on the script itself to only report things which need to be fixed, by default. * Experienced developers. Who simply want to make sure they did not overlook anything before they post their work for review. They have the knowledge to decide if they want to ignore some of the warnings. * People with too much spare time, looking for anything they could "contribute" to the kernel. They will use --subjective and piss off every maintainer they can find. Sadly there's not much we can do about the third category, short of killing option --subjective altogether. The default settings should work out of the box for for the first category. > Maybe prefix various different types of style messages. > > Something like: > > ERROR -> CODE_STYLE_DEFECT > WARNING -> CODE_STYLE_UNPREFERRED > CHECK -> CODE_STYLE_NIT I don't think you clarify anything with these changes, as they do not carry the requirement from a submitter's perspective. If you really want to change the names, I would rather suggest: ERROR -> MUST_FIX WARNING -> SHOULD_FIX CHECK -> MAY_FIX Or explain the categories in plain English, see below. > I doubt additional external documentation would help much. I agree. If anything needs to be explained, it should be included in the output of checkpatch directly. For example, if any ERROR was printed, include the following after the count summary: "ERROR means the code is infringing a core coding style rule. This MUST be fixed before the patch is submitted upstream." And if any WARNING was printed, include the following: "WARNING means the code is not following the best practice. This SHOULD be fixed before the patch is submitted upstream, unless the maintainer agreed otherwise." Not sure if we need something for CHECK, as these messages are not printed by default so I'd assume people who get them know what they asked for. But apparently these confused Julia so maybe a similar explanation would be needed for them too. -- Jean Delvare SUSE L3 Support
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next
Hi Joe, On Mon, 19 Sep 2016 23:32:03 -0700, Joe Perches wrote: > On Tue, 2016-09-20 at 07:53 +0200, Julia Lawall wrote: > > I think it is better to be clear. CHECK was never really clear to me, > > especially if you see it in isolation, on a file that doesn't also have > > ERROR or WARNING. NITS is a common word in this context, but not FLEAS > > and GNATS, as far as I know. > > There could also be a severity level: high medium and low > > I agree clarity is good. > > The seriousness with which some beginners take these message > types though is troublesome, You need to think in terms of actual use cases. Who uses checkpatch and why? I think there are 3 groups of users: * Beginners. They won't run the script by themselves, instead they will submit a patch which infringes a lot of coding style rules, and the maintainer will point them to checkpatch and ask for a resubmission which makes checkpatch happy. Being beginners, they can only rely on the script itself to only report things which need to be fixed, by default. * Experienced developers. Who simply want to make sure they did not overlook anything before they post their work for review. They have the knowledge to decide if they want to ignore some of the warnings. * People with too much spare time, looking for anything they could "contribute" to the kernel. They will use --subjective and piss off every maintainer they can find. Sadly there's not much we can do about the third category, short of killing option --subjective altogether. The default settings should work out of the box for for the first category. > Maybe prefix various different types of style messages. > > Something like: > > ERROR -> CODE_STYLE_DEFECT > WARNING -> CODE_STYLE_UNPREFERRED > CHECK -> CODE_STYLE_NIT I don't think you clarify anything with these changes, as they do not carry the requirement from a submitter's perspective. If you really want to change the names, I would rather suggest: ERROR -> MUST_FIX WARNING -> SHOULD_FIX CHECK -> MAY_FIX Or explain the categories in plain English, see below. > I doubt additional external documentation would help much. I agree. If anything needs to be explained, it should be included in the output of checkpatch directly. For example, if any ERROR was printed, include the following after the count summary: "ERROR means the code is infringing a core coding style rule. This MUST be fixed before the patch is submitted upstream." And if any WARNING was printed, include the following: "WARNING means the code is not following the best practice. This SHOULD be fixed before the patch is submitted upstream, unless the maintainer agreed otherwise." Not sure if we need something for CHECK, as these messages are not printed by default so I'd assume people who get them know what they asked for. But apparently these confused Julia so maybe a similar explanation would be needed for them too. -- Jean Delvare SUSE L3 Support
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next (was Re: [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk())
On Mon, 19 Sep 2016, Joe Perches wrote: > On Tue, 2016-09-20 at 07:53 +0200, Julia Lawall wrote: > > On Mon, 19 Sep 2016, Joe Perches wrote: > > > On Tue, 2016-09-20 at 01:11 +0100, Al Viro wrote: > > > > IMO what we need is to go through all rules in CodingStyle and if for > > > > some rule there is no overwhelming majority in the core kernel, well, > > > > the list has grown way too large and could use massive trimming. > > > > > > I'm in complete agreement. > > > > > > I also think that checkpatch's ERROR/WARNING/CHECK message naming is > > > far too severe and injunctive and could use a renaming to something > > > more silly, bug related and less commanding like FLEAS/GNATS/NITS. > > I think it is better to be clear. CHECK was never really clear to me, > > especially if you see it in isolation, on a file that doesn't also have > > ERROR or WARNING. NITS is a common word in this context, but not FLEAS > > and GNATS, as far as I know. > > There could also be a severity level: high medium and low > > I agree clarity is good. > > The seriousness with which some beginners take these message > types though is troublesome, It's not necessarily the case that changing the error type will change the behavior of the persons in question. > Maybe prefix various different types of style messages. > > Something like: > > ERROR -> CODE_STYLE_DEFECT > WARNING -> CODE_STYLE_UNPREFERRED > CHECK -> CODE_STYLE_NIT > > I doubt additional external documentation would help much. > > Some checkpatch bleats really are errors though. Maybe just downgrade more things? Perhaps SUGGESTION would be more clear than CHECK? julia
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next (was Re: [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk())
On Mon, 19 Sep 2016, Joe Perches wrote: > On Tue, 2016-09-20 at 07:53 +0200, Julia Lawall wrote: > > On Mon, 19 Sep 2016, Joe Perches wrote: > > > On Tue, 2016-09-20 at 01:11 +0100, Al Viro wrote: > > > > IMO what we need is to go through all rules in CodingStyle and if for > > > > some rule there is no overwhelming majority in the core kernel, well, > > > > the list has grown way too large and could use massive trimming. > > > > > > I'm in complete agreement. > > > > > > I also think that checkpatch's ERROR/WARNING/CHECK message naming is > > > far too severe and injunctive and could use a renaming to something > > > more silly, bug related and less commanding like FLEAS/GNATS/NITS. > > I think it is better to be clear. CHECK was never really clear to me, > > especially if you see it in isolation, on a file that doesn't also have > > ERROR or WARNING. NITS is a common word in this context, but not FLEAS > > and GNATS, as far as I know. > > There could also be a severity level: high medium and low > > I agree clarity is good. > > The seriousness with which some beginners take these message > types though is troublesome, It's not necessarily the case that changing the error type will change the behavior of the persons in question. > Maybe prefix various different types of style messages. > > Something like: > > ERROR -> CODE_STYLE_DEFECT > WARNING -> CODE_STYLE_UNPREFERRED > CHECK -> CODE_STYLE_NIT > > I doubt additional external documentation would help much. > > Some checkpatch bleats really are errors though. Maybe just downgrade more things? Perhaps SUGGESTION would be more clear than CHECK? julia
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next (was Re: [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk())
On Tue, 2016-09-20 at 07:53 +0200, Julia Lawall wrote: > On Mon, 19 Sep 2016, Joe Perches wrote: > > On Tue, 2016-09-20 at 01:11 +0100, Al Viro wrote: > > > IMO what we need is to go through all rules in CodingStyle and if for > > > some rule there is no overwhelming majority in the core kernel, well, > > > the list has grown way too large and could use massive trimming. > > > > I'm in complete agreement. > > > > I also think that checkpatch's ERROR/WARNING/CHECK message naming is > > far too severe and injunctive and could use a renaming to something > > more silly, bug related and less commanding like FLEAS/GNATS/NITS. > I think it is better to be clear. CHECK was never really clear to me, > especially if you see it in isolation, on a file that doesn't also have > ERROR or WARNING. NITS is a common word in this context, but not FLEAS > and GNATS, as far as I know. > There could also be a severity level: high medium and low I agree clarity is good. The seriousness with which some beginners take these message types though is troublesome, Maybe prefix various different types of style messages. Something like: ERROR -> CODE_STYLE_DEFECT WARNING -> CODE_STYLE_UNPREFERRED CHECK -> CODE_STYLE_NIT I doubt additional external documentation would help much. Some checkpatch bleats really are errors though.
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next (was Re: [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk())
On Tue, 2016-09-20 at 07:53 +0200, Julia Lawall wrote: > On Mon, 19 Sep 2016, Joe Perches wrote: > > On Tue, 2016-09-20 at 01:11 +0100, Al Viro wrote: > > > IMO what we need is to go through all rules in CodingStyle and if for > > > some rule there is no overwhelming majority in the core kernel, well, > > > the list has grown way too large and could use massive trimming. > > > > I'm in complete agreement. > > > > I also think that checkpatch's ERROR/WARNING/CHECK message naming is > > far too severe and injunctive and could use a renaming to something > > more silly, bug related and less commanding like FLEAS/GNATS/NITS. > I think it is better to be clear. CHECK was never really clear to me, > especially if you see it in isolation, on a file that doesn't also have > ERROR or WARNING. NITS is a common word in this context, but not FLEAS > and GNATS, as far as I know. > There could also be a severity level: high medium and low I agree clarity is good. The seriousness with which some beginners take these message types though is troublesome, Maybe prefix various different types of style messages. Something like: ERROR -> CODE_STYLE_DEFECT WARNING -> CODE_STYLE_UNPREFERRED CHECK -> CODE_STYLE_NIT I doubt additional external documentation would help much. Some checkpatch bleats really are errors though.
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next (was Re: [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk())
On Mon, 19 Sep 2016, Joe Perches wrote: > On Tue, 2016-09-20 at 01:11 +0100, Al Viro wrote: > > IMO what we need is to go through all rules in CodingStyle and if for > > some rule there is no overwhelming majority in the core kernel, well, > > the list has grown way too large and could use massive trimming. > > I'm in complete agreement. > > I also think that checkpatch's ERROR/WARNING/CHECK message naming is > far too severe and injunctive and could use a renaming to something > more silly, bug related and less commanding like FLEAS/GNATS/NITS. I think it is better to be clear. CHECK was never really clear to me, especially if you see it in isolation, on a file that doesn't also have ERROR or WARNING. NITS is a common word in this context, but not FLEAS and GNATS, as far as I know. There could also be a severity level: high medium and low. julia > > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next (was Re: [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk())
On Mon, 19 Sep 2016, Joe Perches wrote: > On Tue, 2016-09-20 at 01:11 +0100, Al Viro wrote: > > IMO what we need is to go through all rules in CodingStyle and if for > > some rule there is no overwhelming majority in the core kernel, well, > > the list has grown way too large and could use massive trimming. > > I'm in complete agreement. > > I also think that checkpatch's ERROR/WARNING/CHECK message naming is > far too severe and injunctive and could use a renaming to something > more silly, bug related and less commanding like FLEAS/GNATS/NITS. I think it is better to be clear. CHECK was never really clear to me, especially if you see it in isolation, on a file that doesn't also have ERROR or WARNING. NITS is a common word in this context, but not FLEAS and GNATS, as far as I know. There could also be a severity level: high medium and low. julia > > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next (was Re: [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk())
On Tue, 2016-09-20 at 01:11 +0100, Al Viro wrote: > IMO what we need is to go through all rules in CodingStyle and if for > some rule there is no overwhelming majority in the core kernel, well, > the list has grown way too large and could use massive trimming. I'm in complete agreement. I also think that checkpatch's ERROR/WARNING/CHECK message naming is far too severe and injunctive and could use a renaming to something more silly, bug related and less commanding like FLEAS/GNATS/NITS.
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next (was Re: [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk())
On Tue, 2016-09-20 at 01:11 +0100, Al Viro wrote: > IMO what we need is to go through all rules in CodingStyle and if for > some rule there is no overwhelming majority in the core kernel, well, > the list has grown way too large and could use massive trimming. I'm in complete agreement. I also think that checkpatch's ERROR/WARNING/CHECK message naming is far too severe and injunctive and could use a renaming to something more silly, bug related and less commanding like FLEAS/GNATS/NITS.
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next (was Re: [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk())
On Mon, Sep 19, 2016 at 01:53:37PM +0200, Ilya Dryomov wrote: > > I did consider the reason to be good enough to warrant a "change", > > actually. Or more exactly from "one space is allowed" to "one space is > > recommended." Which is quite different from changing all the code > > actively. I can understand how you don't like it, but again, this > > "inconsistency" has been accepted for almost a decade now, so I find it > > strange to see so much resistance when someone finally tries to sort it > > out. > > Yeah, I guess that's where our disagreement lies - the "so that `diff > -p` does not confuse labels with functions" in the age of git, hg and > others, all of which can be customized to your heart's content is not > a good enough reason to go from "allowed" to "advised". On the top of CodingStyle we have "This is a short document describing the preferred coding style for the linux kernel." Let's make it s/describing/& (as in "descriptive, not prescriptive")/. The lack of consensus (in the core kernel areas) is _not_ an invitation to pick a rule out of one's arse/nose/armpit/textbook/whatnot and stick it as The One True Style, and references to uniformity are worthless in such case. In particular, "whitespace before labels" kind of patches anywhere in VFS will be simply rejected. IMO what we need is to go through all rules in CodingStyle and if for some rule there is no overwhelming majority in the core kernel, well, the list has grown way too large and could use massive trimming.
Re: "CodingStyle: Clarify and complete chapter 7" in docs-next (was Re: [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk())
On Mon, Sep 19, 2016 at 01:53:37PM +0200, Ilya Dryomov wrote: > > I did consider the reason to be good enough to warrant a "change", > > actually. Or more exactly from "one space is allowed" to "one space is > > recommended." Which is quite different from changing all the code > > actively. I can understand how you don't like it, but again, this > > "inconsistency" has been accepted for almost a decade now, so I find it > > strange to see so much resistance when someone finally tries to sort it > > out. > > Yeah, I guess that's where our disagreement lies - the "so that `diff > -p` does not confuse labels with functions" in the age of git, hg and > others, all of which can be customized to your heart's content is not > a good enough reason to go from "allowed" to "advised". On the top of CodingStyle we have "This is a short document describing the preferred coding style for the linux kernel." Let's make it s/describing/& (as in "descriptive, not prescriptive")/. The lack of consensus (in the core kernel areas) is _not_ an invitation to pick a rule out of one's arse/nose/armpit/textbook/whatnot and stick it as The One True Style, and references to uniformity are worthless in such case. In particular, "whitespace before labels" kind of patches anywhere in VFS will be simply rejected. IMO what we need is to go through all rules in CodingStyle and if for some rule there is no overwhelming majority in the core kernel, well, the list has grown way too large and could use massive trimming.
Re: CodingStyle: Clarify and complete chapter 7
>>> A common type of bug to be aware of is "one err bugs" which look like this: >>> >>> -err: >>> + err: >>> kfree(foo->bar); >>> kfree(foo); >>> return ret; >>> >>> The bug in this code is that on some exit paths "foo" is NULL. Normally >>> the >> >> ...except that kfree() can handle null pointers just fine, so this isn't >> actually a bug, right? Someday when somebody has time it would be good to >> come up with a better example. > > But if foo is NULL, An important condition … > foo->bar is not NULL I wonder about this information. Which run-time environment will provide this behaviour? > and so kfree will have a problem with it. I find that the parameter evaluation will result in side effects (because of a null pointer access) which are usually unwanted. So the execution of this function call will eventually not start. > So this is a bug. How do you think about further software development possibilities to improve corresponding exception handling? How much can the selection of jump labels influence the software design? Regards, Markus
Re: CodingStyle: Clarify and complete chapter 7
>>> A common type of bug to be aware of is "one err bugs" which look like this: >>> >>> -err: >>> + err: >>> kfree(foo->bar); >>> kfree(foo); >>> return ret; >>> >>> The bug in this code is that on some exit paths "foo" is NULL. Normally >>> the >> >> ...except that kfree() can handle null pointers just fine, so this isn't >> actually a bug, right? Someday when somebody has time it would be good to >> come up with a better example. > > But if foo is NULL, An important condition … > foo->bar is not NULL I wonder about this information. Which run-time environment will provide this behaviour? > and so kfree will have a problem with it. I find that the parameter evaluation will result in side effects (because of a null pointer access) which are usually unwanted. So the execution of this function call will eventually not start. > So this is a bug. How do you think about further software development possibilities to improve corresponding exception handling? How much can the selection of jump labels influence the software design? Regards, Markus