mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Yu Kuai <yukuai3@huawei.com>,
	josef@toxicpanda.com, axboe@kernel.dk, ming.lei@redhat.com
Cc: linux-block@vger.kernel.org, nbd@other.debian.org,
	linux-kernel@vger.kernel.org, yi.zhang@huawei.com
Subject: Re: [PATCH -next v2 6/6] nbd: use pr_err to output error message
Date: Wed, 18 May 2022 11:12:11 -0700	[thread overview]
Message-ID: <f0acebb66b9b46ad472e0d0989dc0f5810cac3dd.camel@perches.com> (raw)
In-Reply-To: <20220518122618.1702997-7-yukuai3@huawei.com>

On Wed, 2022-05-18 at 20:26 +0800, Yu Kuai wrote:
> Instead of using the long printk(KERN_ERR "nbd: ...") to
> output error message, defining pr_fmt and using
> the short pr_err("") to do that. The replacemen is done
> by using the following command:
> 
>   sed -i 's/printk(KERN_ERR "nbd: /pr_err("/g' \
> 		  drivers/block/nbd.c

It's also good to rewrap to 80 columns where possible.

> diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
[]
> @@ -2130,13 +2130,13 @@ static int nbd_genl_disconnect(struct sk_buff *skb, struct genl_info *info)
>  	nbd = idr_find(&nbd_index_idr, index);
>  	if (!nbd) {
>  		mutex_unlock(&nbd_index_mutex);
> -		printk(KERN_ERR "nbd: couldn't find device at index %d\n",
> +		pr_err("couldn't find device at index %d\n",
>  		       index);

like here

>  		return -EINVAL;
>  	}
>  	if (!refcount_inc_not_zero(&nbd->refs)) {
>  		mutex_unlock(&nbd_index_mutex);
> -		printk(KERN_ERR "nbd: device at index %d is going down\n",
> +		pr_err("device at index %d is going down\n",
>  		       index);

and here and below...

> @@ -2170,7 +2170,7 @@ static int nbd_genl_reconfigure(struct sk_buff *skb, struct genl_info *info)
>  	nbd = idr_find(&nbd_index_idr, index);
>  	if (!nbd) {
>  		mutex_unlock(&nbd_index_mutex);
> -		printk(KERN_ERR "nbd: couldn't find a device at index %d\n",
> +		pr_err("couldn't find a device at index %d\n",
>  		       index);
>  		return -EINVAL;
>  	}
> @@ -2192,7 +2192,7 @@ static int nbd_genl_reconfigure(struct sk_buff *skb, struct genl_info *info)
>  	}
>  	if (!refcount_inc_not_zero(&nbd->refs)) {
>  		mutex_unlock(&nbd_index_mutex);
> -		printk(KERN_ERR "nbd: device at index %d is going down\n",
> +		pr_err("device at index %d is going down\n",
>  		       index);
>  		return -EINVAL;
>  	}



  reply	other threads:[~2022-05-18 18:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18 12:26 [PATCH -next v2 0/6] nbd: bugfix and cleanup patches Yu Kuai
2022-05-18 12:26 ` [PATCH -next v2 1/6] nbd: call genl_unregister_family() first in nbd_cleanup() Yu Kuai
2022-05-18 12:26 ` [PATCH -next v2 2/6] nbd: fix race between nbd_alloc_config() and module removal Yu Kuai
2022-05-18 12:26 ` [PATCH -next v2 3/6] nbd: don't clear 'NBD_CMD_INFLIGHT' flag if request is not completed Yu Kuai
2022-05-18 12:26 ` [PATCH -next v2 4/6] nbd: fix io hung while disconnecting device Yu Kuai
2022-05-18 12:26 ` [PATCH -next v2 5/6] nbd: fix possible overflow on 'first_minor' in nbd_dev_add() Yu Kuai
2022-05-18 12:26 ` [PATCH -next v2 6/6] nbd: use pr_err to output error message Yu Kuai
2022-05-18 18:12   ` Joe Perches [this message]
2022-05-19  1:06     ` yukuai (C)

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=f0acebb66b9b46ad472e0d0989dc0f5810cac3dd.camel@perches.com \
    --to=joe@perches.com \
    --cc=axboe@kernel.dk \
    --cc=josef@toxicpanda.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=nbd@other.debian.org \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai3@huawei.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®