diff mbox

[1/2] crypto: ccp: Fix sparse, use plain integer as NULL pointer

Message ID 20180215193445.40046-1-brijesh.singh@amd.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Brijesh Singh Feb. 15, 2018, 7:34 p.m. UTC
Fix sparse warning: Using plain integer as NULL pointer. Replaces
assignment of 0 to pointer with NULL assignment.

Fixes: 200664d5237f (Add Secure Encrypted Virtualization ...)
Cc: Borislav Petkov <bp@suse.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Gary Hook <gary.hook@amd.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
---
 drivers/crypto/ccp/psp-dev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Gary R Hook Feb. 21, 2018, 1:59 p.m. UTC | #1
On 2/15/2018 2:34 PM, Brijesh Singh wrote:
> Fix sparse warning: Using plain integer as NULL pointer. Replaces
> assignment of 0 to pointer with NULL assignment.
> 
> Fixes: 200664d5237f (Add Secure Encrypted Virtualization ...)
> Cc: Borislav Petkov <bp@suse.de>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: Gary Hook <gary.hook@amd.com>
> Cc: Tom Lendacky <thomas.lendacky@amd.com>
> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>

Acked-by: Gary R Hook <gary.hook@amd.com>

> ---
>   drivers/crypto/ccp/psp-dev.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c
> index fcfa5b1eae61..b3afb6cc9d72 100644
> --- a/drivers/crypto/ccp/psp-dev.c
> +++ b/drivers/crypto/ccp/psp-dev.c
> @@ -211,7 +211,7 @@ static int __sev_platform_shutdown_locked(int *error)
>   {
>   	int ret;
>   
> -	ret = __sev_do_cmd_locked(SEV_CMD_SHUTDOWN, 0, error);
> +	ret = __sev_do_cmd_locked(SEV_CMD_SHUTDOWN, NULL, error);
>   	if (ret)
>   		return ret;
>   
> @@ -271,7 +271,7 @@ static int sev_ioctl_do_reset(struct sev_issue_cmd *argp)
>   			return rc;
>   	}
>   
> -	return __sev_do_cmd_locked(SEV_CMD_FACTORY_RESET, 0, &argp->error);
> +	return __sev_do_cmd_locked(SEV_CMD_FACTORY_RESET, NULL, &argp->error);
>   }
>   
>   static int sev_ioctl_do_platform_status(struct sev_issue_cmd *argp)
> @@ -299,7 +299,7 @@ static int sev_ioctl_do_pek_pdh_gen(int cmd, struct sev_issue_cmd *argp)
>   			return rc;
>   	}
>   
> -	return __sev_do_cmd_locked(cmd, 0, &argp->error);
> +	return __sev_do_cmd_locked(cmd, NULL, &argp->error);
>   }
>   
>   static int sev_ioctl_do_pek_csr(struct sev_issue_cmd *argp)
> @@ -624,7 +624,7 @@ EXPORT_SYMBOL_GPL(sev_guest_decommission);
>   
>   int sev_guest_df_flush(int *error)
>   {
> -	return sev_do_cmd(SEV_CMD_DF_FLUSH, 0, error);
> +	return sev_do_cmd(SEV_CMD_DF_FLUSH, NULL, error);
>   }
>   EXPORT_SYMBOL_GPL(sev_guest_df_flush);
>   
>
Herbert Xu March 2, 2018, 4:41 p.m. UTC | #2
On Thu, Feb 15, 2018 at 01:34:44PM -0600, Brijesh Singh wrote:
> Fix sparse warning: Using plain integer as NULL pointer. Replaces
> assignment of 0 to pointer with NULL assignment.
> 
> Fixes: 200664d5237f (Add Secure Encrypted Virtualization ...)
> Cc: Borislav Petkov <bp@suse.de>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: Gary Hook <gary.hook@amd.com>
> Cc: Tom Lendacky <thomas.lendacky@amd.com>
> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>

All applied.  Thanks.
Brijesh Singh March 2, 2018, 5:04 p.m. UTC | #3
Hi Herbert,


On 03/02/2018 10:41 AM, Herbert Xu wrote:
> On Thu, Feb 15, 2018 at 01:34:44PM -0600, Brijesh Singh wrote:
>> Fix sparse warning: Using plain integer as NULL pointer. Replaces
>> assignment of 0 to pointer with NULL assignment.
>>
>> Fixes: 200664d5237f (Add Secure Encrypted Virtualization ...)
>> Cc: Borislav Petkov <bp@suse.de>
>> Cc: Herbert Xu <herbert@gondor.apana.org.au>
>> Cc: Gary Hook <gary.hook@amd.com>
>> Cc: Tom Lendacky <thomas.lendacky@amd.com>
>> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
> 
> All applied.  Thanks.
> 

As part of other SEV fixes Paolo pulled these two patches through kvm 
tree. The patches were already included in KVM pull request for 
4.16-rc3. After Paolo pulled the patches in kvm request, I looked at 
patchwork and saw that this series was marked as "Not applicable" in 
hence I was under impression that you will not be applying this patches 
in crypto tree hence didn't speak up. I hope its not big issue and git 
will able to detect it.

-Brijesh
diff mbox

Patch

diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c
index fcfa5b1eae61..b3afb6cc9d72 100644
--- a/drivers/crypto/ccp/psp-dev.c
+++ b/drivers/crypto/ccp/psp-dev.c
@@ -211,7 +211,7 @@  static int __sev_platform_shutdown_locked(int *error)
 {
 	int ret;
 
-	ret = __sev_do_cmd_locked(SEV_CMD_SHUTDOWN, 0, error);
+	ret = __sev_do_cmd_locked(SEV_CMD_SHUTDOWN, NULL, error);
 	if (ret)
 		return ret;
 
@@ -271,7 +271,7 @@  static int sev_ioctl_do_reset(struct sev_issue_cmd *argp)
 			return rc;
 	}
 
-	return __sev_do_cmd_locked(SEV_CMD_FACTORY_RESET, 0, &argp->error);
+	return __sev_do_cmd_locked(SEV_CMD_FACTORY_RESET, NULL, &argp->error);
 }
 
 static int sev_ioctl_do_platform_status(struct sev_issue_cmd *argp)
@@ -299,7 +299,7 @@  static int sev_ioctl_do_pek_pdh_gen(int cmd, struct sev_issue_cmd *argp)
 			return rc;
 	}
 
-	return __sev_do_cmd_locked(cmd, 0, &argp->error);
+	return __sev_do_cmd_locked(cmd, NULL, &argp->error);
 }
 
 static int sev_ioctl_do_pek_csr(struct sev_issue_cmd *argp)
@@ -624,7 +624,7 @@  EXPORT_SYMBOL_GPL(sev_guest_decommission);
 
 int sev_guest_df_flush(int *error)
 {
-	return sev_do_cmd(SEV_CMD_DF_FLUSH, 0, error);
+	return sev_do_cmd(SEV_CMD_DF_FLUSH, NULL, error);
 }
 EXPORT_SYMBOL_GPL(sev_guest_df_flush);