From patchwork Wed Jul 22 07:54:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 51331 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 16C5D20323 for ; Wed, 22 Jul 2015 07:54:40 +0000 (UTC) Received: by laef2 with SMTP id f2sf55785357lae.0 for ; Wed, 22 Jul 2015 00:54:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=+VMW1RjnFLoXQC+iUgcYNeIVTGi4dsR3mzDwb4TfSG4=; b=DwxxbySWObDd1K9OYNqNZlt0RL/L4ALlC7qoiAVoMut4qZLTVP8c7tCNjykKBYCiDL NnUn1bL8OsmG40Q3zdztq0z1O6buiH7j5D79DoIZe/VIieIt58aX2E4GJe3K7GZGX2Ya aK0wzRGsRLMGSZ/hCD+w+LqXB3qRhID7xY4Ilgq7tePpaiUPPwwINkHryfCzRUhufktg dguMBltd+M+mVc/BgiDbC99Ad8g8wFwzKSGzbhv9trk/bx+et9EGoTD/1h3khyTkbJbj TulAZKSfVqVupoPR59IPLFXmhPIzijBSAs8XmLvo5n/JkUUdnNLDWvJfQMFZ1PKDwUgs W6CA== X-Gm-Message-State: ALoCoQmZr2AN9iJcr374RrHA9zHbEvyUygQ1Hg6QS9J8fL8iCOoSLYyxlkoieWf4AvL0CElsF1IT X-Received: by 10.180.79.10 with SMTP id f10mr7457107wix.3.1437551678975; Wed, 22 Jul 2015 00:54:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.179.171 with SMTP id dh11ls37772lac.47.gmail; Wed, 22 Jul 2015 00:54:38 -0700 (PDT) X-Received: by 10.152.37.37 with SMTP id v5mr1060838laj.11.1437551678783; Wed, 22 Jul 2015 00:54:38 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id cr7si546878lad.33.2015.07.22.00.54.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 00:54:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbbqi7 with SMTP id qi7so50825374lbb.3 for ; Wed, 22 Jul 2015 00:54:38 -0700 (PDT) X-Received: by 10.152.37.228 with SMTP id b4mr1040993lak.117.1437551678672; Wed, 22 Jul 2015 00:54:38 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp1927143lba; Wed, 22 Jul 2015 00:54:37 -0700 (PDT) X-Received: by 10.66.218.42 with SMTP id pd10mr3206127pac.106.1437551676862; Wed, 22 Jul 2015 00:54:36 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4si1788960pdg.219.2015.07.22.00.54.34; Wed, 22 Jul 2015 00:54:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756338AbbGVHyd (ORCPT + 28 others); Wed, 22 Jul 2015 03:54:33 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:35389 "EHLO mail-lb0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755428AbbGVHyc (ORCPT ); Wed, 22 Jul 2015 03:54:32 -0400 Received: by lblf12 with SMTP id f12so131161537lbl.2 for ; Wed, 22 Jul 2015 00:54:30 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr1137904lbc.32.1437551670706; Wed, 22 Jul 2015 00:54:30 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by smtp.gmail.com with ESMTPSA id v8sm125078lbo.43.2015.07.22.00.54.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 00:54:29 -0700 (PDT) From: Linus Walleij To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Linus Walleij Subject: [PATCH] hexdump: do not print debug dumps for !CONFIG_DEBUG Date: Wed, 22 Jul 2015 09:54:07 +0200 Message-Id: <1437551647-19833-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The function print_hex_dump_debug() is likely supposed to be analogous to pr_debug() or dev_dbg() & friends. Currently it will adhere to dynamic debug, but will not stub out prints if CONFIG_DEBUG is not set. Let's make it do the right thing, because I am tired of having my dmesg buffer full of hex dumps on production systems. Cc: Andrew Morton Signed-off-by: Linus Walleij --- Andrew: I think this is your file. I did spend some time shaking my head thinking this basic thing just can't be wrong, but it appears it is. --- include/linux/printk.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/linux/printk.h b/include/linux/printk.h index a6298b27ac99..2d154b13d6cc 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -456,11 +456,17 @@ static inline void print_hex_dump_bytes(const char *prefix_str, int prefix_type, groupsize, buf, len, ascii) \ dynamic_hex_dump(prefix_str, prefix_type, rowsize, \ groupsize, buf, len, ascii) -#else +#elif defined(DEBUG) #define print_hex_dump_debug(prefix_str, prefix_type, rowsize, \ groupsize, buf, len, ascii) \ print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \ groupsize, buf, len, ascii) -#endif /* defined(CONFIG_DYNAMIC_DEBUG) */ +#else +static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type, + int rowsize, int groupsize, + const void *buf, size_t len, bool ascii) +{ +} +#endif #endif