Received: by 10.223.185.116 with SMTP id b49csp1030419wrg; Fri, 23 Feb 2018 10:38:23 -0800 (PST) X-Google-Smtp-Source: AH8x225LCvT58E9Yf/5JJB5iZ+7HaFWtqvfvyoC5VJv3SAjS8hyeBtctgA7d9mY/1YzLmqdgoNyl X-Received: by 2002:a17:902:aa43:: with SMTP id c3-v6mr2565165plr.357.1519411102969; Fri, 23 Feb 2018 10:38:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519411102; cv=none; d=google.com; s=arc-20160816; b=JRJ9dqCMsjBvRzZ2tTSBUs7RCL7ZTb83zPEnNF3kKPMk5Z+/cNvQVJpr4/P7/2UbOA 9v0ArFftvWyb9325BYy2GCrWmPsZOCwnKFfEJCLW8Ii3g/FPdRcP2iCJSgSGQyXMLjoG xo+vapJpqA+G2LCbXk2oGQjjwNqRsBK1L31o7v1HkPI3zFltZn+iin0O0FMSoDU+B8yo ymht3DQZrDXpQ38YYQYT0Sbu7y/OkMufwpSH8+j2cxugmfW0CrjFwh87gRyQvJ4VmkAO 1PkaGYf3QUYdBjgFiMBTb6g9ywsikDwgd2BHCK+LOPxu50D90T7lApS1XQnDwxaSm0Ea mQww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=LqLCFjZo1HKO+JvD90GzcEPQVeZhxU9/QJvvrrCXFP0=; b=Znv8a4GAQDfX5nQ/CTxy6YzD0Z+L5/QQdEowBx00myduuNxDCcON7jzlVYQ9bEvX2O +Diw/GIUTtrHzfUsHjSVLNQvg1RnflDAUEg7mWYYqHBR1MCv7sDkiuwLmZN7h5q4ezvo VCa/MkGFEDtwLcGsy21JeDjWRABLQb1J3gtOJ7axfnKIUaSEzkVdKA5Gb77raML6owta 9Fdg9VpnddBP3/l0VDVFi27/3x/KYz0vuh8SINBXf5uvrAtjEq/3yUpPGP1PhWANwfPF kylKAQ29T1yS290hNYgdzn2TiGH4zF7HGFSWhjR/QOqGPaOR+q/pqQ1guH8eRUkRFAZ0 r8mw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b14-v6si2128637pll.736.2018.02.23.10.38.07; Fri, 23 Feb 2018 10:38:22 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932182AbeBWShc (ORCPT + 99 others); Fri, 23 Feb 2018 13:37:32 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:38714 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754240AbeBWSha (ORCPT ); Fri, 23 Feb 2018 13:37:30 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 17EEFFA7; Fri, 23 Feb 2018 18:37:29 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Andrew Lunn , Dmitry Torokhov Subject: [PATCH 4.4 103/193] driver-core: use dev argument in dev_dbg_ratelimited stub Date: Fri, 23 Feb 2018 19:25:36 +0100 Message-Id: <20180223170342.087780611@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170325.997716448@linuxfoundation.org> References: <20180223170325.997716448@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit 1f62ff34a90471d1b735bac2c79e894afc7c59bc upstream. dev_dbg_ratelimited() is a macro that ignores its first argument when DEBUG is not set, which can lead to unused variable warnings: ethernet/mellanox/mlxsw/pci.c: In function 'mlxsw_pci_cqe_sdq_handle': ethernet/mellanox/mlxsw/pci.c:646:18: warning: unused variable 'pdev' [-Wunused-variable] ethernet/mellanox/mlxsw/pci.c: In function 'mlxsw_pci_cqe_rdq_handle': ethernet/mellanox/mlxsw/pci.c:671:18: warning: unused variable 'pdev' [-Wunused-variable] The macro already ensures that all its other arguments are silently ignored by the compiler without triggering a warning, through the use of the no_printk() macro, but the dev argument is not passed into that. This changes the definition to use the same trick as no_printk() with an if(0) that leads the compiler to not evaluate the side-effects but still see that 'dev' might not be unused. Signed-off-by: Arnd Bergmann Suggested-by: Andrew Lunn Fixes: 6f586e663e3b ("driver-core: Shut up dev_dbg_reatelimited() without DEBUG") Reviewed-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- include/linux/device.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/include/linux/device.h +++ b/include/linux/device.h @@ -1272,8 +1272,11 @@ do { \ dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \ } while (0) #else -#define dev_dbg_ratelimited(dev, fmt, ...) \ - no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#define dev_dbg_ratelimited(dev, fmt, ...) \ +do { \ + if (0) \ + dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \ +} while (0) #endif #ifdef VERBOSE_DEBUG