Re: [PATCH 1/3] High-res-timers part 1 (core) take 7

Stephen Hemminger (shemminger@osdl.org)
28 Oct 2002 15:53:28 -0800


--=-Xu7/1NHwAo/kx6nq7JMI
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

This patch does not apply cleanly against 2.5.44.

--=-Xu7/1NHwAo/kx6nq7JMI
Content-Disposition: attachment; filename=timer.c.rej
Content-Type: application/x-reject; name=timer.c.rej
Content-Transfer-Encoding: base64

KioqKioqKioqKioqKioqCioqKiAyNSw2MiAqKioqCiAgI2luY2x1ZGUgPGxpbnV4L2luaXQuaD4K
ICAjaW5jbHVkZSA8bGludXgvbW0uaD4KICAKICAjaW5jbHVkZSA8YXNtL3VhY2Nlc3MuaD4KICAK
ICAvKgogICAqIHBlci1DUFUgdGltZXIgdmVjdG9yIGRlZmluaXRpb25zOgogICAqLwotICNkZWZp
bmUgVFZOX0JJVFMgNgotICNkZWZpbmUgVFZSX0JJVFMgOAotICNkZWZpbmUgVFZOX1NJWkUgKDEg
PDwgVFZOX0JJVFMpCi0gI2RlZmluZSBUVlJfU0laRSAoMSA8PCBUVlJfQklUUykKLSAjZGVmaW5l
IFRWTl9NQVNLIChUVk5fU0laRSAtIDEpCi0gI2RlZmluZSBUVlJfTUFTSyAoVFZSX1NJWkUgLSAx
KQotIAotIHR5cGVkZWYgc3RydWN0IHR2ZWNfcyB7Ci0gCWludCBpbmRleDsKLSAJc3RydWN0IGxp
c3RfaGVhZCB2ZWNbVFZOX1NJWkVdOwotIH0gdHZlY190OwotIAotIHR5cGVkZWYgc3RydWN0IHR2
ZWNfcm9vdF9zIHsKLSAJaW50IGluZGV4OwotIAlzdHJ1Y3QgbGlzdF9oZWFkIHZlY1tUVlJfU0la
RV07Ci0gfSB0dmVjX3Jvb3RfdDsKLSAKICAKICBzdHJ1Y3QgdHZlY190X2Jhc2VfcyB7CiAgCXNw
aW5sb2NrX3QgbG9jazsKICAJdW5zaWduZWQgbG9uZyB0aW1lcl9qaWZmaWVzOwotIAlzdH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ZXIgdG8gYmFjayBvdXQgdGhlIGxhc3QgYnVtcCwgdGhhbiB0byBwcmV2ZW50
IGl0LgorIAkgKiBUaGlzIGFsbG93cyB6ZXJvIHRpbWUgaW5zZXJ0cyBhcyB3ZWxsIGFzIHN1Yl9q
aWZmaWUgdmFsdWVzIGluCisgCSAqIHRoZSBjdXJyZW50IGppZmZpZS4JRGlkIG5vdCB3b3JrIGZv
ciB0aGUgY2FzY2FkZSBhcyB0djEuaW5kZXgKKyAJICogYWxzbyBuZWVkcyBhZGp1c3RpbmcuIAor
IAkgKi8KKyAJLS1iYXNlLT50aW1lcl9qaWZmaWVzOwogIAliYXNlLT5ydW5uaW5nX3RpbWVyID0g
TlVMTDsKKyAKKyAJSUZfSElHSF9SRVMoaWYgKHNjaGVkdWxlX25leHRfaW50KCBqaWZmaWVzX2Ys
IHN1Yl9qaWZmLCAwKSl7CisgCQkvKgorIAkJICogSWYgc2NoZWR1bGVfbmV4dF9pbnQgc2F5cyB0
aGUgdGltZSBoYXMgcGFzc2VkCisgCQkgKiBidW1wIHRoZSB0YXNrbGV0IGxvY2sgc28gd2UgZ28g
cm91bmQgYWdhaW4KKyAJCSAqLworIAkJcnVuX2xvY2FsX3RpbWVycygpOworIAkJfSk7CisgCiAg
CXNwaW5fdW5sb2NrX2lycSgmYmFzZS0+bG9jayk7CiAgfQogIAo=

--=-Xu7/1NHwAo/kx6nq7JMI--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/