linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: wl12xx: fix DMA-API-related warnings
@ 2012-04-16 10:48 Dan Carpenter
  2012-04-18 22:59 ` Mircea Gherzan
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2012-04-16 10:48 UTC (permalink / raw)
  To: mgherzan; +Cc: linux-wireless, Luciano Coelho

Hello Mircea Gherzan,

The patch 690142e98826: "wl12xx: fix DMA-API-related warnings" from
Mar 17, 2012, leads to the following Smatch warning:
drivers/net/wireless/ti/wlcore/cmd.c:126 wl1271_cmd_wait_for_event_or_timeout()
	 error: no modifiers for allocation.

 static void wl1271_boot_fw_version(struct wl1271 *wl)
 {
-       struct wl1271_static_data static_data;
+       struct wl1271_static_data *static_data;
 
-       wl1271_read(wl, wl->cmd_box_addr, &static_data, sizeof(static_data),
+       static_data = kmalloc(sizeof(*static_data), GFP_DMA);
                                                    ^^^^^^^
You can't use GFP_DMA by itself like that, it needs to ORed with
GFP_KERNEL or GFP_ATOMIC or something like that:

	static_data = kmalloc(sizeof(*static_data), GFP_KERNEL | GFP_DMA);

+       if (!static_data) {
+               __WARN();
+               return;

There are a couple other places in this patch which do the same thing.
Could you fix it, please?

regards,
dan carpenter


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

* Re: wl12xx: fix DMA-API-related warnings
  2012-04-16 10:48 wl12xx: fix DMA-API-related warnings Dan Carpenter
@ 2012-04-18 22:59 ` Mircea Gherzan
  2012-04-19  4:22   ` Luciano Coelho
  0 siblings, 1 reply; 3+ messages in thread
From: Mircea Gherzan @ 2012-04-18 22:59 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: Dan Carpenter, linux-wireless

Hi Luciano,

Am 16.04.2012 12:48, schrieb Dan Carpenter:
> Hello Mircea Gherzan,
> 
> The patch 690142e98826: "wl12xx: fix DMA-API-related warnings" from
> Mar 17, 2012, leads to the following Smatch warning:
> drivers/net/wireless/ti/wlcore/cmd.c:126 wl1271_cmd_wait_for_event_or_timeout()
> 	 error: no modifiers for allocation.

How would you prefer my fix for this issue: as a new version of the
original patch or as a separate new patch?

Thanks,
Mircea

>  static void wl1271_boot_fw_version(struct wl1271 *wl)
>  {
> -       struct wl1271_static_data static_data;
> +       struct wl1271_static_data *static_data;
>  
> -       wl1271_read(wl, wl->cmd_box_addr, &static_data, sizeof(static_data),
> +       static_data = kmalloc(sizeof(*static_data), GFP_DMA);
>                                                     ^^^^^^^
> You can't use GFP_DMA by itself like that, it needs to ORed with
> GFP_KERNEL or GFP_ATOMIC or something like that:
> 
> 	static_data = kmalloc(sizeof(*static_data), GFP_KERNEL | GFP_DMA);
> 
> +       if (!static_data) {
> +               __WARN();
> +               return;
> 
> There are a couple other places in this patch which do the same thing.
> Could you fix it, please?
> 
> regards,
> dan carpenter
> 


-- 
Mircea

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

* Re: wl12xx: fix DMA-API-related warnings
  2012-04-18 22:59 ` Mircea Gherzan
@ 2012-04-19  4:22   ` Luciano Coelho
  0 siblings, 0 replies; 3+ messages in thread
From: Luciano Coelho @ 2012-04-19  4:22 UTC (permalink / raw)
  To: Mircea Gherzan; +Cc: Dan Carpenter, linux-wireless

Hi Mircea,

On Thu, 2012-04-19 at 00:59 +0200, Mircea Gherzan wrote: 
> Hi Luciano,
> 
> Am 16.04.2012 12:48, schrieb Dan Carpenter:
> > Hello Mircea Gherzan,
> > 
> > The patch 690142e98826: "wl12xx: fix DMA-API-related warnings" from
> > Mar 17, 2012, leads to the following Smatch warning:
> > drivers/net/wireless/ti/wlcore/cmd.c:126 wl1271_cmd_wait_for_event_or_timeout()
> > 	 error: no modifiers for allocation.
> 
> How would you prefer my fix for this issue: as a new version of the
> original patch or as a separate new patch?

I have already applied and pushed your patch, so send a separate new
patch on top of it, please.

Actually, Dan already sent one fix, but it only fixes one place, I think
we need to fix a couple more places too:

http://www.spinics.net/lists/linux-wireless/msg88626.html

-- 
Cheers,
Luca.


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

end of thread, other threads:[~2012-04-19  4:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-16 10:48 wl12xx: fix DMA-API-related warnings Dan Carpenter
2012-04-18 22:59 ` Mircea Gherzan
2012-04-19  4:22   ` Luciano Coelho

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).