From patchwork Thu Feb 2 21:33:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 9553251 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8A58A60405 for ; Thu, 2 Feb 2017 21:33:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7BF3B28499 for ; Thu, 2 Feb 2017 21:33:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F6EA284BC; Thu, 2 Feb 2017 21:33:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14F4E28499 for ; Thu, 2 Feb 2017 21:33:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751866AbdBBVdj (ORCPT ); Thu, 2 Feb 2017 16:33:39 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:33315 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751298AbdBBVdi (ORCPT ); Thu, 2 Feb 2017 16:33:38 -0500 Received: by mail-lf0-f65.google.com with SMTP id x1so50119lff.0 for ; Thu, 02 Feb 2017 13:33:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xirNpgtIdyeiX0PzdrM/wBlGVF2rYoVU0cLXa1824vM=; b=hKXfIiuTzUyzJdmtMFR1fjpFy6Vb6cZs5qzcdBOHVPzAc8K6xEDTMMGOyaHtwsQvDg C5Az8qW88nLBCzLI72Wu6y6uSLO9sRB08DiE8mlCi/qSTk0BKxic0Fe3uW0PgrrTRYL4 BRYkvwT2JcFdgDXmpGU6unm0lD8NueJZeMK1nJ4104plwBzZjMoHnw7AklKTxkVF7KbN IoUuXIWgN3pb6VsEbtfAS3f6lUWLP1NnEYP/htw7jXb0++U5zG+AVlEI3Y+wboGOZmm8 jPEZWV38SvlfjzP11OAMdktd4r33d3xI0ilaZ3r/1pxjC0GiBpvOLKHjgmGDTDxaTXur uvzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xirNpgtIdyeiX0PzdrM/wBlGVF2rYoVU0cLXa1824vM=; b=rjnfhJ6Q3O+y+/8JSvZVoJF0uJkhteu9MQzj98ML1zIqsrgBZRjjgls6ZeIpvMl2W+ qjYhoG2J7F8ZJFchpFSnY17LjNhWAh7U9b8hdA42NcALax0JkYk9G4T0pqNUVEHQf2yz ohLOMQJjj3StWWYo5xfkzBFpAaet6y1CNviln947BROiliOQSJZplYuW0L1p5a42TqeD ZJpQ/lovvMcIrj5ISIkdKmzho8rZ+Rsk2RjTudR/vODlPcicXGmjf9Mc/8C9WCX8ike+ jHHPNWxVPCeU+a0kr1+rXUxxLw2vn2pczz4lWmKW2whrL+XJ5j7QpkxhNxQ666l9jBjm +hLQ== X-Gm-Message-State: AIkVDXIUIQd9F+pUoekLYsjqrjrlHPQSxS7XwjOoRC0tmTFSRft799PwamZo3nlmJv2r7g== X-Received: by 10.25.193.21 with SMTP id r21mr3791781lff.103.1486071217157; Thu, 02 Feb 2017 13:33:37 -0800 (PST) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id 1sm2590003ljv.40.2017.02.02.13.33.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Feb 2017 13:33:36 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Pieter-Paul Giesberts , Franky Lin , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH V3 2/9] brcmfmac: switch to C function (__brcmf_err) for printing errors Date: Thu, 2 Feb 2017 22:33:14 +0100 Message-Id: <20170202213321.11591-2-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170202213321.11591-1-zajec5@gmail.com> References: <20170202213321.11591-1-zajec5@gmail.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafał Miłecki This will allow extending code and using more detailed messages e.g. with the help of dev_err. Signed-off-by: Rafał Miłecki Acked-by: Arend van Spriel --- V3: Keep IS_ENABLED check in the macro as suggested by Felix --- .../net/wireless/broadcom/brcm80211/brcmfmac/common.c | 16 ++++++++++++++++ drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h | 6 +++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c index f7c8c2e80349..33b133f7e63a 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c @@ -218,6 +218,22 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp) return err; } +#ifndef CONFIG_BRCM_TRACING +void __brcmf_err(const char *func, const char *fmt, ...) +{ + struct va_format vaf; + va_list args; + + va_start(args, fmt); + + vaf.fmt = fmt; + vaf.va = &args; + pr_err("%s: %pV", func, &vaf); + + va_end(args); +} +#endif + #if defined(CONFIG_BRCM_TRACING) || defined(CONFIG_BRCMDBG) void __brcmf_dbg(u32 level, const char *func, const char *fmt, ...) { diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h index 1fe4aa973a92..441a6661eac0 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h @@ -45,6 +45,8 @@ #undef pr_fmt #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +__printf(2, 3) +void __brcmf_err(const char *func, const char *fmt, ...); #ifndef CONFIG_BRCM_TRACING /* Macro for error messages. net_ratelimit() is used when driver * debugging is not selected. When debugging the driver error @@ -53,11 +55,9 @@ #define brcmf_err(fmt, ...) \ do { \ if (IS_ENABLED(CONFIG_BRCMDBG) || net_ratelimit()) \ - pr_err("%s: " fmt, __func__, ##__VA_ARGS__); \ + __brcmf_err(__func__, fmt, ##__VA_ARGS__); \ } while (0) #else -__printf(2, 3) -void __brcmf_err(const char *func, const char *fmt, ...); #define brcmf_err(fmt, ...) \ __brcmf_err(__func__, fmt, ##__VA_ARGS__) #endif