netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mwifiex: Remove casting the return value which is a void pointer
@ 2013-09-09  5:26 Jingoo Han
  2013-09-09  5:41 ` Joe Perches
       [not found] ` <004d01cead1d$3058dcf0$910a96d0$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Jingoo Han @ 2013-09-09  5:26 UTC (permalink / raw)
  To: 'John W. Linville'
  Cc: linux-wireless, netdev, 'David Miller',
	'Bing Zhao', 'Jingoo Han'

Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/net/wireless/mwifiex/pcie.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index 52da8ee..33fa943 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -93,7 +93,7 @@ static int mwifiex_pcie_suspend(struct device *dev)
 	struct pci_dev *pdev = to_pci_dev(dev);
 
 	if (pdev) {
-		card = (struct pcie_service_card *) pci_get_drvdata(pdev);
+		card = pci_get_drvdata(pdev);
 		if (!card || !card->adapter) {
 			pr_err("Card or adapter structure is not valid\n");
 			return 0;
@@ -128,7 +128,7 @@ static int mwifiex_pcie_resume(struct device *dev)
 	struct pci_dev *pdev = to_pci_dev(dev);
 
 	if (pdev) {
-		card = (struct pcie_service_card *) pci_get_drvdata(pdev);
+		card = pci_get_drvdata(pdev);
 		if (!card || !card->adapter) {
 			pr_err("Card or adapter structure is not valid\n");
 			return 0;
@@ -2037,7 +2037,7 @@ static irqreturn_t mwifiex_pcie_interrupt(int irq, void *context)
 		goto exit;
 	}
 
-	card = (struct pcie_service_card *) pci_get_drvdata(pdev);
+	card = pci_get_drvdata(pdev);
 	if (!card || !card->adapter) {
 		pr_debug("info: %s: card=%p adapter=%p\n", __func__, card,
 			 card ? card->adapter : NULL);
-- 
1.7.10.4

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

* Re: [PATCH] mwifiex: Remove casting the return value which is a void pointer
  2013-09-09  5:26 [PATCH] mwifiex: Remove casting the return value which is a void pointer Jingoo Han
@ 2013-09-09  5:41 ` Joe Perches
       [not found] ` <004d01cead1d$3058dcf0$910a96d0$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Perches @ 2013-09-09  5:41 UTC (permalink / raw)
  To: Jingoo Han
  Cc: 'John W. Linville', linux-wireless, netdev,
	'David Miller', 'Bing Zhao'

On Mon, 2013-09-09 at 14:26 +0900, Jingoo Han wrote:
> Casting the return value which is a void pointer is redundant.
> The conversion from void pointer to any other pointer type is
> guaranteed by the C programming language.

spatch (aka: Coccinelle) should be able to find a lot
of these with:

$ cat void.cocci 
@@
void *t;
type other;
@@

-	(other *)t
+	t

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

* RE: [PATCH] mwifiex: Remove casting the return value which is a void pointer
       [not found] ` <004d01cead1d$3058dcf0$910a96d0$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2013-09-16 21:26   ` Bing Zhao
  0 siblings, 0 replies; 3+ messages in thread
From: Bing Zhao @ 2013-09-16 21:26 UTC (permalink / raw)
  To: Jingoo Han, 'John W. Linville'
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	'David Miller'

Hi Jingoo,

Thanks for the patch.

> Casting the return value which is a void pointer is redundant.
> The conversion from void pointer to any other pointer type is
> guaranteed by the C programming language.
> 
> Signed-off-by: Jingoo Han <jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>

Acked-by: Bing Zhao <bzhao-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>

Thanks,
Bing

> ---
>  drivers/net/wireless/mwifiex/pcie.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2013-09-16 21:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-09  5:26 [PATCH] mwifiex: Remove casting the return value which is a void pointer Jingoo Han
2013-09-09  5:41 ` Joe Perches
     [not found] ` <004d01cead1d$3058dcf0$910a96d0$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-09-16 21:26   ` Bing Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).