Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp737480ybv; Sat, 22 Feb 2020 13:51:46 -0800 (PST) X-Google-Smtp-Source: APXvYqxQz4bcKLVRj5FMaw+NjKJzSnXV3PZimPSusINlbBW2T+jBpDnNpxNadKWj6J/IDSUVshJU X-Received: by 2002:a9d:6b91:: with SMTP id b17mr32434888otq.235.1582408306471; Sat, 22 Feb 2020 13:51:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582408306; cv=none; d=google.com; s=arc-20160816; b=pZCHjAmC9t8tnEYdMdq1voQWVUm3Et2ouGNrHbVlpprxsxWw3+juQLbEIYUInfUov4 JTl87nQ9WMiuYzfpmW9E+NHm/dr10FpDtr5LQgeAsyLQ2ExKjJsawvMh+vSHkgwnbGLJ KJBxCDRA0uTaDW++5BWtogRyrFkAfgU/YTxZbq62Xs3dw1D8QHB9h9IhxgavC8VIxLYI l6CaIazoOeUWjz3tLsv6jbsqOkmaezhlosc4B32OzyyydsW0vMWhV0+lgVG3lGdssOS+ Q9FdEKauLk1cS8f8ibU5svGHAnmejLpeslPd/JIu0bqifdXSNu+gggnKR0IpfF4PsAKJ Zx6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=HBCqjg0a+bhil4nBIBy5bJmpduFEbhGT3Aouisb2vJA=; b=ZpchWEnQ7c3Ock6cztiFub4M5w+No7RI2mV0wdFBpmsbhIqPAejg5mJu1KxOrSNA0W cM59R8ZR7gbEJx2DWVwNXwO02PnvsZ8PMTXXSd/K7tPqZiTrNQYteh/cGjAlx6F9qyFm xjemj/qCpOr0Jbw0l/6bba/kHtle4jgwhjzIzlqJSV2mhYBK1GJOINO6Uu3mLsoUbfwp nG8RA5frIoue5ENsSOXjV+Q/F7ATXVty05I7HH+V8lJ8RZ03T+rS2WRBRLFRUylHH3es mQlq17rdNptY5fJz81VqQhyzTqiNJ5G3bI5kDDy36DQXmHZp+85q0XAeJKeyRN2saaiL 09ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@es-iitr-ac-in.20150623.gappssmtp.com header.s=20150623 header.b=lMUystim; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iitr.ac.in Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j71si2802916oib.213.2020.02.22.13.51.26; Sat, 22 Feb 2020 13:51:46 -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; dkim=pass header.i=@es-iitr-ac-in.20150623.gappssmtp.com header.s=20150623 header.b=lMUystim; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iitr.ac.in Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726865AbgBVVvT (ORCPT + 99 others); Sat, 22 Feb 2020 16:51:19 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:37096 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726828AbgBVVvS (ORCPT ); Sat, 22 Feb 2020 16:51:18 -0500 Received: by mail-pl1-f193.google.com with SMTP id c23so2386474plz.4 for ; Sat, 22 Feb 2020 13:51:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=es-iitr-ac-in.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=HBCqjg0a+bhil4nBIBy5bJmpduFEbhGT3Aouisb2vJA=; b=lMUystimAw6OmezUONtF3S/Asq3N5V4IfXfMbTiTTOHzas3ksvIBM+MpZNJM5D9JF7 74eDu8fC9jCAlBLpsUZODamJ5JRFAp7hSz8uZXzc5N3logQGnFRr2fFjtkdbzDpNezW5 Cuj36DdAOEfpYeklXAJZEq93ks8JMbwTjTpMcEYiPYNnvN507bag4Xc0Ey/08+uF2kzM xZoawnbhTv+AP3wPizcMp+YIh2GuuSWsg3OcAlnsB4xYw7Ye05cizQWymJeIr3pCQ027 65/M3m9cotB7cTGXxVDlHVfx+ZyOM2JgRBirjDs0SpEYjH16RTRPISvdKexmaBZxdrJS G/yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=HBCqjg0a+bhil4nBIBy5bJmpduFEbhGT3Aouisb2vJA=; b=YRv5y5onHJuFMO9AZ+5DzsGQU35NuqOAyZzknvFC9JdxmcZcOpeYjq23Pn46dMJkaM 33ThHN6AMt1F6Q0Fg06zPJPIrxOMAmebHOhnwdQkPMaNtu/huUEnoWTqjlwGaQGJGoZm YtC/lIvlGHBxVDgZc1+hmhjNMOpulYmZRcXGhkI+nGon3R1+QekDD+DO5blNn3E7lnZa gIoCjPcQ18h0GDH9lPQdzD2kAyzo3glX6Z3h3lUk2sWEZ19HSNpsSnxDJBHe3qdsMLgv Am1tSyW5JAEmByDFA5ZfO1i8g+U+zBIB+YSTZCwUvUX06E4M/He/nSINJC+RVBmfurF9 YtiQ== X-Gm-Message-State: APjAAAU3+DXQgwqQ6H0PX6pbdCo4w2tjcw1DXhyw93nSutkm4SQWixcY /tAYZHrBJau7XU75P/x+dPVg2A== X-Received: by 2002:a17:90a:a617:: with SMTP id c23mr11647984pjq.32.1582408277086; Sat, 22 Feb 2020 13:51:17 -0800 (PST) Received: from kaaira-HP-Pavilion-Notebook ([103.37.201.177]) by smtp.gmail.com with ESMTPSA id f3sm7384821pfg.115.2020.02.22.13.51.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 Feb 2020 13:51:16 -0800 (PST) Date: Sun, 23 Feb 2020 03:21:09 +0530 From: Kaaira Gupta To: Manish Chopra , GR-Linux-NIC-Dev@marvell.com, Greg Kroah-Hartman , netdev@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] staging: qlge: emit debug and dump at same level Message-ID: <20200222215109.GA18727@kaaira-HP-Pavilion-Notebook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Write a macro QLGE_DUMP_DBG having a function print_hex_dump so that the debug and dump are emitted at the same KERN_ and code becomes simpler. Write a macro instead of calling the function directly in ql_mpi_core_to_log() to go according to the coding practices followed in other drivers such as nvec and vc04_services. Signed-off-by: Kaaira Gupta --- changes since v1: make code of ql_mpi_core_to_log() simpler. ---- --- drivers/staging/qlge/qlge_dbg.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index c7af2548d119..f4440670bc46 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -1,5 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#define QLGE_DUMP_DBG(str, buf, len) \ + print_hex_dump(KERN_DEBUG, str, DUMP_PREFIX_OFFSET, \ + 32, 4, buf, len, false) #include @@ -1324,27 +1327,9 @@ void ql_mpi_core_to_log(struct work_struct *work) { struct ql_adapter *qdev = container_of(work, struct ql_adapter, mpi_core_to_log.work); - u32 *tmp, count; - int i; - count = sizeof(struct ql_mpi_coredump) / sizeof(u32); - tmp = (u32 *)qdev->mpi_coredump; - netif_printk(qdev, drv, KERN_DEBUG, qdev->ndev, - "Core is dumping to log file!\n"); - - for (i = 0; i < count; i += 8) { - pr_err("%.08x: %.08x %.08x %.08x %.08x %.08x " - "%.08x %.08x %.08x\n", i, - tmp[i + 0], - tmp[i + 1], - tmp[i + 2], - tmp[i + 3], - tmp[i + 4], - tmp[i + 5], - tmp[i + 6], - tmp[i + 7]); - msleep(5); - } + QLGE_DUMP_DBG("Core is dumping to log file!\n", qdev->mpi_coredump, + sizeof(*qdev->mpi_coredump)); } #ifdef QL_REG_DUMP -- 2.17.1