Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932196AbWJASyB (ORCPT ); Sun, 1 Oct 2006 14:54:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932198AbWJASyA (ORCPT ); Sun, 1 Oct 2006 14:54:00 -0400 Received: from mout1.freenet.de ([194.97.50.132]:33670 "EHLO mout1.freenet.de") by vger.kernel.org with ESMTP id S932196AbWJASx7 (ORCPT ); Sun, 1 Oct 2006 14:53:59 -0400 Date: Sun, 01 Oct 2006 20:54:41 +0200 To: "linux-kernel@vger.kernel.org" Subject: [PATCH 3/4] 2.6.18-mm2 pktcdvd: restructure code Reply-To: balagi@justmail.de From: "Thomas Maier" Cc: "petero2@telia.com" , akpm@osdl.org Content-Type: multipart/mixed; boundary=----------Y2hhvRwqcIOZiECmWFyQeq MIME-Version: 1.0 Message-ID: User-Agent: Opera Mail/9.00 (Win32) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 48598 Lines: 763 ------------Y2hhvRwqcIOZiECmWFyQeq Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Hi, this patch 3/4 for pktcdvd against Linux 2.6.18 (stable) or 2.6.18-mm2 restructures the code for better readability and prepares it for the sysfs interface code following in patch 4/4. You must first apply patch 1/4 and 2/4 ! Sorry, my mail client damages the patch, so please use the (text) attachment or get the patch from http://people.freenet.de/BalaGi/download/3-restruct-pktcdvd-patch-2.6.18 The merged patch (parts 1 to 4) is available at: http://people.freenet.de/BalaGi/download/pktcdvd-patch-2.6.18 Signed-off-by: Thomas Maier ------------Y2hhvRwqcIOZiECmWFyQeq Content-Disposition: attachment; filename=3-restruct-pktcdvd-patch-2.6.18 Content-Type: application/octet-stream; name=3-restruct-pktcdvd-patch-2.6.18 Content-Transfer-Encoding: Base64 ZGlmZiAtdXJwTiBwMi1wcm9jZnMvZHJpdmVycy9ibG9jay9wa3RjZHZkLmMgcDMt cmVzdHJ1Y3Qv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zKTsKKwl9 IGVsc2UgeworCQlwa3Rfc2V0X3NwZWVkKHBkLCBNQVhfU1BFRUQsIE1BWF9TUEVF RCk7CisJCWNsZWFyX2JpdChQQUNLRVRfV1JJVEFCTEUsICZwZC0+ZmxhZ3MpOwor CX0KKworCWlmICgocmV0ID0gcGt0X3NldF9zZWdtZW50X21lcmdpbmcocGQsIHEp KSkKKwkJZ290byBvdXRfdW5jbGFpbTsKKworCWlmICh3cml0ZSkgeworCQlpZiAo IXBrdF9ncm93X3BrdGxpc3QocGQsIENPTkZJR19DRFJPTV9QS1RDRFZEX0JVRkZF UlMpKSB7CisJCQlwcmludGsoRFJJVkVSX05BTUUiOiBub3QgZW5vdWdoIG1lbW9y eSBmb3IgYnVmZmVyc1xuIik7CiAJCQlyZXQgPSAtRU5PTUVNOwogCQkJZ290byBv dXRfdW5jbGFpbTsKIAkJfQpAQCAtMjAwMiwxMiArMjM4NywxMiBAQCBzdGF0aWMg dm9pZCBwa3RfcmVsZWFzZV9kZXYoc3RydWN0IHBrdGNkCiAJcGt0X3Nocmlua19w a3RsaXN0KHBkKTsKIH0KIAotc3RhdGljIHN0cnVjdCBwa3RjZHZkX2RldmljZSAq cGt0X2ZpbmRfZGV2X2Zyb21fbWlub3IoaW50IGRldl9taW5vcikKLXsKLQlpZiAo ZGV2X21pbm9yID49IE1BWF9XUklURVJTKQotCQlyZXR1cm4gTlVMTDsKLQlyZXR1 cm4gcGt0X2RldnNbZGV2X21pbm9yXTsKLX0KKworLyoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KgorICoKKyAqIHBrdGNkdmQgYmxvY2sgZGV2aWNlIG9wZXJhdGlvbnMKKyAqCisg KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiovCiAKIHN0YXRpYyBpbnQgcGt0X29wZW4oc3RydWN0 IGlub2RlICppbm9kZSwgc3RydWN0I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yYXRpb25zIHBrdGNkdmRfb3BzID0geworCS5vd25lciA9CQlUSElT X01PRFVMRSwKKwkub3BlbiA9CQkJcGt0X29wZW4sCisJLnJlbGVhc2UgPQkJcGt0 X2Nsb3NlLAorCS5pb2N0bCA9CQlwa3RfaW9jdGwsCisJLm1lZGlhX2NoYW5nZWQg PQlwa3RfbWVkaWFfY2hhbmdlZCwKK307CiAKLQkvKgotCSAqIEEgYmlvIDw9IFBB R0VfU0laRSBtdXN0IGJlIGFsbG93ZWQuIElmIGl0IGNyb3NzZXMgYSBwYWNrZXQK LQkgKiBib3VuZGFyeSwgcGt0X21ha2VfcmVxdWVzdCgpIHdpbGwgc3BsaXQgdGhl IGJpby4KLQkgKi8KLQlyZW1haW5pbmcyID0gUEFHRV9TSVpFIC0gYmlvLT5iaV9z aXplOwotCXJlbWFpbmluZyA9IG1heChyZW1haW5pbmcsIHJlbWFpbmluZzIpOwog Ci0JQlVHX09OKHJlbWFpbmluZyA8IDApOwotCXJldHVybiByZW1haW5pbmc7Ci19 CisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBwYWNrZXQgZGV2aWNl IHNldHVwIGFuZCByZW1vdmFsCisgKgorICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiov CiAKKy8qCisgKiBoZWxwZXIgZm9yIHBrdF9uZXdfZGV2KCkKKyAqLwogc3RhdGlj IHZvaWQgcGt0X2luaXRfcXVldWUoc3RydWN0IHBrdGNkdmRfZGV2aWNlICpwZCkK IHsKIAlyZXF1ZXN0X3F1ZXVlX3QgKnEgPSBwZC0+ZGlzay0+cXVldWU7CkBAIC0y MjQ2LDgwICsyNTMyLDkgQEAgc3RhdGljIHZvaWQgcGt0X2luaXRfcXVldWUoc3Ry dWN0IHBrdGNkdgogCWJsa19xdWV1ZV9tZXJnZV9idmVjKH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F9kZXY7CQkJCS8qIGluL291dDogRGV2aWNlIG5yIGZvciBwYWNr ZXQgZGV2aWNlICovCisJX191MzIgbnVtX2RldmljZXM7CQkJLyogb3V0OiBMYXJn ZXN0IGRldmljZSBpbmRleCArIDEgKi8KKwlfX3UzMiBwYWRkaW5nOwkJCQkvKiBO b3QgdXNlZCAqLworfTsKKworLyoKKyAqIHBhY2tldCBpb2N0bHMKKyAqLworI2Rl ZmluZSBQQUNLRVRfSU9DVExfTUFHSUMJKCdYJykKKyNkZWZpbmUgUEFDS0VUX0NU UkxfQ01ECQlfSU9XUihQQUNLRVRfSU9DVExfTUFHSUMsIDEsIHN0cnVjdCBwa3Rf Y3RybF9jb21tYW5kKQorCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioK KyAqIGRlZmluZXMgYW5kIHN0cnVjdHMgdXNlZCBpbiB0aGUga2VybmVsIG9ubHkK KyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmZGVmIF9fS0VSTkVMX18K KyNpbmNsdWRlIDxsaW51eC9ibGtkZXYuaD4KKyNpbmNsdWRlIDxsaW51eC9jb21w bGV0aW9uLmg+CisjaW5jbHVkZSA8bGludXgvY2Ryb20uaD4KKworCiAvKgogICog MSBmb3Igbm9ybWFsIGRlYnVnIG1lc3NhZ2VzLCAyIGlzIHZlcnkgdmVyYm9zZS4g MCB0byB0dXJuIGl0IG9mZi4KICAqLwpAQCAtMzksOSArNjksMTMgQEAKICNkZWZp bmUgVVNFX1dDQUNISU5HCQkwCiAjZW5kaWYKIAotLyoKLSAqIE5vIHVzZXItc2Vy dmljYWJsZSBwYXJ0cyBiZXlvbmQgdGhpcyBwb2ludCAtPgotICovCisvKiB1c2Ug KG9sZCkgcHJvY2ZzIGludGVyZmFjZT8gKi8KKyNpZmRlZiBDT05GSUdf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sdWRlIDxsaW51eC9jb21wbGV0aW9u Lmg+Ci0jaW5jbHVkZSA8bGludXgvY2Ryb20uaD4KLQotLyogdXNlIChvbGQpIHBy b2NmcyBpbnRlcmZhY2U/ICovCi0jaWZkZWYgQ09ORklHX0NEUk9NX1BLVENEVkRf UFJPQ0lOVEYKLSNkZWZpbmUgUEtUX1VTRV9QUk9DRlMgIDEKLSNlbHNlCi0jZGVm aW5lIFBLVF9VU0VfUFJPQ0ZTICAwCi0jZW5kaWYKLQogc3RydWN0IHBhY2tldF9z ZXR0aW5ncwogewogCV9fdTMyCQkJc2l6ZTsJCS8qIHBhY2tldCBzaXplIGluICg1 MTIgYnl0ZSkgc2VjdG9ycyAqLwo= ------------Y2hhvRwqcIOZiECmWFyQeq-- - 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/