From patchwork Fri Oct 10 23:20:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 5068051 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7C89CC11AC for ; Fri, 10 Oct 2014 23:20:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B71B6201FE for ; Fri, 10 Oct 2014 23:20:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F411D201EC for ; Fri, 10 Oct 2014 23:20:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751797AbaJJXUy (ORCPT ); Fri, 10 Oct 2014 19:20:54 -0400 Received: from mga01.intel.com ([192.55.52.88]:39237 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751795AbaJJXUx (ORCPT ); Fri, 10 Oct 2014 19:20:53 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 10 Oct 2014 16:20:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,695,1406617200"; d="scan'208";a="612736205" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.157]) by fmsmga002.fm.intel.com with ESMTP; 10 Oct 2014 16:20:49 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id C3CD3301032; Fri, 10 Oct 2014 16:20:49 -0700 (PDT) From: Andi Kleen To: mmarek@suse.cz Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, Andi Kleen , hpa@zytor.com Subject: [PATCH] kbuild: Fix cleanpatch to always replace leading space with tab Date: Fri, 10 Oct 2014 16:20:46 -0700 Message-Id: <1412983246-12118-1-git-send-email-andi@firstfloor.org> X-Mailer: git-send-email 1.9.3 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andi Kleen If you have something like blabla in a patch cleanpatch does not replace the spaces with tabs. That is because it only handles space in front of tab. But it's more convenient if it also replaces space with tabs, even if there is no tab at all, as that is what checkpatch and other pedants expect. Cc: hpa@zytor.com Signed-off-by: Andi Kleen --- scripts/cleanpatch | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/cleanpatch b/scripts/cleanpatch index 9680d03..d14aac9 100755 --- a/scripts/cleanpatch +++ b/scripts/cleanpatch @@ -39,6 +39,10 @@ sub clean_space_tabs($) } elsif ($c eq " ") { $nsp++; } else { + while ($nsp >= 8) { + $lo .= "\t"; + $nsp -= 8; + } $lo .= " " x $nsp; $pos += $nsp; $nsp = 0;