All of lore.kernel.org
 help / color / mirror / Atom feed
From: Subhash Jadavani <subhashj@codeaurora.org>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: linux-scsi@vger.kernel.org,
	"James E. J. Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Vinayak Holikatti <vinholikatti@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org, Wolfram Sang <wsa@the-dreams.de>,
	linux-scsi-owner@vger.kernel.org
Subject: Re: [PATCH 2/3] scsi: ufs: Delete an error message for a failed memory allocation in ufshcd_memory_alloc()
Date: Wed, 26 Apr 2017 10:57:31 -0700	[thread overview]
Message-ID: <019b6365c15b0764c156d6453648f7a2@codeaurora.org> (raw)
In-Reply-To: <3d355c13-159a-2570-9ead-af93ad95c210@users.sourceforge.net>

On 2017-04-25 13:28, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 25 Apr 2017 21:50:43 +0200
> 
> The script "checkpatch.pl" pointed information out like the following.
> 
> WARNING: Possible unnecessary 'out of memory' message
> 
> Thus remove such a statement here.
> 
> Link:
> http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/scsi/ufs/ufshcd.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index ce385911a20e..5216e33e61a3 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -3274,8 +3274,7 @@ static int ufshcd_memory_alloc(struct ufs_hba 
> *hba)
>  				GFP_KERNEL);
> -	if (!hba->lrb) {
> -		dev_err(hba->dev, "LRB Memory allocation failed\n");
> +	if (!hba->lrb)
>  		goto out;
> -	}
> +
>  	return 0;
>  out:
>  	return -ENOMEM;

Looks good to me.
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>

PS: ufshcd_memory_alloc() also does some DMA coherent memory allocation 
(via dmam_alloc_coherent() APIs) and tries to print out the message on 
allocation failure. Although i don't know "out of memory" messages will 
be printed out by dmam_alloc_coherent() APIs or not. If it does print it 
out then we might want to remove our local memory allocation failure log 
messages.


-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

WARNING: multiple messages have this Message-ID (diff)
From: Subhash Jadavani <subhashj@codeaurora.org>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: linux-scsi@vger.kernel.org,
	"James E. J. Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Vinayak Holikatti <vinholikatti@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org, Wolfram Sang <wsa@the-dreams.de>,
	linux-scsi-owner@vger.kernel.org
Subject: Re: [PATCH 2/3] scsi: ufs: Delete an error message for a failed memory allocation in ufshcd_memory_a
Date: Wed, 26 Apr 2017 17:57:31 +0000	[thread overview]
Message-ID: <019b6365c15b0764c156d6453648f7a2@codeaurora.org> (raw)
In-Reply-To: <3d355c13-159a-2570-9ead-af93ad95c210@users.sourceforge.net>

On 2017-04-25 13:28, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 25 Apr 2017 21:50:43 +0200
> 
> The script "checkpatch.pl" pointed information out like the following.
> 
> WARNING: Possible unnecessary 'out of memory' message
> 
> Thus remove such a statement here.
> 
> Link:
> http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/scsi/ufs/ufshcd.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index ce385911a20e..5216e33e61a3 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -3274,8 +3274,7 @@ static int ufshcd_memory_alloc(struct ufs_hba 
> *hba)
>  				GFP_KERNEL);
> -	if (!hba->lrb) {
> -		dev_err(hba->dev, "LRB Memory allocation failed\n");
> +	if (!hba->lrb)
>  		goto out;
> -	}
> +
>  	return 0;
>  out:
>  	return -ENOMEM;

Looks good to me.
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>

PS: ufshcd_memory_alloc() also does some DMA coherent memory allocation 
(via dmam_alloc_coherent() APIs) and tries to print out the message on 
allocation failure. Although i don't know "out of memory" messages will 
be printed out by dmam_alloc_coherent() APIs or not. If it does print it 
out then we might want to remove our local memory allocation failure log 
messages.


-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2017-04-26 17:57 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25 20:24 [PATCH 0/3] SCSI-UFSHCD: Fine-tuning for two function implementations SF Markus Elfring
2017-04-25 20:24 ` SF Markus Elfring
2017-04-25 20:26 ` [PATCH 1/3] scsi: ufs: Use devm_kcalloc() in ufshcd_memory_alloc() SF Markus Elfring
2017-04-25 20:26   ` SF Markus Elfring
2017-04-26 17:52   ` Subhash Jadavani
2017-04-26 17:52     ` Subhash Jadavani
2017-04-25 20:28 ` [PATCH 2/3] scsi: ufs: Delete an error message for a failed memory allocation " SF Markus Elfring
2017-04-25 20:28   ` [PATCH 2/3] scsi: ufs: Delete an error message for a failed memory allocation in ufshcd_memory_alloc SF Markus Elfring
2017-04-26 17:57   ` Subhash Jadavani [this message]
2017-04-26 17:57     ` [PATCH 2/3] scsi: ufs: Delete an error message for a failed memory allocation in ufshcd_memory_a Subhash Jadavani
2017-04-26 18:11     ` scsi: ufs: Delete an error message for a failed memory allocation in ufshcd_memory_alloc() SF Markus Elfring
2017-04-26 18:11       ` SF Markus Elfring
2017-04-26 18:27     ` [PATCH 2/3] " Joe Perches
2017-04-26 18:27       ` [PATCH 2/3] scsi: ufs: Delete an error message for a failed memory allocation in ufshcd_memory_a Joe Perches
2017-04-26 18:50       ` Checking error messages for failed memory allocations SF Markus Elfring
2017-04-26 18:50         ` SF Markus Elfring
2017-04-26 19:05         ` Joe Perches
2017-04-26 19:05           ` Joe Perches
2017-04-26 19:14           ` SF Markus Elfring
2017-04-26 19:14             ` SF Markus Elfring
2017-08-26 11:17       ` scsi: ufs: Delete an error message for a failed memory allocation in ufshcd_memory_alloc() SF Markus Elfring
2017-08-26 11:17         ` SF Markus Elfring
2017-04-25 20:30 ` [PATCH 3/3] scsi: ufs: Delete an unnecessary return statement in ufshcd_exception_event_handler() SF Markus Elfring
2017-04-25 20:30   ` SF Markus Elfring
2017-04-26 17:59   ` Subhash Jadavani
2017-04-26 17:59     ` [PATCH 3/3] scsi: ufs: Delete an unnecessary return statement in ufshcd_exception_event_handler( Subhash Jadavani

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=019b6365c15b0764c156d6453648f7a2@codeaurora.org \
    --to=subhashj@codeaurora.org \
    --cc=elfring@users.sourceforge.net \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi-owner@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=vinholikatti@gmail.com \
    --cc=wsa@the-dreams.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.