From patchwork Mon Apr 10 09:09:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xinming Hu X-Patchwork-Id: 9672173 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 AC3AA600CB for ; Mon, 10 Apr 2017 09:09:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0B94283E2 for ; Mon, 10 Apr 2017 09:09:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 957AA28414; Mon, 10 Apr 2017 09:09:46 +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 2B7D6283E2 for ; Mon, 10 Apr 2017 09:09:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752939AbdDJJJo (ORCPT ); Mon, 10 Apr 2017 05:09:44 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33044 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751448AbdDJJJn (ORCPT ); Mon, 10 Apr 2017 05:09:43 -0400 Received: by mail-pf0-f194.google.com with SMTP id c198so5661997pfc.0 for ; Mon, 10 Apr 2017 02:09:43 -0700 (PDT) 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; bh=CkLm94ZLxUUpcCfs0T1PLEhym5Ahrove4P/SVpIFSFc=; b=dXSyf22+awybJ2JwBWQhytNNntlJ+K/I6Q9pwIiV6SvRwnS1dX1zr4iYb/cAWvsNNS RF8iMGDehrQ8Cp1OIx82pWWKhPfJ3KabpdXBcoQJ7bFP5oURb+KSr2rBrk/49lU9sfEp P7Id7fp6RHFbEuf/nNvkeF4HArAcOpaFwqU+S1JOseMsTQOLR0O2HcLPH/b27EGdPaYc UWje1K7ZZIsOrmwe15ODvwWQSqD0vwQwZlQrirDA5CqsZFYGx1aNmWOFhyvmf3wjUMyF 9OEInZ7rFT1ZHkZJB/oMmfswfDLxGTrKUG4prPrmUjLi4S60OaKM/aO1w+SDwirI3jQ6 sO8Q== 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; bh=CkLm94ZLxUUpcCfs0T1PLEhym5Ahrove4P/SVpIFSFc=; b=fgbNbLApm58MVZFsXOLySSUStj51FvyVnVS8IwCvPpmzLfHeWkrdCXbT1ZO3D5K4Yf dAYUQtqO1hQgVF+V5xow5tNiZwVvxdflHZBiBwVGEIkk7fXkFyFv6xWST7O3YXM7kVR9 3T3erwxozW2lJgIH8g/oXaZTo3jn8O8PldLgzawlFm2haaYyKXg9SCi3S8bEItfjKkTP GndkZwTlL+6dFDXRnGDwDNCA6Um0kk+kBQBFXVMkyU/5fLmY61pGuTGKFF7sOrd3x9VV 5nCvNp4aaJozLUBxyfc0QYN3ZJQ0izLDm/T86GHRRBxNLIz6fVbUb3wYrqwrx94ayaN+ Fv5A== X-Gm-Message-State: AFeK/H3CMJX9FN0yuquJV+w7GoUP7IEy/TsfFR69IF+5D7uL/zfzCurxo8/GgAOYeRqvYQ== X-Received: by 10.99.105.133 with SMTP id e127mr53317234pgc.104.1491815383030; Mon, 10 Apr 2017 02:09:43 -0700 (PDT) Received: from ubuntu.members.linode.com ([2400:8902::f03c:91ff:fee7:7cf1]) by smtp.gmail.com with ESMTPSA id 2sm23295344pfo.35.2017.04.10.02.09.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Apr 2017 02:09:42 -0700 (PDT) From: Xinming Hu To: Linux Wireless Cc: Kalle Valo , Brian Norris , Dmitry Torokhov , rajatja@google.com, Amitkumar Karwar , Cathy Luo , Xinming Hu Subject: [PATCH v3 2/4] mwifiex: fall back mwifiex_dbg to pr_info when adapter->dev not set Date: Mon, 10 Apr 2017 09:09:32 +0000 Message-Id: <1491815374-6555-2-git-send-email-huxinming820@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491815374-6555-1-git-send-email-huxinming820@gmail.com> References: <1491815374-6555-1-git-send-email-huxinming820@gmail.com> 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: Xinming Hu mwifiex_dbg will do nothing before adapter->dev get assigned. several logs lost in this case. it can be avoided by fall back to pr_info. Signed-off-by: Xinming Hu Reviewed-by: Brian Norris Reviewed-by: Dmitry Torokhov --- v2: enhance adapter->dev null case.(Brain) v3: use va_list in pr_info.(Dmitry) --- drivers/net/wireless/marvell/mwifiex/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index 98fd491..16cd14e 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -1750,7 +1750,7 @@ void _mwifiex_dbg(const struct mwifiex_adapter *adapter, int mask, struct va_format vaf; va_list args; - if (!adapter->dev || !(adapter->debug_mask & mask)) + if (!(adapter->debug_mask & mask)) return; va_start(args, fmt); @@ -1758,7 +1758,10 @@ void _mwifiex_dbg(const struct mwifiex_adapter *adapter, int mask, vaf.fmt = fmt; vaf.va = &args; - dev_info(adapter->dev, "%pV", &vaf); + if (adapter->dev) + dev_info(adapter->dev, "%pV", &vaf); + else + pr_info("%pV", &vaf); va_end(args); }