Re: [PATCH 09/16] wcn36xx: Add smd.c
From: Johannes Berg <johannes@sipsolutions.net>
Date: 2013-08-21 08:15:34
On Wed, 2013-08-21 at 09:58 +0200, Eugene Krasnikov wrote:
2013/8/20 Joe Perches [off-list ref]:quoted
On Tue, 2013-08-20 at 19:41 +0200, Eugene Krasnikov wrote:quoted
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c[]quoted
+int wcn36xx_smd_load_nv(struct wcn36xx *wcn) +{[]quoted
+ /* Add NV body itself */ + /* Rework me */ + memcpy(wcn->smd_buf + sizeof(msg_body), + (void *)(&nv_d->table) + fm_offset, + msg_body.nv_img_buffer_size);Does this really do what you want? Perhaps it should be: memcpy(wcn->smd_buf + sizeof(msg_body), ((void *)&nv_d->table) + fm_offset, msg_body.nv_img_buffer_size);Yes, this line is working. Tested it for ARM. Do you see any potential problems with this pointer operation?
It should really be u8* instead of void*, since void* pointer arithmetic isn't really defined I think? Other than that, this was just about precedence rules, and casts have a higher precedence. johannes