From patchwork Sat Sep 27 05:36:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 4988941 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 498569F1D4 for ; Sat, 27 Sep 2014 05:36:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 70BA5201F7 for ; Sat, 27 Sep 2014 05:36:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 48034201DD for ; Sat, 27 Sep 2014 05:36:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751800AbaI0Ff7 (ORCPT ); Sat, 27 Sep 2014 01:35:59 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:38073 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751444AbaI0Ff5 (ORCPT ); Sat, 27 Sep 2014 01:35:57 -0400 Received: by mail-pa0-f53.google.com with SMTP id kq14so2374822pab.26 for ; Fri, 26 Sep 2014 22:35:57 -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=PFD5hfVo2P/7pzeR8fqhpmiNI4rRe4gFQgAX404DMTo=; b=AqnyC/H8t8Zui3n5hsQDdArMJ6E+vza24oHJrDX4wl1qn4NoQkvV/6XzSgpYvyAeuR 1SIa5tT7cQ0l629rlj4OjlbJex24rzfZV+05pl4cbPGAOtMK3OhM6mQkt4Q7Wq+aW7Br aL7uLuje14HTkh+g3YP7TCiF8nyGCjR+57n8+GZndLH46uVmHzRCG1BqkRwntINPol4U Mj9EMaASWnfw0I/da8xK1/ckm1I05RNe7bYNEg7+Z4FmsA/fNg/aFaeOvE7fnjpFPEQn Wu8WkCP9MuQfetMR6VRj2xLu1NFgujmNP/1YmY0GYMP6pPxtO+QkNxqlSdIRVFzBiwe/ jMtQ== X-Gm-Message-State: ALoCoQn6LggT+9XvmN8qTjrzWkRoM7W2rBLe6T8C5tARu2ROXldXbIz6Fu+aUcBE9dp92rapCTHq X-Received: by 10.66.121.65 with SMTP id li1mr36848406pab.128.1411796157368; Fri, 26 Sep 2014 22:35:57 -0700 (PDT) Received: from molino.home.network (c-24-19-133-29.hsd1.wa.comcast.net. [24.19.133.29]) by mx.google.com with ESMTPSA id n3sm6510499pdl.5.2014.09.26.22.35.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Sep 2014 22:35:56 -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 v3 1/2] Return a value from printk_ratelimited Date: Fri, 26 Sep 2014 22:36:48 -0700 Message-Id: X-Mailer: git-send-email 2.1.1 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.8 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 Acked-by: Paul E. McKenney --- 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..89bb7ab 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_printk_ratelimited = 0; \ static DEFINE_RATELIMIT_STATE(_rs, \ DEFAULT_RATELIMIT_INTERVAL, \ DEFAULT_RATELIMIT_BURST); \ \ if (__ratelimit(&_rs)) \ - printk(fmt, ##__VA_ARGS__); \ + __ret_printk_ratelimited = printk(fmt, ##__VA_ARGS__); \ + __ret_printk_ratelimited; \ }) #else #define printk_ratelimited(fmt, ...) \