All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] s390/zcrypt: remove unnecessary (void*) conversions
@ 2023-02-23  1:12 Yu Zhe
  2023-02-28 18:05 ` Heiko Carstens
  2023-03-03  1:32 ` [PATCH v2] " Yu Zhe
  0 siblings, 2 replies; 8+ messages in thread
From: Yu Zhe @ 2023-02-23  1:12 UTC (permalink / raw)
  To: freude, hca, gor, agordeev, borntraeger, svens
  Cc: linux-s390, linux-kernel, kernel-janitors, liqiong, Yu Zhe

Pointer variables of void * type do not require type cast.

Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
---
 drivers/s390/crypto/zcrypt_msgtype6.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/s390/crypto/zcrypt_msgtype6.c b/drivers/s390/crypto/zcrypt_msgtype6.c
index 5ad251477593..09b714c6adc3 100644
--- a/drivers/s390/crypto/zcrypt_msgtype6.c
+++ b/drivers/s390/crypto/zcrypt_msgtype6.c
@@ -926,8 +926,7 @@ static void zcrypt_msgtype6_receive(struct ap_queue *aq,
 		.type = TYPE82_RSP_CODE,
 		.reply_code = REP82_ERROR_MACHINE_FAILURE,
 	};
-	struct response_type *resp_type =
-		(struct response_type *)msg->private;
+	struct response_type *resp_type = msg->private;
 	struct type86x_reply *t86r;
 	int len;
 
@@ -982,8 +981,7 @@ static void zcrypt_msgtype6_receive_ep11(struct ap_queue *aq,
 		.type = TYPE82_RSP_CODE,
 		.reply_code = REP82_ERROR_MACHINE_FAILURE,
 	};
-	struct response_type *resp_type =
-		(struct response_type *)msg->private;
+	struct response_type *resp_type = msg->private;
 	struct type86_ep11_reply *t86r;
 	int len;
 
-- 
2.11.0


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

* Re: [PATCH] s390/zcrypt: remove unnecessary (void*) conversions
  2023-02-23  1:12 [PATCH] s390/zcrypt: remove unnecessary (void*) conversions Yu Zhe
@ 2023-02-28 18:05 ` Heiko Carstens
  2023-03-03  1:32 ` [PATCH v2] " Yu Zhe
  1 sibling, 0 replies; 8+ messages in thread
From: Heiko Carstens @ 2023-02-28 18:05 UTC (permalink / raw)
  To: Yu Zhe
  Cc: freude, gor, agordeev, borntraeger, svens, linux-s390,
	linux-kernel, kernel-janitors, liqiong

On Thu, Feb 23, 2023 at 09:12:12AM +0800, Yu Zhe wrote:
> Pointer variables of void * type do not require type cast.
> 
> Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
> ---
>  drivers/s390/crypto/zcrypt_msgtype6.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/s390/crypto/zcrypt_msgtype6.c b/drivers/s390/crypto/zcrypt_msgtype6.c
> index 5ad251477593..09b714c6adc3 100644
> --- a/drivers/s390/crypto/zcrypt_msgtype6.c
> +++ b/drivers/s390/crypto/zcrypt_msgtype6.c
> @@ -926,8 +926,7 @@ static void zcrypt_msgtype6_receive(struct ap_queue *aq,
>  		.type = TYPE82_RSP_CODE,
>  		.reply_code = REP82_ERROR_MACHINE_FAILURE,
>  	};
> -	struct response_type *resp_type =
> -		(struct response_type *)msg->private;
> +	struct response_type *resp_type = msg->private;
>  	struct type86x_reply *t86r;
>  	int len;

There are many more of this. Please convert all of them, or none.

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

* [PATCH v2] s390/zcrypt: remove unnecessary (void*) conversions
  2023-02-23  1:12 [PATCH] s390/zcrypt: remove unnecessary (void*) conversions Yu Zhe
  2023-02-28 18:05 ` Heiko Carstens
@ 2023-03-03  1:32 ` Yu Zhe
  2023-03-03  4:23   ` Dan Carpenter
  2023-03-03  5:21   ` [PATCH v3] " Yu Zhe
  1 sibling, 2 replies; 8+ messages in thread
From: Yu Zhe @ 2023-03-03  1:32 UTC (permalink / raw)
  To: freude, hca, gor, agordeev, borntraeger, svens
  Cc: linux-s390, linux-kernel, kernel-janitors, liqiong, Yu Zhe

Pointer variables of void * type do not require type cast.

Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
---
 drivers/s390/crypto/zcrypt_msgtype6.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/s390/crypto/zcrypt_msgtype6.c b/drivers/s390/crypto/zcrypt_msgtype6.c
index 5ad251477593..a955dc97040c 100644
--- a/drivers/s390/crypto/zcrypt_msgtype6.c
+++ b/drivers/s390/crypto/zcrypt_msgtype6.c
@@ -926,8 +926,7 @@ static void zcrypt_msgtype6_receive(struct ap_queue *aq,
 		.type = TYPE82_RSP_CODE,
 		.reply_code = REP82_ERROR_MACHINE_FAILURE,
 	};
-	struct response_type *resp_type =
-		(struct response_type *)msg->private;
+	struct response_type *resp_type = msg->private;
 	struct type86x_reply *t86r;
 	int len;
 
@@ -982,8 +981,7 @@ static void zcrypt_msgtype6_receive_ep11(struct ap_queue *aq,
 		.type = TYPE82_RSP_CODE,
 		.reply_code = REP82_ERROR_MACHINE_FAILURE,
 	};
-	struct response_type *resp_type =
-		(struct response_type *)msg->private;
+	struct response_type *resp_type = msg->private;
 	struct type86_ep11_reply *t86r;
 	int len;
 
@@ -1157,7 +1155,7 @@ static long zcrypt_msgtype6_send_cprb(bool userspace, struct zcrypt_queue *zq,
 				      struct ap_message *ap_msg)
 {
 	int rc;
-	struct response_type *rtype = (struct response_type *)(ap_msg->private);
+	struct response_type *rtype = (ap_msg->private);
 	struct {
 		struct type6_hdr hdr;
 		struct CPRBX cprbx;
@@ -1240,7 +1238,7 @@ static long zcrypt_msgtype6_send_ep11_cprb(bool userspace, struct zcrypt_queue *
 {
 	int rc;
 	unsigned int lfmt;
-	struct response_type *rtype = (struct response_type *)(ap_msg->private);
+	struct response_type *rtype = (ap_msg->private);
 	struct {
 		struct type6_hdr hdr;
 		struct ep11_cprb cprbx;
@@ -1359,7 +1357,7 @@ static long zcrypt_msgtype6_rng(struct zcrypt_queue *zq,
 		short int verb_length;
 		short int key_length;
 	} __packed * msg = ap_msg->msg;
-	struct response_type *rtype = (struct response_type *)(ap_msg->private);
+	struct response_type *rtype = (ap_msg->private);
 	int rc;
 
 	msg->cprbx.domain = AP_QID_QUEUE(zq->queue->qid);
-- 
2.11.0


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

* Re: [PATCH v2] s390/zcrypt: remove unnecessary (void*) conversions
  2023-03-03  1:32 ` [PATCH v2] " Yu Zhe
@ 2023-03-03  4:23   ` Dan Carpenter
  2023-03-03  5:21   ` [PATCH v3] " Yu Zhe
  1 sibling, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2023-03-03  4:23 UTC (permalink / raw)
  To: Yu Zhe
  Cc: freude, hca, gor, agordeev, borntraeger, svens, linux-s390,
	linux-kernel, kernel-janitors, liqiong

On Fri, Mar 03, 2023 at 09:32:50AM +0800, Yu Zhe wrote:
> @@ -1157,7 +1155,7 @@ static long zcrypt_msgtype6_send_cprb(bool userspace, struct zcrypt_queue *zq,
>  				      struct ap_message *ap_msg)
>  {
>  	int rc;
> -	struct response_type *rtype = (struct response_type *)(ap_msg->private);
> +	struct response_type *rtype = (ap_msg->private);

If you're going to do this the get rid of the parentheses as well:

	struct response_type *rtype = ap_msg->private;

Same in other places.

regards,
dan carpenter


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

* [PATCH v3] s390/zcrypt: remove unnecessary (void*) conversions
  2023-03-03  1:32 ` [PATCH v2] " Yu Zhe
  2023-03-03  4:23   ` Dan Carpenter
@ 2023-03-03  5:21   ` Yu Zhe
  2023-03-03 11:02     ` Muhammad Usama Anjum
                       ` (2 more replies)
  1 sibling, 3 replies; 8+ messages in thread
From: Yu Zhe @ 2023-03-03  5:21 UTC (permalink / raw)
  To: freude, hca, gor, agordeev, borntraeger, svens
  Cc: linux-s390, linux-kernel, kernel-janitors, liqiong, Yu Zhe

Pointer variables of void * type do not require type cast.

Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
---
 drivers/s390/crypto/zcrypt_msgtype6.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/s390/crypto/zcrypt_msgtype6.c b/drivers/s390/crypto/zcrypt_msgtype6.c
index 5ad251477593..a2e7fe33ba62 100644
--- a/drivers/s390/crypto/zcrypt_msgtype6.c
+++ b/drivers/s390/crypto/zcrypt_msgtype6.c
@@ -926,8 +926,7 @@ static void zcrypt_msgtype6_receive(struct ap_queue *aq,
 		.type = TYPE82_RSP_CODE,
 		.reply_code = REP82_ERROR_MACHINE_FAILURE,
 	};
-	struct response_type *resp_type =
-		(struct response_type *)msg->private;
+	struct response_type *resp_type = msg->private;
 	struct type86x_reply *t86r;
 	int len;
 
@@ -982,8 +981,7 @@ static void zcrypt_msgtype6_receive_ep11(struct ap_queue *aq,
 		.type = TYPE82_RSP_CODE,
 		.reply_code = REP82_ERROR_MACHINE_FAILURE,
 	};
-	struct response_type *resp_type =
-		(struct response_type *)msg->private;
+	struct response_type *resp_type = msg->private;
 	struct type86_ep11_reply *t86r;
 	int len;
 
@@ -1157,7 +1155,7 @@ static long zcrypt_msgtype6_send_cprb(bool userspace, struct zcrypt_queue *zq,
 				      struct ap_message *ap_msg)
 {
 	int rc;
-	struct response_type *rtype = (struct response_type *)(ap_msg->private);
+	struct response_type *rtype = ap_msg->private;
 	struct {
 		struct type6_hdr hdr;
 		struct CPRBX cprbx;
@@ -1240,7 +1238,7 @@ static long zcrypt_msgtype6_send_ep11_cprb(bool userspace, struct zcrypt_queue *
 {
 	int rc;
 	unsigned int lfmt;
-	struct response_type *rtype = (struct response_type *)(ap_msg->private);
+	struct response_type *rtype = ap_msg->private;
 	struct {
 		struct type6_hdr hdr;
 		struct ep11_cprb cprbx;
@@ -1359,7 +1357,7 @@ static long zcrypt_msgtype6_rng(struct zcrypt_queue *zq,
 		short int verb_length;
 		short int key_length;
 	} __packed * msg = ap_msg->msg;
-	struct response_type *rtype = (struct response_type *)(ap_msg->private);
+	struct response_type *rtype = ap_msg->private;
 	int rc;
 
 	msg->cprbx.domain = AP_QID_QUEUE(zq->queue->qid);
-- 
2.11.0


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

* Re: [PATCH v3] s390/zcrypt: remove unnecessary (void*) conversions
  2023-03-03  5:21   ` [PATCH v3] " Yu Zhe
@ 2023-03-03 11:02     ` Muhammad Usama Anjum
  2023-03-03 12:16     ` Dan Carpenter
  2023-03-03 13:10     ` Harald Freudenberger
  2 siblings, 0 replies; 8+ messages in thread
From: Muhammad Usama Anjum @ 2023-03-03 11:02 UTC (permalink / raw)
  To: Yu Zhe, freude, hca, gor, agordeev, borntraeger, svens
  Cc: Muhammad Usama Anjum, linux-s390, linux-kernel, kernel-janitors, liqiong

On 3/3/23 10:21 AM, Yu Zhe wrote:
> Pointer variables of void * type do not require type cast.
> 
> Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>

> ---
>  drivers/s390/crypto/zcrypt_msgtype6.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/s390/crypto/zcrypt_msgtype6.c b/drivers/s390/crypto/zcrypt_msgtype6.c
> index 5ad251477593..a2e7fe33ba62 100644
> --- a/drivers/s390/crypto/zcrypt_msgtype6.c
> +++ b/drivers/s390/crypto/zcrypt_msgtype6.c
> @@ -926,8 +926,7 @@ static void zcrypt_msgtype6_receive(struct ap_queue *aq,
>  		.type = TYPE82_RSP_CODE,
>  		.reply_code = REP82_ERROR_MACHINE_FAILURE,
>  	};
> -	struct response_type *resp_type =
> -		(struct response_type *)msg->private;
> +	struct response_type *resp_type = msg->private;
>  	struct type86x_reply *t86r;
>  	int len;
>  
> @@ -982,8 +981,7 @@ static void zcrypt_msgtype6_receive_ep11(struct ap_queue *aq,
>  		.type = TYPE82_RSP_CODE,
>  		.reply_code = REP82_ERROR_MACHINE_FAILURE,
>  	};
> -	struct response_type *resp_type =
> -		(struct response_type *)msg->private;
> +	struct response_type *resp_type = msg->private;
>  	struct type86_ep11_reply *t86r;
>  	int len;
>  
> @@ -1157,7 +1155,7 @@ static long zcrypt_msgtype6_send_cprb(bool userspace, struct zcrypt_queue *zq,
>  				      struct ap_message *ap_msg)
>  {
>  	int rc;
> -	struct response_type *rtype = (struct response_type *)(ap_msg->private);
> +	struct response_type *rtype = ap_msg->private;
>  	struct {
>  		struct type6_hdr hdr;
>  		struct CPRBX cprbx;
> @@ -1240,7 +1238,7 @@ static long zcrypt_msgtype6_send_ep11_cprb(bool userspace, struct zcrypt_queue *
>  {
>  	int rc;
>  	unsigned int lfmt;
> -	struct response_type *rtype = (struct response_type *)(ap_msg->private);
> +	struct response_type *rtype = ap_msg->private;
>  	struct {
>  		struct type6_hdr hdr;
>  		struct ep11_cprb cprbx;
> @@ -1359,7 +1357,7 @@ static long zcrypt_msgtype6_rng(struct zcrypt_queue *zq,
>  		short int verb_length;
>  		short int key_length;
>  	} __packed * msg = ap_msg->msg;
> -	struct response_type *rtype = (struct response_type *)(ap_msg->private);
> +	struct response_type *rtype = ap_msg->private;
>  	int rc;
>  
>  	msg->cprbx.domain = AP_QID_QUEUE(zq->queue->qid);

-- 
BR,
Muhammad Usama Anjum

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

* Re: [PATCH v3] s390/zcrypt: remove unnecessary (void*) conversions
  2023-03-03  5:21   ` [PATCH v3] " Yu Zhe
  2023-03-03 11:02     ` Muhammad Usama Anjum
@ 2023-03-03 12:16     ` Dan Carpenter
  2023-03-03 13:10     ` Harald Freudenberger
  2 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2023-03-03 12:16 UTC (permalink / raw)
  To: Yu Zhe
  Cc: freude, hca, gor, agordeev, borntraeger, svens, linux-s390,
	linux-kernel, kernel-janitors, liqiong

On Fri, Mar 03, 2023 at 01:21:55PM +0800, Yu Zhe wrote:
> Pointer variables of void * type do not require type cast.
> 
> Signed-off-by: Yu Zhe <yuzhe@nfschina.com>

LGTM.  Thanks!

regards,
dan carpenter


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

* Re: [PATCH v3] s390/zcrypt: remove unnecessary (void*) conversions
  2023-03-03  5:21   ` [PATCH v3] " Yu Zhe
  2023-03-03 11:02     ` Muhammad Usama Anjum
  2023-03-03 12:16     ` Dan Carpenter
@ 2023-03-03 13:10     ` Harald Freudenberger
  2 siblings, 0 replies; 8+ messages in thread
From: Harald Freudenberger @ 2023-03-03 13:10 UTC (permalink / raw)
  To: Yu Zhe
  Cc: hca, gor, agordeev, borntraeger, svens, linux-s390, linux-kernel,
	kernel-janitors, liqiong

On 2023-03-03 06:21, Yu Zhe wrote:
> Pointer variables of void * type do not require type cast.
> 
> Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
> ---
>  drivers/s390/crypto/zcrypt_msgtype6.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/s390/crypto/zcrypt_msgtype6.c
> b/drivers/s390/crypto/zcrypt_msgtype6.c
> index 5ad251477593..a2e7fe33ba62 100644
> --- a/drivers/s390/crypto/zcrypt_msgtype6.c
> +++ b/drivers/s390/crypto/zcrypt_msgtype6.c
> @@ -926,8 +926,7 @@ static void zcrypt_msgtype6_receive(struct ap_queue 
> *aq,
>  		.type = TYPE82_RSP_CODE,
>  		.reply_code = REP82_ERROR_MACHINE_FAILURE,
>  	};
> -	struct response_type *resp_type =
> -		(struct response_type *)msg->private;
> +	struct response_type *resp_type = msg->private;
>  	struct type86x_reply *t86r;
>  	int len;
> 
> @@ -982,8 +981,7 @@ static void zcrypt_msgtype6_receive_ep11(struct
> ap_queue *aq,
>  		.type = TYPE82_RSP_CODE,
>  		.reply_code = REP82_ERROR_MACHINE_FAILURE,
>  	};
> -	struct response_type *resp_type =
> -		(struct response_type *)msg->private;
> +	struct response_type *resp_type = msg->private;
>  	struct type86_ep11_reply *t86r;
>  	int len;
> 
> @@ -1157,7 +1155,7 @@ static long zcrypt_msgtype6_send_cprb(bool
> userspace, struct zcrypt_queue *zq,
>  				      struct ap_message *ap_msg)
>  {
>  	int rc;
> -	struct response_type *rtype = (struct response_type 
> *)(ap_msg->private);
> +	struct response_type *rtype = ap_msg->private;
>  	struct {
>  		struct type6_hdr hdr;
>  		struct CPRBX cprbx;
> @@ -1240,7 +1238,7 @@ static long zcrypt_msgtype6_send_ep11_cprb(bool
> userspace, struct zcrypt_queue *
>  {
>  	int rc;
>  	unsigned int lfmt;
> -	struct response_type *rtype = (struct response_type 
> *)(ap_msg->private);
> +	struct response_type *rtype = ap_msg->private;
>  	struct {
>  		struct type6_hdr hdr;
>  		struct ep11_cprb cprbx;
> @@ -1359,7 +1357,7 @@ static long zcrypt_msgtype6_rng(struct 
> zcrypt_queue *zq,
>  		short int verb_length;
>  		short int key_length;
>  	} __packed * msg = ap_msg->msg;
> -	struct response_type *rtype = (struct response_type 
> *)(ap_msg->private);
> +	struct response_type *rtype = ap_msg->private;
>  	int rc;
> 
>  	msg->cprbx.domain = AP_QID_QUEUE(zq->queue->qid);

Thanks for this patch and the reviews done. As maintainer of the zcrypt 
and ap bus
code I will of course also review the patch, pick it and apply it to our 
internal
s390 subsystem kernel repository. On the next synch it will appear in 
Linus Torwald's
kernel tree. Thanks


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

end of thread, other threads:[~2023-03-03 13:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-23  1:12 [PATCH] s390/zcrypt: remove unnecessary (void*) conversions Yu Zhe
2023-02-28 18:05 ` Heiko Carstens
2023-03-03  1:32 ` [PATCH v2] " Yu Zhe
2023-03-03  4:23   ` Dan Carpenter
2023-03-03  5:21   ` [PATCH v3] " Yu Zhe
2023-03-03 11:02     ` Muhammad Usama Anjum
2023-03-03 12:16     ` Dan Carpenter
2023-03-03 13:10     ` Harald Freudenberger

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.