public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Joe Perches <joe@perches.com>, Thomas Gleixner <tglx@linutronix.de>
Cc: Grant Likely <grant.likely@linaro.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	<linux-kernel@vger.kernel.org>, <guohanjun@huawei.com>
Subject: Re: [PATCH 0/7] irq: fix checkpatch errors and warnings
Date: Sat, 8 Jun 2013 11:32:54 +0800	[thread overview]
Message-ID: <51B2A5E6.4050900@huawei.com> (raw)
In-Reply-To: <1370643896.2209.153.camel@joe-AO722>

On 2013-06-08 6:24, Joe Perches wrote:
> On Fri, 2013-06-07 at 22:42 +0200, Thomas Gleixner wrote:
>> On Thu, 6 Jun 2013, Kefeng Wang wrote:
>>
>>> Fix all the checkpath errors in kernel/irq dir, and some warnings
>>> also fixed.
>>
>> Sorry, I'm not really interested in this kind of patches. To be
>> honest, it would be way more exciting if you had taught checkpatch to
>> actually fix the missing space after the comma.
> 
> Yup.  Kefeng, if you want to take that up,
> I'd be happy to help/guide you.
> 
>> Aside of that your mechanical fixups are mostly making the code worse
>> to read. Just a few examples:
>>
>> --- linux-2.6.orig/kernel/irq/chip.c
> []
>>         struct irq_desc *desc = irq_get_desc_buslock(irq, &flags,
>>                                                      IRQ_GET_DESC_CHECK_GLOBAL);
>>
>> Aligning the first arguments of the first and the second line makes it
>> way simpler to read.
> 
> or maybe use
> 
> 	struct irq_desc *desc =
> 		irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL);
> 
> and satisfy 80 cols too.
> 
> Existing uses that exceed the 80 column text limit shouldn't
> be changed without making other useful changes at the same
> time.  Make 80 column changes as part of a larger patch set,
> 
>> --- linux-2.6.orig/kernel/irq/handle.c
> []
>> @@ -47,7 +47,7 @@ static void warn_no_thread(unsigned int 
> 
>> -       printk(KERN_WARNING "IRQ %d device %s returned IRQ_WAKE_THREAD "
>> +       pr_warn("IRQ %d device %s returned IRQ_WAKE_THREAD "
>>                "but no thread function available.", irq, action->name);
> 
> It'd be useful to add a terminating \n though to avoid
> interleaving by other thread pr_cont/naked printks.
> 
>> The checkpatch warning is to prevent new code to use the old style
>> printk format, but it's not intended to force that on existing code.
> 
> Yup, and checkpatch will never be a perfect tool.
> 
>> Please sit down and read and understand the code and try to find real
>> issues which cannot be detected and solved by scripts and
>> tools. That's what's kernel hacking is about. You are not becoming a
>> kernel developer by running tools and blindly fixing the complaints of
>> the tools. You have to understand the code and you have to learn to
>> judge the output of tools.
> 
> Quite right.
> 
> Maybe add something like it to SubmittingPatches in
> Section 2 ala:
> 
> 5) "Don't be a checkpatch monkey - How not to write patches"
> 

hi Thomas and Joe, thank very much for your reply and remind,
I will pay more attention to study kernel, like your said,
read more code and be an good kernel developer.

thanks,
kefeng


> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
> .
> 



      reply	other threads:[~2013-06-08  3:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-06 11:20 [PATCH 0/7] irq: fix checkpatch errors and warnings Kefeng Wang
2013-06-06 11:20 ` [PATCH 1/7] irq: fix checkpatch warnings Kefeng Wang
2013-06-06 11:20 ` [PATCH 2/7] irq: fix checkpatch error Kefeng Wang
2013-06-06 11:20 ` [PATCH 3/7] " Kefeng Wang
2013-06-11 13:52   ` Grant Likely
2013-06-06 11:20 ` [PATCH 4/7] irq: fix all checkpatch errors and warnings Kefeng Wang
2013-06-06 11:20 ` [PATCH 5/7] " Kefeng Wang
2013-06-06 11:20 ` [PATCH 6/7] irq: fix checkpatch warnings Kefeng Wang
2013-06-06 11:20 ` [PATCH 7/7] irq: fix all checkpatch errors and warnings Kefeng Wang
2013-06-07 20:42 ` [PATCH 0/7] irq: fix " Thomas Gleixner
2013-06-07 22:24   ` Joe Perches
2013-06-08  3:32     ` Kefeng Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51B2A5E6.4050900@huawei.com \
    --to=wangkefeng.wang@huawei.com \
    --cc=benh@kernel.crashing.org \
    --cc=grant.likely@linaro.org \
    --cc=guohanjun@huawei.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox