All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: ufs-exynos: Remove an unnecessary NULL check
@ 2020-06-26 10:51   ` Dan Carpenter
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2020-06-26 10:51 UTC (permalink / raw)
  To: Alim Akhtar
  Cc: Avri Altman, James E.J. Bottomley, Martin K. Petersen, Kukjin Kim,
	Krzysztof Kozlowski, Kiwoong Kim, Wei Yongjun, linux-scsi,
	linux-samsung-soc, linux-kernel, kernel-janitors

The "head" pointer can't be NULL because it points to an address in
the middle of a ufs_hba struct.  Looking at this code, probably someone
would wonder if the intent was to check whether "hba" is NULL, but "hba"
isn't NULL and the check can just be removed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/scsi/ufs/ufs-exynos.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c
index 16544b3dad47..802f7de626e8 100644
--- a/drivers/scsi/ufs/ufs-exynos.c
+++ b/drivers/scsi/ufs/ufs-exynos.c
@@ -264,7 +264,7 @@ static int exynos_ufs_get_clk_info(struct exynos_ufs *ufs)
 	u8 div = 0;
 	int ret = 0;
 
-	if (!head || list_empty(head))
+	if (list_empty(head))
 		goto out;
 
 	list_for_each_entry(clki, head, list) {
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] scsi: ufs: ufs-exynos: Remove an unnecessary NULL check
@ 2020-06-26 10:51   ` Dan Carpenter
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2020-06-26 10:51 UTC (permalink / raw)
  To: Alim Akhtar
  Cc: Avri Altman, James E.J. Bottomley, Martin K. Petersen, Kukjin Kim,
	Krzysztof Kozlowski, Kiwoong Kim, Wei Yongjun, linux-scsi,
	linux-samsung-soc, linux-kernel, kernel-janitors

The "head" pointer can't be NULL because it points to an address in
the middle of a ufs_hba struct.  Looking at this code, probably someone
would wonder if the intent was to check whether "hba" is NULL, but "hba"
isn't NULL and the check can just be removed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/scsi/ufs/ufs-exynos.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c
index 16544b3dad47..802f7de626e8 100644
--- a/drivers/scsi/ufs/ufs-exynos.c
+++ b/drivers/scsi/ufs/ufs-exynos.c
@@ -264,7 +264,7 @@ static int exynos_ufs_get_clk_info(struct exynos_ufs *ufs)
 	u8 div = 0;
 	int ret = 0;
 
-	if (!head || list_empty(head))
+	if (list_empty(head))
 		goto out;
 
 	list_for_each_entry(clki, head, list) {
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* RE: [PATCH] scsi: ufs: ufs-exynos: Remove an unnecessary NULL check
  2020-06-26 10:51   ` Dan Carpenter
@ 2020-06-27 17:33     ` Alim Akhtar
  -1 siblings, 0 replies; 10+ messages in thread
From: Alim Akhtar @ 2020-06-27 17:21 UTC (permalink / raw)
  To: 'Dan Carpenter'
  Cc: 'Avri Altman', 'James E.J. Bottomley',
	'Martin K. Petersen', 'Kukjin Kim',
	'Krzysztof Kozlowski', 'Kiwoong Kim',
	'Wei Yongjun', linux-scsi, linux-samsung-soc,
	linux-kernel, kernel-janitors

Hi Dan

> -----Original Message-----
> The "head" pointer can't be NULL because it points to an address in the
middle
> of a ufs_hba struct.  Looking at this code, probably someone would wonder
if
> the intent was to check whether "hba" is NULL, but "hba"
> isn't NULL and the check can just be removed.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
Please add Fixes: tag
With that
Acked-by: Alim Akhtar <alim.akhtar@samsung.com>

Thanks!

>  drivers/scsi/ufs/ufs-exynos.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c
index
> 16544b3dad47..802f7de626e8 100644
> --- a/drivers/scsi/ufs/ufs-exynos.c
> +++ b/drivers/scsi/ufs/ufs-exynos.c
> @@ -264,7 +264,7 @@ static int exynos_ufs_get_clk_info(struct exynos_ufs
> *ufs)
>  	u8 div = 0;
>  	int ret = 0;
> 
> -	if (!head || list_empty(head))
> +	if (list_empty(head))
>  		goto out;
> 
>  	list_for_each_entry(clki, head, list) {
> --
> 2.27.0



^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH] scsi: ufs: ufs-exynos: Remove an unnecessary NULL check
@ 2020-06-27 17:33     ` Alim Akhtar
  0 siblings, 0 replies; 10+ messages in thread
From: Alim Akhtar @ 2020-06-27 17:33 UTC (permalink / raw)
  To: 'Dan Carpenter'
  Cc: 'Avri Altman', 'James E.J. Bottomley',
	'Martin K. Petersen', 'Kukjin Kim',
	'Krzysztof Kozlowski', 'Kiwoong Kim',
	'Wei Yongjun', linux-scsi, linux-samsung-soc,
	linux-kernel, kernel-janitors

Hi Dan

> -----Original Message-----
> The "head" pointer can't be NULL because it points to an address in the
middle
> of a ufs_hba struct.  Looking at this code, probably someone would wonder
if
> the intent was to check whether "hba" is NULL, but "hba"
> isn't NULL and the check can just be removed.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
Please add Fixes: tag
With that
Acked-by: Alim Akhtar <alim.akhtar@samsung.com>

Thanks!

>  drivers/scsi/ufs/ufs-exynos.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c
index
> 16544b3dad47..802f7de626e8 100644
> --- a/drivers/scsi/ufs/ufs-exynos.c
> +++ b/drivers/scsi/ufs/ufs-exynos.c
> @@ -264,7 +264,7 @@ static int exynos_ufs_get_clk_info(struct exynos_ufs
> *ufs)
>  	u8 div = 0;
>  	int ret = 0;
> 
> -	if (!head || list_empty(head))
> +	if (list_empty(head))
>  		goto out;
> 
>  	list_for_each_entry(clki, head, list) {
> --
> 2.27.0

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] scsi: ufs: ufs-exynos: Remove an unnecessary NULL check
  2020-06-27 17:33     ` Alim Akhtar
@ 2020-06-27 17:54       ` Dan Carpenter
  -1 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2020-06-27 17:54 UTC (permalink / raw)
  To: Alim Akhtar
  Cc: 'Avri Altman', 'James E.J. Bottomley',
	'Martin K. Petersen', 'Kukjin Kim',
	'Krzysztof Kozlowski', 'Kiwoong Kim',
	'Wei Yongjun', linux-scsi, linux-samsung-soc,
	linux-kernel, kernel-janitors

On Sat, Jun 27, 2020 at 10:51:44PM +0530, Alim Akhtar wrote:
> Hi Dan
> 
> > -----Original Message-----
> > The "head" pointer can't be NULL because it points to an address in the
> middle
> > of a ufs_hba struct.  Looking at this code, probably someone would wonder
> if
> > the intent was to check whether "hba" is NULL, but "hba"
> > isn't NULL and the check can just be removed.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> Please add Fixes: tag
> With that
> Acked-by: Alim Akhtar <alim.akhtar@samsung.com>

It's not a bug fix it's just a cleanup.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] scsi: ufs: ufs-exynos: Remove an unnecessary NULL check
@ 2020-06-27 17:54       ` Dan Carpenter
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2020-06-27 17:54 UTC (permalink / raw)
  To: Alim Akhtar
  Cc: 'Avri Altman', 'James E.J. Bottomley',
	'Martin K. Petersen', 'Kukjin Kim',
	'Krzysztof Kozlowski', 'Kiwoong Kim',
	'Wei Yongjun', linux-scsi, linux-samsung-soc,
	linux-kernel, kernel-janitors

On Sat, Jun 27, 2020 at 10:51:44PM +0530, Alim Akhtar wrote:
> Hi Dan
> 
> > -----Original Message-----
> > The "head" pointer can't be NULL because it points to an address in the
> middle
> > of a ufs_hba struct.  Looking at this code, probably someone would wonder
> if
> > the intent was to check whether "hba" is NULL, but "hba"
> > isn't NULL and the check can just be removed.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> Please add Fixes: tag
> With that
> Acked-by: Alim Akhtar <alim.akhtar@samsung.com>

It's not a bug fix it's just a cleanup.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH] scsi: ufs: ufs-exynos: Remove an unnecessary NULL check
  2020-06-27 17:54       ` Dan Carpenter
@ 2020-06-28  1:56         ` Alim Akhtar
  -1 siblings, 0 replies; 10+ messages in thread
From: Alim Akhtar @ 2020-06-28  1:56 UTC (permalink / raw)
  To: 'Dan Carpenter'
  Cc: 'Avri Altman', 'James E.J. Bottomley',
	'Martin K. Petersen', 'Kukjin Kim',
	'Krzysztof Kozlowski', 'Kiwoong Kim',
	'Wei Yongjun', linux-scsi, linux-samsung-soc,
	linux-kernel, kernel-janitors

Hi Dan,

> -----Original Message-----
> From: Dan Carpenter <dan.carpenter@oracle.com>
> On Sat, Jun 27, 2020 at 10:51:44PM +0530, Alim Akhtar wrote:
> > Hi Dan
> >
> > > -----Original Message-----
> > > The "head" pointer can't be NULL because it points to an address in
the
> > middle
> > > of a ufs_hba struct.  Looking at this code, probably someone would
wonder
> > if
> > > the intent was to check whether "hba" is NULL, but "hba"
> > > isn't NULL and the check can just be removed.
> > >
> > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > > ---
> > Please add Fixes: tag
> > With that
> > Acked-by: Alim Akhtar <alim.akhtar@samsung.com>
> 
> It's not a bug fix it's just a cleanup.
> 
Acked-by: Alim Akhtar <alim.akhtar@samsung.com>

Thanks!

> regards,
> dan carpenter



^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH] scsi: ufs: ufs-exynos: Remove an unnecessary NULL check
@ 2020-06-28  1:56         ` Alim Akhtar
  0 siblings, 0 replies; 10+ messages in thread
From: Alim Akhtar @ 2020-06-28  1:56 UTC (permalink / raw)
  To: 'Dan Carpenter'
  Cc: 'Avri Altman', 'James E.J. Bottomley',
	'Martin K. Petersen', 'Kukjin Kim',
	'Krzysztof Kozlowski', 'Kiwoong Kim',
	'Wei Yongjun', linux-scsi, linux-samsung-soc,
	linux-kernel, kernel-janitors

Hi Dan,

> -----Original Message-----
> From: Dan Carpenter <dan.carpenter@oracle.com>
> On Sat, Jun 27, 2020 at 10:51:44PM +0530, Alim Akhtar wrote:
> > Hi Dan
> >
> > > -----Original Message-----
> > > The "head" pointer can't be NULL because it points to an address in
the
> > middle
> > > of a ufs_hba struct.  Looking at this code, probably someone would
wonder
> > if
> > > the intent was to check whether "hba" is NULL, but "hba"
> > > isn't NULL and the check can just be removed.
> > >
> > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > > ---
> > Please add Fixes: tag
> > With that
> > Acked-by: Alim Akhtar <alim.akhtar@samsung.com>
> 
> It's not a bug fix it's just a cleanup.
> 
Acked-by: Alim Akhtar <alim.akhtar@samsung.com>

Thanks!

> regards,
> dan carpenter

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] scsi: ufs: ufs-exynos: Remove an unnecessary NULL check
  2020-06-26 10:51   ` Dan Carpenter
@ 2020-06-30  3:23     ` Martin K. Petersen
  -1 siblings, 0 replies; 10+ messages in thread
From: Martin K. Petersen @ 2020-06-30  3:23 UTC (permalink / raw)
  To: Alim Akhtar, Dan Carpenter
  Cc: Martin K . Petersen, Kiwoong Kim, linux-scsi, kernel-janitors,
	James E.J. Bottomley, linux-samsung-soc, Avri Altman,
	linux-kernel, Kukjin Kim, Krzysztof Kozlowski, Wei Yongjun

On Fri, 26 Jun 2020 13:51:33 +0300, Dan Carpenter wrote:

> The "head" pointer can't be NULL because it points to an address in
> the middle of a ufs_hba struct.  Looking at this code, probably someone
> would wonder if the intent was to check whether "hba" is NULL, but "hba"
> isn't NULL and the check can just be removed.

Applied to 5.9/scsi-queue, thanks!

[1/1] scsi: ufs: ufs-exynos: Remove an unnecessary NULL check
      https://git.kernel.org/mkp/scsi/c/b7a80dac0f1f

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] scsi: ufs: ufs-exynos: Remove an unnecessary NULL check
@ 2020-06-30  3:23     ` Martin K. Petersen
  0 siblings, 0 replies; 10+ messages in thread
From: Martin K. Petersen @ 2020-06-30  3:23 UTC (permalink / raw)
  To: Alim Akhtar, Dan Carpenter
  Cc: Martin K . Petersen, Kiwoong Kim, linux-scsi, kernel-janitors,
	James E.J. Bottomley, linux-samsung-soc, Avri Altman,
	linux-kernel, Kukjin Kim, Krzysztof Kozlowski, Wei Yongjun

On Fri, 26 Jun 2020 13:51:33 +0300, Dan Carpenter wrote:

> The "head" pointer can't be NULL because it points to an address in
> the middle of a ufs_hba struct.  Looking at this code, probably someone
> would wonder if the intent was to check whether "hba" is NULL, but "hba"
> isn't NULL and the check can just be removed.

Applied to 5.9/scsi-queue, thanks!

[1/1] scsi: ufs: ufs-exynos: Remove an unnecessary NULL check
      https://git.kernel.org/mkp/scsi/c/b7a80dac0f1f

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-06-30  3:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20200626105156epcas5p191d18d66af6bd09a10635559461c0bc0@epcas5p1.samsung.com>
2020-06-26 10:51 ` [PATCH] scsi: ufs: ufs-exynos: Remove an unnecessary NULL check Dan Carpenter
2020-06-26 10:51   ` Dan Carpenter
2020-06-27 17:21   ` Alim Akhtar
2020-06-27 17:33     ` Alim Akhtar
2020-06-27 17:54     ` Dan Carpenter
2020-06-27 17:54       ` Dan Carpenter
2020-06-28  1:56       ` Alim Akhtar
2020-06-28  1:56         ` Alim Akhtar
2020-06-30  3:23   ` Martin K. Petersen
2020-06-30  3:23     ` Martin K. Petersen

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.