Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262175AbTH3ARv (ORCPT ); Fri, 29 Aug 2003 20:17:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262217AbTH3ARv (ORCPT ); Fri, 29 Aug 2003 20:17:51 -0400 Received: from hermes.py.intel.com ([146.152.216.3]:53243 "EHLO hermes.py.intel.com") by vger.kernel.org with ESMTP id S262175AbTH3AQx (ORCPT ); Fri, 29 Aug 2003 20:16:53 -0400 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C36E8C.00BEEDD2" X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 Subject: RE: [PATCH] efivars update Date: Fri, 29 Aug 2003 17:16:48 -0700 Message-ID: X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: [PATCH] efivars update Thread-Index: AcNue13dqYDYnWvSQCitu7cFoqZoLQAEBu4Q From: "Tolentino, Matthew E" To: "Matt Domsch" Cc: , , "Matt Tolentino" X-OriginalArrivalTime: 30 Aug 2003 00:16:49.0040 (UTC) FILETIME=[01284900:01C36E8C] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 52536 Lines: 714 This is a multi-part message in MIME format. ------_=_NextPart_001_01C36E8C.00BEEDD2 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Matt, > Move the unlock up above the status test, else you return while > holding the lock on failure. Ouch. Thanks... > level on printk please. Fixed. > Might as well just force the deletion by setting Attributes=3D0 or > DataSize=3D0 or both. Less chance for userspace error. Good idea. =20 > Please kill this chunk. I shouldn't have had it there in the first=20 > place. :-) >=20 > Looks great to me! Thanks again. Sure thing. Updated patch attached.... matt ------_=_NextPart_001_01C36E8C.00BEEDD2 Content-Type: application/octet-stream; name="linux-2.6.0-test4-efivars2.patch" Content-Transfer-Encoding: base64 Content-Description: linux-2.6.0-test4-efivars2.patch Content-Disposition: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pOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqIGVmaXZhcl93cml0ZSgpCi0gKiBS ZXF1aXJlczogZGF0YSBpcyBhbiBlZmlfc2V0dmFyaWFibGVfdCBkYXRhIHR5cGUsCi0gKiAgICAg ICAgICAgcHJvcGVybHkgZmlsbGVkIGluLCBwb3NzaWJseSBieSBhIGNhbGwKLSAqICAgICAgICAg ICBmaXJzdCB0byBlZml2YXJfcmVhZCgpLgotICogICAgICAgICAgIENhbGxlciBtdXN0IGhhdmUg Q0FQX1NZU19BRE1JTgotICogTW9kaWZpZXM6IE5WUkFNCi0gKiBSZXR1cm5zOiB2YXJfZGF0YS0+ RGF0YVNpemUgb24gc3VjY2VzcywgZXJybm8gb24gZmFpbHVyZQotICoKLSAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyBp bnQKLWVmaXZhcl93cml0ZShzdHJ1Y3QgZmlsZSAqZmlsZSwgY29uc3QgY2hhciAqYnVmZmVyLAot CSAgICAgdW5zaWduZWQgbG9uZyBjb3VudCwgdm9pZCAqZGF0YSkKLXsKLQl1bnNpZ25lZCBsb25n IHN0cnNpemUxLCBzdHJzaXplMjsKLQlpbnQgZm91bmQ9MDsKLQlzdHJ1Y3QgbGlzdF9oZWFkICpw b3MsICpuOwotCXVuc2lnbmVkIGxvbmcgc2l6ZSA9IHNpemVvZihlZmlfdmFyaWFibGVfdCk7Ci0J ZWZpX3N0YXR1c190IHN0YXR1czsKLQllZml2YXJfZW50cnlfdCAqZWZpdmFyID0gZGF0YSwgKnNl YXJjaF9lZml2YXIgPSBOVUxMOwotCWVmaV92YXJpYWJsZV90ICp2YXJfZGF0YTsKLQlpZiAoIWRh dGEgfHwgY291bnQgIT0gc2l6ZSkgewotCQlwcmludGsoS0VSTl9XQVJOSU5HICJlZml2YXJzOiBp bXByb3BlciBzd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dWRlIDxsaW51eC9rb2JqZWN0Lmg+CiAjaW5jbHVkZSA8bGludXgvcnRjLmg+CiAjaW5jbHVkZSA8 bGludXgvaW9wb3J0Lmg+CiAK ------_=_NextPart_001_01C36E8C.00BEEDD2-- - 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/