Linux-HyperV List
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu@kernel.org>
To: Matheus Castello <matheus@castello.eng.br>
Cc: kys@microsoft.com, haiyangz@microsoft.com,
	sthemmin@microsoft.com, wei.liu@kernel.org, sashal@kernel.org,
	Tianyu.Lan@microsoft.com, decui@microsoft.com,
	mikelley@microsoft.com, sunilmut@microsoft.com,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/6] drivers: hv: vmbus: Fix unnecessary OOM_MESSAGE
Date: Mon, 16 Nov 2020 11:21:48 +0000	[thread overview]
Message-ID: <20201116112148.xfajvts4gtoibs65@liuwe-devbox-debian-v2> (raw)
In-Reply-To: <20201115195734.8338-6-matheus@castello.eng.br>

On Sun, Nov 15, 2020 at 04:57:33PM -0300, Matheus Castello wrote:
> Fixed checkpatch warning: Possible unnecessary 'out of memory' message
> checkpatch(OOM_MESSAGE)
> 
> Signed-off-by: Matheus Castello <matheus@castello.eng.br>
> ---
>  drivers/hv/vmbus_drv.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> index 09d8236a51cf..774b88dd0e15 100644
> --- a/drivers/hv/vmbus_drv.c
> +++ b/drivers/hv/vmbus_drv.c
> @@ -1989,10 +1989,8 @@ struct hv_device *vmbus_device_create(const guid_t *type,
>  	struct hv_device *child_device_obj;
> 
>  	child_device_obj = kzalloc(sizeof(struct hv_device), GFP_KERNEL);
> -	if (!child_device_obj) {
> -		pr_err("Unable to allocate device object for child device\n");
> +	if (!child_device_obj)

The generic OOM message would give you a stack dump but not as specific
/ clear as the message you deleted.

Also, the original intent of this check was to check for things like

    printk("Out of memory");

which was clearly redundant. The message we print here is not that.

See https://lkml.org/lkml/2014/6/10/382 .

Wei.

>  		return NULL;
> -	}
> 
>  	child_device_obj->channel = channel;
>  	guid_copy(&child_device_obj->dev_type, type);
> --
> 2.28.0
> 

  reply	other threads:[~2020-11-16 12:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-15 19:57 [PATCH 0/6] Add improvements suggested by checkpatch for vmbus_drv Matheus Castello
2020-11-15 19:57 ` [PATCH 1/6] drivers: hv: Fix hyperv_record_panic_msg path on comment Matheus Castello
2020-11-15 22:11   ` Michael Kelley
2020-11-15 19:57 ` [PATCH 2/6] drivers: hv: vmbus: Replace symbolic permissions by octal permissions Matheus Castello
2020-11-15 22:15   ` Michael Kelley
2020-11-15 19:57 ` [PATCH 3/6] drivers: hv: vmbus: Fix checkpatch LINE_SPACING Matheus Castello
2020-11-15 22:16   ` Michael Kelley
2020-11-15 19:57 ` [PATCH 4/6] drivers: hv: vmbus: Fix checkpatch SPLIT_STRING Matheus Castello
2020-11-15 22:25   ` Michael Kelley
2020-11-25  0:54     ` Matheus Castello
2020-11-25  2:56       ` Joe Perches
2020-11-25  3:14         ` Matheus Castello
2020-11-15 19:57 ` [PATCH 5/6] drivers: hv: vmbus: Fix unnecessary OOM_MESSAGE Matheus Castello
2020-11-16 11:21   ` Wei Liu [this message]
2020-11-16 15:58     ` Wei Liu
2020-11-15 19:57 ` [PATCH 6/6] drivers: hv: vmbus: Fix call msleep using < 20ms Matheus Castello
2020-11-15 22:32   ` Michael Kelley
2020-11-17 10:58 ` [PATCH 0/6] Add improvements suggested by checkpatch for vmbus_drv Wei Liu
2020-11-25  0:53   ` Matheus Castello

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=20201116112148.xfajvts4gtoibs65@liuwe-devbox-debian-v2 \
    --to=wei.liu@kernel.org \
    --cc=Tianyu.Lan@microsoft.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matheus@castello.eng.br \
    --cc=mikelley@microsoft.com \
    --cc=sashal@kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=sunilmut@microsoft.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