prism54 sparse fixes
Subsystems (3)
PATCH 2/2 prism54 sparse fixes
2004-10-17 Margit Schubert-While <[email protected]>
* 02_sparse.patch
* On top of Linus's sparse changes, here is a
* fix that further reduces sparse warnings.
We are still left with 2 warnings caused by the member "data.pointer" in struct "iwreq_data" being "__user" (from wireless.h).
Margit
drivers/net/wireless/prism54/isl_ioctl.c +14 -10
@@ -1524,31 +1524,35 @@ const struct obj_mlme *mlme, int error) {union iwreq_data wrqu; +char *memptr; - wrqu.data.pointer =kmalloc (IW_CUSTOM_MAX ,GFP_KERNEL ); -if (!wrqu.data.pointer) + memptr =kmalloc (IW_CUSTOM_MAX ,GFP_KERNEL ); +if (!memptr)return ; + wrqu.data.pointer = memptr; wrqu.data.length =0 ; -format_event (priv, wrqu.data.pointer, str, mlme, &wrqu.data.length, +format_event (priv, memptr, str, mlme, &wrqu.data.length, error); -wireless_send_event (priv->ndev,IWEVCUSTOM , &wrqu, wrqu.data.pointer); -kfree (wrqu.data.pointer); +wireless_send_event (priv->ndev,IWEVCUSTOM , &wrqu, memptr); +kfree (memptr); }static void send_simple_event (islpci_private *priv,const char *str) {union iwreq_data wrqu; +char *memptr;int n =strlen (str); - wrqu.data.pointer =kmalloc (IW_CUSTOM_MAX ,GFP_KERNEL ); -if (!wrqu.data.pointer) + memptr =kmalloc (IW_CUSTOM_MAX ,GFP_KERNEL ); +if (!memptr)return ;BUG_ON (n >IW_CUSTOM_MAX ); + wrqu.data.pointer = memptr; wrqu.data.length = n; -strcpy (wrqu.data.pointer, str); -wireless_send_event (priv->ndev,IWEVCUSTOM , &wrqu, wrqu.data.pointer); -kfree (wrqu.data.pointer); +strcpy (memptr, str); +wireless_send_event (priv->ndev,IWEVCUSTOM , &wrqu, memptr); +kfree (memptr); } static void
drivers/net/wireless/prism54/prismcompat.h +4 -0
@@ -38,6 +38,10 @@#error Firmware Loading is not configured in the kernel !#endif +#ifndef __iomem +#define __iomem +#endif +#define prism54_synchronize_irq (irq) synchronize_irq(irq)#define PRISM_FW_PDEV &priv->pdev->dev
_______________________________________________
Prism54-devel mailing list
[email protected]
http://prism54.org/mailman/listinfo/prism54-devel