public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Kaaira Gupta <kgupta@es.iitr.ac.in>,
	Manish Chopra <manishc@marvell.com>,
	GR-Linux-NIC-Dev@marvell.com,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	netdev@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] staging: qlge: emit debug and dump at same level
Date: Sun, 23 Feb 2020 15:50:43 -0800	[thread overview]
Message-ID: <cba75ee4d88afdf118631510ad0f971e42c1a31c.camel@perches.com> (raw)
In-Reply-To: <20200223173132.GA13649@kaaira-HP-Pavilion-Notebook>

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_<LEVEL>
[]
> 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.



      reply	other threads:[~2020-02-23 23:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-23 17:31 [PATCH v3] staging: qlge: emit debug and dump at same level Kaaira Gupta
2020-02-23 23:50 ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cba75ee4d88afdf118631510ad0f971e42c1a31c.camel@perches.com \
    --to=joe@perches.com \
    --cc=GR-Linux-NIC-Dev@marvell.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kgupta@es.iitr.ac.in \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manishc@marvell.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox