Hello Martyn Welch,
The patch 2b82beb8c1bc: "Staging: vme: Add location monitor support
for ca91cx42" from Feb 18, 2010, leads to the following static
checker warning:
drivers/vme/bridges/vme_ca91cx42.c:1383 ca91cx42_lm_get()
warn: masked condition is always false. '(lm_ctl & (5 << 16)) == (1 <<
17)'
drivers/vme/bridges/vme_ca91cx42.c
1363 static int ca91cx42_lm_get(struct vme_lm_resource *lm,
1364 unsigned long long *lm_base, u32 *aspace, u32 *cycle)
1365 {
1366 u32 lm_ctl, enabled = 0;
1367 struct ca91cx42_driver *bridge;
1368
1369 bridge = lm->parent->driver_priv;
1370
1371 mutex_lock(&lm->mtx);
1372
1373 *lm_base = (unsigned long long)ioread32(bridge->base + LM_BS);
1374 lm_ctl = ioread32(bridge->base + LM_CTL);
1375
1376 if (lm_ctl & CA91CX42_LM_CTL_EN)
1377 enabled = 1;
1378
1379 if ((lm_ctl & CA91CX42_LM_CTL_AS_M) == CA91CX42_LM_CTL_AS_A16)
1380 *aspace = VME_A16;
1381 if ((lm_ctl & CA91CX42_LM_CTL_AS_M) == CA91CX42_LM_CTL_AS_A24)
1382 *aspace = VME_A24;
1383 if ((lm_ctl & CA91CX42_LM_CTL_AS_M) == CA91CX42_LM_CTL_AS_A32)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Never true.
1384 *aspace = VME_A32;
1385
1386 *cycle = 0;
1387 if (lm_ctl & CA91CX42_LM_CTL_SUPR)
1388 *cycle |= VME_SUPER;
1389 if (lm_ctl & CA91CX42_LM_CTL_NPRIV)
1390 *cycle |= VME_USER;
1391 if (lm_ctl & CA91CX42_LM_CTL_PGM)
1392 *cycle |= VME_PROG;
1393 if (lm_ctl & CA91CX42_LM_CTL_DATA)
1394 *cycle |= VME_DATA;
1395
1396 mutex_unlock(&lm->mtx);
1397
1398 return enabled;
1399 }
regards,
dan carpenter
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel