[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201116155837.7mzaijtfpvmrnkve@liuwe-devbox-debian-v2>
Date: Mon, 16 Nov 2020 15:58:37 +0000
From: Wei Liu <wei.liu@...nel.org>
To: Matheus Castello <matheus@...tello.eng.br>
Cc: kys@...rosoft.com, haiyangz@...rosoft.com, sthemmin@...rosoft.com,
wei.liu@...nel.org, sashal@...nel.org, Tianyu.Lan@...rosoft.com,
decui@...rosoft.com, mikelley@...rosoft.com,
sunilmut@...rosoft.com, linux-hyperv@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/6] drivers: hv: vmbus: Fix unnecessary OOM_MESSAGE
On Mon, Nov 16, 2020 at 11:21:48AM +0000, Wei Liu wrote:
> 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@...tello.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 .
>
In case my message is not clear, I think this pr_err should stay. ;-)
Wei.
Powered by blists - more mailing lists