Commit c57200ac authored by Margit Schubert-While's avatar Margit Schubert-While Committed by Jeff Garzik

[PATCH] prism54 sparse fixes

*  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).
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 5d59425c
......@@ -1524,31 +1524,35 @@ send_formatted_event(islpci_private *priv, const char *str,
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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment