Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751342AbbLUPNU (ORCPT ); Mon, 21 Dec 2015 10:13:20 -0500 Received: from mail-io0-f174.google.com ([209.85.223.174]:34076 "EHLO mail-io0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750984AbbLUPNT (ORCPT ); Mon, 21 Dec 2015 10:13:19 -0500 Subject: Re: Indent issus in kernel module development To: chunguang qu , Joe Perches , linux-kernel@vger.kernel.org References: <5674C068.9000809@infradead.org> <1450505768.3430.24.camel@perches.com> From: "Austin S. Hemmelgarn" Message-ID: <56781705.5060900@gmail.com> Date: Mon, 21 Dec 2015 10:13:09 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 151221-0, 2015-12-21), Outbound message X-Antivirus-Status: Clean Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1895 Lines: 50 On 2015-12-20 07:52, chunguang qu wrote: > I tried it. Not worked unfortunately,. > > ```bash > $ ~/share/linux/scripts/checkpatch.pl --fix --types=spacing testcompletion.c > total: 0 errors, 0 warnings, 0 lines checked > > testcompletion.c has no obvious style problems and is ready for submission. > > NOTE: Used message types: SPACING > ``` You might try something with clang-format. It doesn't have a built-in style option for the kernel (probably because the kernel can't currently be compiled with Clang/LLVM, but Linux does qualify for the first two criteria for having a new style default added, so if someone wants to actually work on it, they could probably get it included), but something like this for the config should get you pretty close: BasedOnStyle: LLVM IndentWidth: 8 UseTab: Always BreakBeforeBraces: Linux AllowShortIfStatementOnASingleLine: false IndentCaseLabels: false I'm pretty certain that this doesn't cover everything from CodingStyle, but it should cover most things, and most of the other stuff should be relatively easily scriptable using regex based replacements. > > 2015-12-19 14:16 GMT+08:00 Joe Perches : >> On Sat, 2015-12-19 at 13:50 +0800, chunguang qu wrote: >>> Yes, I just tried `scripts/Lindent` and it has the same problem. >>> >>> I had compared the source of `Lindent` with `-linux` option of >>> `indent` long time ago, there's seems no major difference. >>> So i used `indent -linux ` above. >>> >>> Thanks for your advice about `emace`, but `vi` is my only editor for >>> dozens of years. >> >> Try: >> >> $ ./scripts/checkpatch.pl --fix --types=spacing >> -- 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/