From patchwork Fri Sep 19 09:01:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 4936781 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D1AC69F350 for ; Fri, 19 Sep 2014 09:03:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 32E9A20179 for ; Fri, 19 Sep 2014 09:03:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 63B65201D3 for ; Fri, 19 Sep 2014 09:03:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756278AbaISJDh (ORCPT ); Fri, 19 Sep 2014 05:03:37 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:38961 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755232AbaISJBq (ORCPT ); Fri, 19 Sep 2014 05:01:46 -0400 Received: by mail-pa0-f46.google.com with SMTP id kq14so3448887pab.5 for ; Fri, 19 Sep 2014 02:01:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=Ebd2bODUuOapmxAAN32Kszlt7VzNulg7jGDP5HaiGjY=; b=HVgZckVFTiX/FB2f+Y+iGsdjAcYRdLItNw2cUkyNbAgk51hE0dE76i0nVsXDuysbU2 jiLkBirStAhNcBEzTZHh618m0I6AR26bLG4hYLCgbeMrRQDjIB24FlfZvyb7V7MqEY21 64cQDyLZMZuLulDTvSuSLFhF+vLHrCnnwp6adECYOicvpvhP72PIDAmdMg+E8lW+4uZB ydhjK93Yxp8+hAFjKynA9K3/lW87biCyjRmSJke+6M05BixcEYAJfsmTo9fc3qOtyVcI MN5vJ1X155EkRnDy08Jr1ZdjdOpKeHXHy3fecDW2cAzVH7Yr6+jbiyr8dEyQHe4zUDbW MEeA== X-Gm-Message-State: ALoCoQmtVqMLnclcY31+humffrvZXWkspHldhQwRRbvwiPFZY3zpHQE0C6M4vrJ4Q4gIKN3ABVkV X-Received: by 10.66.244.132 with SMTP id xg4mr13804781pac.64.1411117305688; Fri, 19 Sep 2014 02:01:45 -0700 (PDT) Received: from mew.web-pass.com ([208.87.58.227]) by mx.google.com with ESMTPSA id pb1sm1222993pdb.74.2014.09.19.02.01.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Sep 2014 02:01:45 -0700 (PDT) From: Omar Sandoval To: Chris Mason , Josef Bacik , linux-btrfs@vger.kernel.org, "Paul E. McKenney" , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] Return a value from printk_ratelimited Date: Fri, 19 Sep 2014 02:01:29 -0700 Message-Id: <3629aa32fd3e434e41e5e5f4a97ab50adb8edcdc.1411116672.git.osandov@osandov.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 printk returns an integer; there's no reason for printk_ratelimited to swallow it. Signed-off-by: Omar Sandoval --- include/linux/printk.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/printk.h b/include/linux/printk.h index d78125f..67534bc 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -343,12 +343,14 @@ extern asmlinkage void dump_stack(void) __cold; #ifdef CONFIG_PRINTK #define printk_ratelimited(fmt, ...) \ ({ \ + int __ret = 0; \ static DEFINE_RATELIMIT_STATE(_rs, \ DEFAULT_RATELIMIT_INTERVAL, \ DEFAULT_RATELIMIT_BURST); \ \ if (__ratelimit(&_rs)) \ - printk(fmt, ##__VA_ARGS__); \ + __ret = printk(fmt, ##__VA_ARGS__); \ + __ret; \ }) #else #define printk_ratelimited(fmt, ...) \