lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <702abadd074f1aefc8d4566c4da72284a5dd3ec6.camel@perches.com>
Date:   Mon, 13 Aug 2018 18:30:04 -0700
From:   Joe Perches <joe@...ches.com>
To:     rkir@...gle.com, gregkh@...uxfoundation.org
Cc:     linux-kernel@...r.kernel.org, tkjos@...gle.com
Subject: Re: [PATCH 8/9] platform: goldfish: pipe: Replace pr_ with dev_ for
 logging

On Mon, 2018-08-13 at 16:38 -0700, rkir@...gle.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?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ