mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: rkir@google.com, gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, tkjos@google.com
Subject: Re: [PATCH 8/9] platform: goldfish: pipe: Replace pr_ with dev_ for logging
Date: Mon, 13 Aug 2018 18:30:04 -0700	[thread overview]
Message-ID: <702abadd074f1aefc8d4566c4da72284a5dd3ec6.camel@perches.com> (raw)
In-Reply-To: <20180813233839.190855-8-rkir@google.com>

On Mon, 2018-08-13 at 16:38 -0700, rkir@google.com wrote:
> dev_ is preferred if struct device is available.
[]
> diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c
[]
> @@ -384,6 +384,7 @@ static ssize_t goldfish_pipe_read_write(struct file *filp,
>  	int count = 0, ret = -EINVAL;
>  	unsigned long address, address_end, last_page;
>  	unsigned int last_page_size;
> +	struct device *pdev_dev;
>  
>  	/* If the emulator already closed the pipe, no need to go further */
>  	if (unlikely(test_bit(BIT_CLOSED_ON_HOST, &pipe->flags)))
> @@ -401,6 +402,8 @@ static ssize_t goldfish_pipe_read_write(struct file *filp,
>  	last_page = (address_end - 1) & PAGE_MASK;
>  	last_page_size = ((address_end - 1) & ~PAGE_MASK) + 1;
>  
> +	pdev_dev = pipe->dev->pdev_dev;
> +
>  	while (address < address_end) {
>  		s32 consumed_size;
>  		int status;
> @@ -433,7 +436,8 @@ static ssize_t goldfish_pipe_read_write(struct file *filp,
>  			 * err.
>  			 */
>  			if (status != PIPE_ERROR_AGAIN)
> -				pr_info_ratelimited("goldfish_pipe: backend error %d on %s\n",
> +				dev_err_ratelimited(pdev_dev,
> +					"goldfish_pipe: backend error %d on %s\n",
>  					status, is_write ? "write" : "read");
>  			break;
>  		}

Wouldn't it be simpler to use pipe->dev->pdev_dev here instead
of creating and assigning a probably unused use-once pointer?

What does the output look like now?

Is the "pipe->dev->pdev_dev->name" then "goldfish_pipe: " output
useful?


  reply	other threads:[~2018-08-14  1:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-13 23:38 [PATCH 1/9] platform: goldfish: pipe: Fix comments to fit 80 columns rkir
2018-08-13 23:38 ` [PATCH 2/9] platform: goldfish: pipe: Update license rkir
2018-08-13 23:38 ` [PATCH 3/9] platform: goldfish: pipe: Fix checkpatch warning rkir
2018-08-13 23:38 ` [PATCH 4/9] platform: goldfish: pipe: Separate the host interface to a separate header rkir
2018-08-13 23:38 ` [PATCH 5/9] platform: goldfish: pipe: Update the comment for GFP_ATOMIC rkir
2018-08-13 23:38 ` [PATCH 6/9] platform: goldfish: pipe: Fail compilation if structs are too large rkir
2018-08-14  1:48   ` Joe Perches
2018-08-14  3:47     ` Roman Kiryanov
2018-08-14  4:41       ` Joe Perches
2018-08-13 23:38 ` [PATCH 7/9] platform: goldfish: pipe: Replace an array of 1 with a variable rkir
2018-08-13 23:38 ` [PATCH 8/9] platform: goldfish: pipe: Replace pr_ with dev_ for logging rkir
2018-08-14  1:30   ` Joe Perches [this message]
2018-08-14  3:16   ` kbuild test robot
2018-08-14  1:35 ` [PATCH 1/9] platform: goldfish: pipe: Fix comments to fit 80 columns Joe Perches

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=702abadd074f1aefc8d4566c4da72284a5dd3ec6.camel@perches.com \
    --to=joe@perches.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rkir@google.com \
    --cc=tkjos@google.com \
    /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

all inboxes | Powered by JetHome®