All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <200608221601.24882.arnd.bergmann@de.ibm.com>

diff --git a/a/1.txt b/N1/1.txt
index 2009b81..7ec0970 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -1,20 +1,35 @@
-T24gVHVlc2RheSAyMiBBdWd1c3QgMjAwNiAxNDo1MywgSmFuLUJlcm5kIFRoZW1hbm4gd3JvdGU6
-Cj4gK6CgoKCgoKB1NjQgcnBhZ2UgPSAwOwo+ICugoKCgoKCgaW50IHJldDsKPiAroKCgoKCgoGlu
-dCBjbnQgPSAwOwo+ICugoKCgoKCgdm9pZCAqdnBhZ2UgPSBOVUxMOwo+ICsKPiAroKCgoKCgoHJl
-dCA9IGh3X3F1ZXVlX2N0b3IoaHdfcXVldWUsIG5yX3BhZ2VzLCBFSEVBX1BBR0VTSVpFLCB3cWVf
-c2l6ZSk7Cj4gK6CgoKCgoKBpZiAocmV0KQo+ICugoKCgoKCgoKCgoKCgoKByZXR1cm4gcmV0Owo+
-ICsKPiAroKCgoKCgoGZvciAoY250ID0gMDsgY250IDwgbnJfcGFnZXM7IGNudCsrKSB7Cj4gK6Cg
-oKCgoKCgoKCgoKCgoHZwYWdlID0gaHdfcXBhZ2VpdF9nZXRfaW5jKGh3X3F1ZXVlKTsKPiAroKCg
-oKCgoKCgoKCgoKCgaWYgKCF2cGFnZSkgewo+ICugoKCgoKCgoKCgoKCgoKCgoKCgoKCgoGVoZWFf
-ZXJyb3IoImh3X3FwYWdlaXRfZ2V0X2luYyBmYWlsZWQiKTsKPiAroKCgoKCgoKCgoKCgoKCgoKCg
-oKCgoKBnb3RvIHFwX2FsbG9jX3JlZ2lzdGVyX2V4aXQwOwo+ICugoKCgoKCgoKCgoKCgoKB9Cj4g
-K6CgoKCgoKCgoKCgoKCgoHJwYWdlID0gdmlydF90b19hYnModnBhZ2UpOwoKQXMgc29tZW9uZSBt
-ZW50aW9uZWQgYmVmb3JlLCB0aGUgaW5pdGlhbGl6YXRpb24gdG8gMCBvciBOVUxMCmlzIHBvaW50
-bGVzcyBoZXJlLCBhcyB0aGUgdmFyaWFibGVzIGFyZSBhbHdheXMgYXNzaWduZWQgYmVmb3JlCnRo
-ZXkgYXJlIHVzZWQuIFRoZXJlIGFyZSBhIG51bWJlciBvZiBvdGhlciBwbGFjZXMgaW4geW91cgpj
-b2RlIHRoYXQgZG8gc2ltaWxhciB0aGluZ3MsIHlvdSBzaG91bGQgcHJvYmFibHkgZ28gdGhyb3Vn
-aAp0aGVzZSBhbmQgcmVtb3ZlIHRoZSBpbml0aWFsaXplcnMuCgpJZiB5b3UgaW5kZWVkIG5lZWQg
-c29tZXRoaW5nIHRvIGJlIGluaXRpYWxpemVkLCBpdCBpcyBnb29kIHByYWN0aWNlCnRvIGRvIHRo
-ZSBpbml0aWFsaXphdGlvbiBhcyBsYXRlIGFzIHBvc3NpYmxlLCBlLmcuCgoJaW50IGZvbzsKCS4u
-LgoJZm9vID0gMDsKCWRvX2Zvbyhmb28pOwoKdG8gbWFrZSBpdCBjbGVhciB0aGF0IHlvdSBoYXZl
-IGEgcmVhc29uIHRvIGluaXRpYWxpemUgaXQuCgoJQXJuZCA8PjwK
+On Tuesday 22 August 2006 14:53, Jan-Bernd Themann wrote:
+> +       u64 rpage = 0;
+> +       int ret;
+> +       int cnt = 0;
+> +       void *vpage = NULL;
+> +
+> +       ret = hw_queue_ctor(hw_queue, nr_pages, EHEA_PAGESIZE, wqe_size);
+> +       if (ret)
+> +               return ret;
+> +
+> +       for (cnt = 0; cnt < nr_pages; cnt++) {
+> +               vpage = hw_qpageit_get_inc(hw_queue);
+> +               if (!vpage) {
+> +                       ehea_error("hw_qpageit_get_inc failed");
+> +                       goto qp_alloc_register_exit0;
+> +               }
+> +               rpage = virt_to_abs(vpage);
+
+As someone mentioned before, the initialization to 0 or NULL
+is pointless here, as the variables are always assigned before
+they are used. There are a number of other places in your
+code that do similar things, you should probably go through
+these and remove the initializers.
+
+If you indeed need something to be initialized, it is good practice
+to do the initialization as late as possible, e.g.
+
+	int foo;
+	...
+	foo = 0;
+	do_foo(foo);
+
+to make it clear that you have a reason to initialize it.
+
+	Arnd <><
diff --git a/a/content_digest b/N1/content_digest
index 2d6fa3c..74cae72 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -12,25 +12,40 @@
  " Marcus Eder <meder@de.ibm.com>\0"
  "\00:1\0"
  "b\0"
- "T24gVHVlc2RheSAyMiBBdWd1c3QgMjAwNiAxNDo1MywgSmFuLUJlcm5kIFRoZW1hbm4gd3JvdGU6\n"
- "Cj4gK6CgoKCgoKB1NjQgcnBhZ2UgPSAwOwo+ICugoKCgoKCgaW50IHJldDsKPiAroKCgoKCgoGlu\n"
- "dCBjbnQgPSAwOwo+ICugoKCgoKCgdm9pZCAqdnBhZ2UgPSBOVUxMOwo+ICsKPiAroKCgoKCgoHJl\n"
- "dCA9IGh3X3F1ZXVlX2N0b3IoaHdfcXVldWUsIG5yX3BhZ2VzLCBFSEVBX1BBR0VTSVpFLCB3cWVf\n"
- "c2l6ZSk7Cj4gK6CgoKCgoKBpZiAocmV0KQo+ICugoKCgoKCgoKCgoKCgoKByZXR1cm4gcmV0Owo+\n"
- "ICsKPiAroKCgoKCgoGZvciAoY250ID0gMDsgY250IDwgbnJfcGFnZXM7IGNudCsrKSB7Cj4gK6Cg\n"
- "oKCgoKCgoKCgoKCgoHZwYWdlID0gaHdfcXBhZ2VpdF9nZXRfaW5jKGh3X3F1ZXVlKTsKPiAroKCg\n"
- "oKCgoKCgoKCgoKCgaWYgKCF2cGFnZSkgewo+ICugoKCgoKCgoKCgoKCgoKCgoKCgoKCgoGVoZWFf\n"
- "ZXJyb3IoImh3X3FwYWdlaXRfZ2V0X2luYyBmYWlsZWQiKTsKPiAroKCgoKCgoKCgoKCgoKCgoKCg\n"
- "oKCgoKBnb3RvIHFwX2FsbG9jX3JlZ2lzdGVyX2V4aXQwOwo+ICugoKCgoKCgoKCgoKCgoKB9Cj4g\n"
- "K6CgoKCgoKCgoKCgoKCgoHJwYWdlID0gdmlydF90b19hYnModnBhZ2UpOwoKQXMgc29tZW9uZSBt\n"
- "ZW50aW9uZWQgYmVmb3JlLCB0aGUgaW5pdGlhbGl6YXRpb24gdG8gMCBvciBOVUxMCmlzIHBvaW50\n"
- "bGVzcyBoZXJlLCBhcyB0aGUgdmFyaWFibGVzIGFyZSBhbHdheXMgYXNzaWduZWQgYmVmb3JlCnRo\n"
- "ZXkgYXJlIHVzZWQuIFRoZXJlIGFyZSBhIG51bWJlciBvZiBvdGhlciBwbGFjZXMgaW4geW91cgpj\n"
- "b2RlIHRoYXQgZG8gc2ltaWxhciB0aGluZ3MsIHlvdSBzaG91bGQgcHJvYmFibHkgZ28gdGhyb3Vn\n"
- "aAp0aGVzZSBhbmQgcmVtb3ZlIHRoZSBpbml0aWFsaXplcnMuCgpJZiB5b3UgaW5kZWVkIG5lZWQg\n"
- "c29tZXRoaW5nIHRvIGJlIGluaXRpYWxpemVkLCBpdCBpcyBnb29kIHByYWN0aWNlCnRvIGRvIHRo\n"
- "ZSBpbml0aWFsaXphdGlvbiBhcyBsYXRlIGFzIHBvc3NpYmxlLCBlLmcuCgoJaW50IGZvbzsKCS4u\n"
- "LgoJZm9vID0gMDsKCWRvX2Zvbyhmb28pOwoKdG8gbWFrZSBpdCBjbGVhciB0aGF0IHlvdSBoYXZl\n"
- IGEgcmVhc29uIHRvIGluaXRpYWxpemUgaXQuCgoJQXJuZCA8PjwK
+ "On Tuesday 22 August 2006 14:53, Jan-Bernd Themann wrote:\n"
+ "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240u64 rpage = 0;\n"
+ "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240int ret;\n"
+ "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240int cnt = 0;\n"
+ "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240void *vpage = NULL;\n"
+ "> +\n"
+ "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240ret = hw_queue_ctor(hw_queue, nr_pages, EHEA_PAGESIZE, wqe_size);\n"
+ "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240if (ret)\n"
+ "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240return ret;\n"
+ "> +\n"
+ "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240for (cnt = 0; cnt < nr_pages; cnt++) {\n"
+ "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240vpage = hw_qpageit_get_inc(hw_queue);\n"
+ "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240if (!vpage) {\n"
+ "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240ehea_error(\"hw_qpageit_get_inc failed\");\n"
+ "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240goto qp_alloc_register_exit0;\n"
+ "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240}\n"
+ "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240rpage = virt_to_abs(vpage);\n"
+ "\n"
+ "As someone mentioned before, the initialization to 0 or NULL\n"
+ "is pointless here, as the variables are always assigned before\n"
+ "they are used. There are a number of other places in your\n"
+ "code that do similar things, you should probably go through\n"
+ "these and remove the initializers.\n"
+ "\n"
+ "If you indeed need something to be initialized, it is good practice\n"
+ "to do the initialization as late as possible, e.g.\n"
+ "\n"
+ "\tint foo;\n"
+ "\t...\n"
+ "\tfoo = 0;\n"
+ "\tdo_foo(foo);\n"
+ "\n"
+ "to make it clear that you have a reason to initialize it.\n"
+ "\n"
+ "\tArnd <><"
 
-f8b521160f44cc1005ecfa81881157be4eeacd8d3bf016355c39a8b0de1534dd
+13bfdaf325086f742e680d12864e4c7be3925e8666c6675be3ce6bba575aa493

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.