aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/declance.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-06-16 15:08:06 -0400
committerDavid S. Miller <davem@davemloft.net>2011-06-21 18:48:29 -0400
commit43d620c82985b19008d87a437b4cf83f356264f7 (patch)
tree8ea6d9d1ab5d36e7bc130b5189997e12edb01fb6 /drivers/net/declance.c
parentdadbe85ac47f180fa1e3ef93b276ab7938b1a98b (diff)
drivers/net: Remove casts of void *
Unnecessary casts of void * clutter the code. These are the remainder casts after several specific patches to remove netdev_priv and dev_priv. Done via coccinelle script (and a little editing): $ cat cast_void_pointer.cocci @@ type T; T *pt; void *pv; @@ - pt = (T *)pv; + pt = pv; Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Acked-By: Chris Snook <chris.snook@gmail.com> Acked-by: Jon Mason <jdmason@kudzu.us> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: David Dillow <dave@thedillows.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/declance.c')
-rw-r--r--drivers/net/declance.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/drivers/net/declance.c b/drivers/net/declance.c
index 219eb5ad5c12..cabd3a542ef0 100644
--- a/drivers/net/declance.c
+++ b/drivers/net/declance.c
@@ -326,15 +326,18 @@ static void load_csrs(struct lance_private *lp)
326 */ 326 */
327static void cp_to_buf(const int type, void *to, const void *from, int len) 327static void cp_to_buf(const int type, void *to, const void *from, int len)
328{ 328{
329 unsigned short *tp, *fp, clen; 329 unsigned short *tp;
330 unsigned char *rtp, *rfp; 330 const unsigned short *fp;
331 unsigned short clen;
332 unsigned char *rtp;
333 const unsigned char *rfp;
331 334
332 if (type == PMAD_LANCE) { 335 if (type == PMAD_LANCE) {
333 memcpy(to, from, len); 336 memcpy(to, from, len);
334 } else if (type == PMAX_LANCE) { 337 } else if (type == PMAX_LANCE) {
335 clen = len >> 1; 338 clen = len >> 1;
336 tp = (unsigned short *) to; 339 tp = to;
337 fp = (unsigned short *) from; 340 fp = from;
338 341
339 while (clen--) { 342 while (clen--) {
340 *tp++ = *fp++; 343 *tp++ = *fp++;
@@ -342,8 +345,8 @@ static void cp_to_buf(const int type, void *to, const void *from, int len)
342 } 345 }
343 346
344 clen = len & 1; 347 clen = len & 1;
345 rtp = (unsigned char *) tp; 348 rtp = tp;
346 rfp = (unsigned char *) fp; 349 rfp = fp;
347 while (clen--) { 350 while (clen--) {
348 *rtp++ = *rfp++; 351 *rtp++ = *rfp++;
349 } 352 }
@@ -352,8 +355,8 @@ static void cp_to_buf(const int type, void *to, const void *from, int len)
352 * copy 16 Byte chunks 355 * copy 16 Byte chunks
353 */ 356 */
354 clen = len >> 4; 357 clen = len >> 4;
355 tp = (unsigned short *) to; 358 tp = to;
356 fp = (unsigned short *) from; 359 fp = from;
357 while (clen--) { 360 while (clen--) {
358 *tp++ = *fp++; 361 *tp++ = *fp++;
359 *tp++ = *fp++; 362 *tp++ = *fp++;
@@ -382,15 +385,18 @@ static void cp_to_buf(const int type, void *to, const void *from, int len)
382 385
383static void cp_from_buf(const int type, void *to, const void *from, int len) 386static void cp_from_buf(const int type, void *to, const void *from, int len)
384{ 387{
385 unsigned short *tp, *fp, clen; 388 unsigned short *tp;
386 unsigned char *rtp, *rfp; 389 const unsigned short *fp;
390 unsigned short clen;
391 unsigned char *rtp;
392 const unsigned char *rfp;
387 393
388 if (type == PMAD_LANCE) { 394 if (type == PMAD_LANCE) {
389 memcpy(to, from, len); 395 memcpy(to, from, len);
390 } else if (type == PMAX_LANCE) { 396 } else if (type == PMAX_LANCE) {
391 clen = len >> 1; 397 clen = len >> 1;
392 tp = (unsigned short *) to; 398 tp = to;
393 fp = (unsigned short *) from; 399 fp = from;
394 while (clen--) { 400 while (clen--) {
395 *tp++ = *fp++; 401 *tp++ = *fp++;
396 fp++; 402 fp++;
@@ -398,8 +404,8 @@ static void cp_from_buf(const int type, void *to, const void *from, int len)
398 404
399 clen = len & 1; 405 clen = len & 1;
400 406
401 rtp = (unsigned char *) tp; 407 rtp = tp;
402 rfp = (unsigned char *) fp; 408 rfp = fp;
403 409
404 while (clen--) { 410 while (clen--) {
405 *rtp++ = *rfp++; 411 *rtp++ = *rfp++;
@@ -410,8 +416,8 @@ static void cp_from_buf(const int type, void *to, const void *from, int len)
410 * copy 16 Byte chunks 416 * copy 16 Byte chunks
411 */ 417 */
412 clen = len >> 4; 418 clen = len >> 4;
413 tp = (unsigned short *) to; 419 tp = to;
414 fp = (unsigned short *) from; 420 fp = from;
415 while (clen--) { 421 while (clen--) {
416 *tp++ = *fp++; 422 *tp++ = *fp++;
417 *tp++ = *fp++; 423 *tp++ = *fp++;