From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Simon Geis <simon.geis@fau.de>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>,
Thomas Gleixner <tglx@linutronix.de>,
Colin Ian King <colin.king@canonical.com>,
Adam Zerella <adam.zerella@gmail.com>,
linux-kernel@vger.kernel.org, linux-kernel@i4.cs.fau.de,
Lukas Panzer <lukas.panzer@fau.de>
Subject: Re: [PATCH v2 01/10] PCMCIA/i82092: use dev_<level> instead of printk
Date: Tue, 10 Dec 2019 13:49:02 +0100 [thread overview]
Message-ID: <20191210124902.GA3810481@kroah.com> (raw)
In-Reply-To: <20191210114333.12239-2-simon.geis@fau.de>
On Tue, Dec 10, 2019 at 12:43:26PM +0100, Simon Geis wrote:
> Improve the log output by using the
> device-aware dev_err()/dev_info() functions. While at it, update one
> remaining printk(KERN_ERR ...) call to the preferred pr_err() call.
>
> Co-developed-by: Lukas Panzer <lukas.panzer@fau.de>
> Signed-off-by: Lukas Panzer <lukas.panzer@fau.de>
> Signed-off-by: Simon Geis <simon.geis@fau.de>
>
> ---
> drivers/pcmcia/i82092.c | 79 ++++++++++++++++++++++++++++++-----------
> 1 file changed, 58 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
> index aad8a46605be..ba33293b1a34 100644
> --- a/drivers/pcmcia/i82092.c
> +++ b/drivers/pcmcia/i82092.c
> @@ -92,11 +92,13 @@ static int i82092aa_pci_probe(struct pci_dev *dev, const struct pci_device_id *i
> break;
>
> default:
> - printk(KERN_ERR "i82092aa: Oops, you did something we didn't think of.\n");
> + dev_err(&dev->dev,
> + "i82092aa: Oops, you did something we didn't think of.\n");
You already know the device and driver type (it comes built-into the
dev_err() message), so there's no need to keep the i82092aa everywhere
here, right?
> @@ -417,7 +422,9 @@ static int i82092aa_init(struct pcmcia_socket *sock)
>
> static int i82092aa_get_status(struct pcmcia_socket *socket, u_int *value)
> {
> - unsigned int sock = container_of(socket, struct socket_info, socket)->number;
> + struct socket_info *sock_info = container_of(socket, struct socket_info,
> + socket);
> + unsigned int sock = sock_info->number;
This does not look like a printk cleanup :(
> unsigned int status;
>
> enter("i82092aa_get_status");
> @@ -458,7 +465,9 @@ static int i82092aa_get_status(struct pcmcia_socket *socket, u_int *value)
>
> static int i82092aa_set_socket(struct pcmcia_socket *socket, socket_state_t *state)
> {
> - unsigned int sock = container_of(socket, struct socket_info, socket)->number;
> + struct socket_info *sock_info = container_of(socket, struct socket_info,
> + socket);
> + unsigned int sock = sock_info->number;
Nor does this :(
> -/* printk("set_io_map: Setting range to %x - %x \n",io->start,io->stop); */
> +/* dev_info(&sock_info->dev->dev,
> + * "set_io_map: Setting range to %x - %x\n",
> + * io->start, io->stop);
> + */
Just delete commented out lines.
> -/* printk("set_mem_map: Setting map %i range to %x - %x on socket %i, speed is %i, active = %i \n",map, region.start,region.end,sock,mem->speed,mem->flags & MAP_ACTIVE); */
> +/* dev_info(&sock_info->dev->dev,
> + * "set_mem_map: Setting map %i range to %x - %x on socket %i, "
> + * "speed is %i, active = %i\n", map,
> + * region.start, region.end, sock,mem->speed,
> + * mem->flags & MAP_ACTIVE);
> + */
same here.
> /* write the start address */
> base = I365_MEM(map);
> @@ -669,10 +700,16 @@ static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_
> if (mem->flags & MAP_WRPROT)
> i |= I365_MEM_WRPROT;
> if (mem->flags & MAP_ATTRIB) {
> -/* printk("requesting attribute memory for socket %i\n",sock);*/
> +/* dev_info(&sock_info->dev->dev,
> + * "requesting attribute memory for socket %i\n",
> + * sock);
> + */
And here and elsewhere. They were just debugging lines.
thanks,
greg k-h
next prev parent reply other threads:[~2019-12-10 12:49 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 11:43 [PATCH v2 00/10] PCMCIA/i82092: Fix style issues in i82092.c Simon Geis
2019-12-10 11:43 ` [PATCH v2 01/10] PCMCIA/i82092: use dev_<level> instead of printk Simon Geis
2019-12-10 12:49 ` Greg Kroah-Hartman [this message]
2019-12-10 13:25 ` Dominik Brodowski
2019-12-10 11:43 ` [PATCH v2 02/10] PCMCIA/i82092: add/remove spaces to improve readability Simon Geis
2019-12-10 11:43 ` [PATCH v2 03/10] PCMCIA/i82092: remove braces around single statement blocks Simon Geis
2019-12-10 11:43 ` [PATCH v2 04/10] PCMCIA/i82092: insert blank line after declarations Simon Geis
2019-12-10 11:43 ` [PATCH v2 05/10] PCMCIA/i82092: change code indentation Simon Geis
2019-12-10 11:43 ` [PATCH v2 06/10] PCMCIA/i82092: move assignment out of if condition Simon Geis
2019-12-10 11:43 ` [PATCH v2 07/10] PCMCIA/i82092: shorten the lines with over 80 characters Simon Geis
2019-12-10 11:43 ` [PATCH v2 08/10] PCMCIA/i82092: include <linux/io.h> instead of <asm/io.h> Simon Geis
2019-12-10 11:43 ` [PATCH v2 09/10] PCMCIA/i82092: improve enter/leave macro Simon Geis
2019-12-10 12:51 ` Greg Kroah-Hartman
2019-12-10 11:43 ` [PATCH v2 10/10] PCMCIA/i82092: remove #if 0 block Simon Geis
2019-12-12 14:27 ` [PATCH v2 00/10] PCMCIA/i82092: Fix style issues in i82092.c Dominik Brodowski
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=20191210124902.GA3810481@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=adam.zerella@gmail.com \
--cc=colin.king@canonical.com \
--cc=linux-kernel@i4.cs.fau.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
--cc=lukas.panzer@fau.de \
--cc=simon.geis@fau.de \
--cc=tglx@linutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.