public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers: staging: dgnc: Remove useless casting in dgnc_driver.c
@ 2013-10-16 15:57 Geyslan G. Bem
  2013-10-16 15:57 ` [PATCH] drivers: staging: dgap: Remove useless casting in dgap_parse.c Geyslan G. Bem
  2013-10-16 19:39 ` [PATCH] drivers: staging: dgnc: Remove useless casting in dgnc_driver.c Greg KH
  0 siblings, 2 replies; 6+ messages in thread
From: Geyslan G. Bem @ 2013-10-16 15:57 UTC (permalink / raw)
  To: lidza.louina
  Cc: gregkh, driverdev-devel, devel, linux-kernel, kernel-br,
	Geyslan G. Bem

Casting (void *) value returned by kzalloc is useless
as mentioned in Documentation/CodingStyle, Chap 14.

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 drivers/staging/dgnc/dgnc_driver.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 71d2b83..7f31ab5 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -498,16 +498,14 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 	unsigned long flags;
 
 	/* get the board structure and prep it */
-	brd = dgnc_Board[dgnc_NumBoards] =
-	(struct board_t *) kzalloc(sizeof(struct board_t), GFP_KERNEL);
+	brd = dgnc_Board[dgnc_NumBoards] = kzalloc(sizeof(struct board_t), GFP_KERNEL);
 	if (!brd) {
 		APR(("memory allocation for board structure failed\n"));
 		return(-ENOMEM);
 	}
 
 	/* make a temporary message buffer for the boot messages */
-	brd->msgbuf = brd->msgbuf_head =
-		(char *) kzalloc(sizeof(char) * 8192, GFP_KERNEL);
+	brd->msgbuf = brd->msgbuf_head = kzalloc(sizeof(char) * 8192, GFP_KERNEL);
 	if (!brd->msgbuf) {
 		kfree(brd);
 		APR(("memory allocation for board msgbuf failed\n"));
-- 
1.8.4


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

* [PATCH] drivers: staging: dgap: Remove useless casting in dgap_parse.c
  2013-10-16 15:57 [PATCH] drivers: staging: dgnc: Remove useless casting in dgnc_driver.c Geyslan G. Bem
@ 2013-10-16 15:57 ` Geyslan G. Bem
  2013-10-17 10:14   ` Geyslan Gregório Bem
  2013-10-16 19:39 ` [PATCH] drivers: staging: dgnc: Remove useless casting in dgnc_driver.c Greg KH
  1 sibling, 1 reply; 6+ messages in thread
From: Geyslan G. Bem @ 2013-10-16 15:57 UTC (permalink / raw)
  To: lidza.louina
  Cc: gregkh, driverdev-devel, devel, linux-kernel, kernel-br,
	Geyslan G. Bem

Casting (void *) value returned by kmalloc is useless
as mentioned in Documentation/CodingStyle, Chap 14.

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 drivers/staging/dgap/dgap_parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/dgap/dgap_parse.c b/drivers/staging/dgap/dgap_parse.c
index 5497e6d..d41aa1c 100644
--- a/drivers/staging/dgap/dgap_parse.c
+++ b/drivers/staging/dgap/dgap_parse.c
@@ -1013,7 +1013,7 @@ static void dgap_err(char *s)
 static struct cnode *dgap_newnode(int t)
 {
 	struct cnode *n;
-	if ( (n = (struct cnode *) kmalloc(sizeof(struct cnode ), GFP_ATOMIC) ) != NULL) {
+	if ( (n = kmalloc(sizeof(struct cnode ), GFP_ATOMIC) ) != NULL) {
 		memset( (char *)n, 0, sizeof(struct cnode ) );
 		n->type = t;
 	}
-- 
1.8.4


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

* Re: [PATCH] drivers: staging: dgnc: Remove useless casting in dgnc_driver.c
  2013-10-16 15:57 [PATCH] drivers: staging: dgnc: Remove useless casting in dgnc_driver.c Geyslan G. Bem
  2013-10-16 15:57 ` [PATCH] drivers: staging: dgap: Remove useless casting in dgap_parse.c Geyslan G. Bem
@ 2013-10-16 19:39 ` Greg KH
  2013-10-16 23:09   ` Geyslan Gregório Bem
  1 sibling, 1 reply; 6+ messages in thread
From: Greg KH @ 2013-10-16 19:39 UTC (permalink / raw)
  To: Geyslan G. Bem
  Cc: lidza.louina, driverdev-devel, devel, linux-kernel, kernel-br

On Wed, Oct 16, 2013 at 12:57:35PM -0300, Geyslan G. Bem wrote:
> Casting (void *) value returned by kzalloc is useless
> as mentioned in Documentation/CodingStyle, Chap 14.
> 
> Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
> ---
>  drivers/staging/dgnc/dgnc_driver.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

This patch doesn't apply at all, what tree did you make it against?

Please redo it (and your second one) against either the linux-next
releases, or my staging-next branch of my staging.git tree on
git.kernel.org.

thanks,

greg k-h

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

* Re: [PATCH] drivers: staging: dgnc: Remove useless casting in dgnc_driver.c
  2013-10-16 19:39 ` [PATCH] drivers: staging: dgnc: Remove useless casting in dgnc_driver.c Greg KH
@ 2013-10-16 23:09   ` Geyslan Gregório Bem
  2013-10-17 10:07     ` Geyslan Gregório Bem
  0 siblings, 1 reply; 6+ messages in thread
From: Geyslan Gregório Bem @ 2013-10-16 23:09 UTC (permalink / raw)
  To: Greg KH; +Cc: lidza.louina, driverdev-devel, devel, LKML, kernel-br

2013/10/16 Greg KH <gregkh@linuxfoundation.org>:
> On Wed, Oct 16, 2013 at 12:57:35PM -0300, Geyslan G. Bem wrote:
>> Casting (void *) value returned by kzalloc is useless
>> as mentioned in Documentation/CodingStyle, Chap 14.
>>
>> Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
>> ---
>>  drivers/staging/dgnc/dgnc_driver.c | 6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> This patch doesn't apply at all, what tree did you make it against?
>
> Please redo it (and your second one) against either the linux-next
> releases, or my staging-next branch of my staging.git tree on
> git.kernel.org.
>
> thanks,
>
> greg k-h

Hi Greg,

I was using the torvalds tree. I noted that yours is different from his.
So, downloading and soon sending the second patch against your staging
(https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/).

Thanks.

Geyslan.

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

* Re: [PATCH] drivers: staging: dgnc: Remove useless casting in dgnc_driver.c
  2013-10-16 23:09   ` Geyslan Gregório Bem
@ 2013-10-17 10:07     ` Geyslan Gregório Bem
  0 siblings, 0 replies; 6+ messages in thread
From: Geyslan Gregório Bem @ 2013-10-17 10:07 UTC (permalink / raw)
  To: Greg KH; +Cc: Lidza Louina, driverdev-devel, devel, LKML, kernel-br

2013/10/16 Geyslan Gregório Bem <geyslan@gmail.com>:
> 2013/10/16 Greg KH <gregkh@linuxfoundation.org>:
>> On Wed, Oct 16, 2013 at 12:57:35PM -0300, Geyslan G. Bem wrote:
>>> Casting (void *) value returned by kzalloc is useless
>>> as mentioned in Documentation/CodingStyle, Chap 14.
>>>
>>> Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
>>> ---
>>>  drivers/staging/dgnc/dgnc_driver.c | 6 ++----
>>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> This patch doesn't apply at all, what tree did you make it against?
>>
>> Please redo it (and your second one) against either the linux-next
>> releases, or my staging-next branch of my staging.git tree on
>> git.kernel.org.
>>
>> thanks,
>>
>> greg k-h
>
> Hi Greg,
>
> I was using the torvalds tree. I noted that yours is different from his.
> So, downloading and soon sending the second patch against your staging
> (https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/).
>
> Thanks.
>
> Geyslan.

Already done. Patch is unneeded.

Regards.

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

* Re: [PATCH] drivers: staging: dgap: Remove useless casting in dgap_parse.c
  2013-10-16 15:57 ` [PATCH] drivers: staging: dgap: Remove useless casting in dgap_parse.c Geyslan G. Bem
@ 2013-10-17 10:14   ` Geyslan Gregório Bem
  0 siblings, 0 replies; 6+ messages in thread
From: Geyslan Gregório Bem @ 2013-10-17 10:14 UTC (permalink / raw)
  To: Lidza Louina
  Cc: Greg KH, driverdev-devel, devel, LKML, kernel-br, Geyslan G. Bem

2013/10/16 Geyslan G. Bem <geyslan@gmail.com>:
> Casting (void *) value returned by kmalloc is useless
> as mentioned in Documentation/CodingStyle, Chap 14.
>
> Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
> ---
>  drivers/staging/dgap/dgap_parse.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/dgap/dgap_parse.c b/drivers/staging/dgap/dgap_parse.c
> index 5497e6d..d41aa1c 100644
> --- a/drivers/staging/dgap/dgap_parse.c
> +++ b/drivers/staging/dgap/dgap_parse.c
> @@ -1013,7 +1013,7 @@ static void dgap_err(char *s)
>  static struct cnode *dgap_newnode(int t)
>  {
>         struct cnode *n;
> -       if ( (n = (struct cnode *) kmalloc(sizeof(struct cnode ), GFP_ATOMIC) ) != NULL) {
> +       if ( (n = kmalloc(sizeof(struct cnode ), GFP_ATOMIC) ) != NULL) {
>                 memset( (char *)n, 0, sizeof(struct cnode ) );
>                 n->type = t;
>         }
> --
> 1.8.4
>

Please, disregard this one. I have compared against staging-next and
noted that it was already done by Jingoo Han.

Regards.
Geyslan

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

end of thread, other threads:[~2013-10-17 10:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-16 15:57 [PATCH] drivers: staging: dgnc: Remove useless casting in dgnc_driver.c Geyslan G. Bem
2013-10-16 15:57 ` [PATCH] drivers: staging: dgap: Remove useless casting in dgap_parse.c Geyslan G. Bem
2013-10-17 10:14   ` Geyslan Gregório Bem
2013-10-16 19:39 ` [PATCH] drivers: staging: dgnc: Remove useless casting in dgnc_driver.c Greg KH
2013-10-16 23:09   ` Geyslan Gregório Bem
2013-10-17 10:07     ` Geyslan Gregório Bem

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox