From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4BE0C35670 for ; Sun, 23 Feb 2020 23:52:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BE31420836 for ; Sun, 23 Feb 2020 23:52:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727177AbgBWXwO (ORCPT ); Sun, 23 Feb 2020 18:52:14 -0500 Received: from smtprelay0085.hostedemail.com ([216.40.44.85]:46160 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726534AbgBWXwN (ORCPT ); Sun, 23 Feb 2020 18:52:13 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id D417018011E65; Sun, 23 Feb 2020 23:52:11 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: look71_876f7d9380335 X-Filterd-Recvd-Size: 2193 Received: from XPS-9350.home (unknown [47.151.143.254]) (Authenticated sender: joe@perches.com) by omf01.hostedemail.com (Postfix) with ESMTPA; Sun, 23 Feb 2020 23:52:10 +0000 (UTC) Message-ID: Subject: Re: [PATCH v3] staging: qlge: emit debug and dump at same level From: Joe Perches To: Kaaira Gupta , Manish Chopra , GR-Linux-NIC-Dev@marvell.com, Greg Kroah-Hartman , netdev@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Sun, 23 Feb 2020 15:50:43 -0800 In-Reply-To: <20200223173132.GA13649@kaaira-HP-Pavilion-Notebook> References: <20200223173132.GA13649@kaaira-HP-Pavilion-Notebook> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sun, 2020-02-23 at 23:01 +0530, Kaaira Gupta wrote: > Simplify code in ql_mpi_core_to_log() by calling print_hex_dump() > instead of existing functions so that the debug and dump are > emitted at the same KERN_ [] > Also, can you please help me understand how are are numbers 32 and 4 > chosen for the function print_hex_dump()? Emit 32 bytes per line in 4 byte chunks as u32 And below: > diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c [] > @@ -1324,27 +1324,10 @@ 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); [] > + print_hex_dump(KERN_DEBUG, "Core is dumping to log file!\n", > + DUMP_PREFIX_OFFSET, 32, 4, qdev->mpi_coredump, > + sizeof(*qdev->mpi_coredump), false); This use of a prefix string is not acceptable. >From the kernel-doc: /** * print_hex_dump - print a text hex dump to syslog for a binary blob of data * @level: kernel log level (e.g. KERN_DEBUG) * @prefix_str: string to prefix each line with; * caller supplies trailing spaces for alignment if desired So this would emit "Core is dumping..." line for for every line of hex output.