Thread (2 messages) 2 messages, 2 authors, 2011-02-21

RE: [PATCH][v1] driver/FSL SATA:Fix wrong Device Error Register usage

flat view

From: David Laight <hidden>
Date: 2011-02-21 09:24:35

The patch changes the code to:
quoted hunk ↗ jump to hunk
 		if (ap->nr_pmp_links) {
+			int dev_num;
 			dereg =3D ioread32(hcr_base + DE);
...
quoted hunk ↗ jump to hunk
+			dev_num =3D ffs(dereg)-1;
+			if (dev_num < ap->nr_pmp_links) {
+				link =3D &ap->pmp_link[dev_num];
On the off chance that no bits are set in 'DE' this
code depends on nr_pmp_links being unsigned (since
dev_num becomes -1.

Changing 'dev_num' to 'unsigned int' would be better.

	David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help