mwifiex: Remove casting the return value which is a void pointer
Subsystems (3)
PATCH 1/1 mwifiex: Remove casting the return value which is a void pointer
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.
--- drivers/net/wireless/mwifiex/pcie.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/mwifiex/pcie.c +3 -3
@@ -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 );
Signature · 1 line
1.7.10.4
Quoted 3 lines · 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.
spatch (aka: Coccinelle) should be able to find a lot of these with:
$ cat void.cocci @@ void *t; type other; @@
- (other *)t
+ t
A message that is not in the archive (sent off-list or not yet received): 004d01cead1d$3058dcf0$910a96d0$%[email protected]
Bing Zhao
Acked-byHi Jingoo,
Thanks for the patch.
Quoted 5 lines
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 <[email protected]>
Thanks,
Bing
Quoted 3 lines
--- 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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html