blob: df70b1cf44e702df13486e41c1b9193f5b4f056c [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001From 18d360d74271a066a849bc1fba4f10dbb23ed251 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 8 Sep 2015 08:17:42 +0000
4Subject: [PATCH] Fix typo in comparision
5
6error: comparison of array 'devnm' equal to a null pointer is always false
7
8User bitwise '&' operator as it is a mask
9
10Fixes
11error: use of logical '&&' with constant operand
12
13Remove extraneous parens
14
15error: equality comparison with extraneous parentheses
16
17Remove dead code
18
19restripe.c:465:21: error: explicitly assigning value of variable of type 'int' to itself
20
21Signed-off-by: Khem Raj <raj.khem@gmail.com>
22---
23Upstream-Status: Pending
24
25 mdmon.h | 2 +-
26 mdopen.c | 2 +-
27 restripe.c | 3 ---
28 super-intel.c | 2 +-
29 4 files changed, 3 insertions(+), 6 deletions(-)
30
31diff --git a/mdmon.h b/mdmon.h
32index aa750c6..0b08c3d 100644
33--- a/mdmon.h
34+++ b/mdmon.h
35@@ -101,7 +101,7 @@ static inline int is_resync_complete(struct mdinfo *array)
36 break;
37 case 10:
38 l = array->array.layout;
39- ncopies = (l & 0xff) * ((l >> 8) && 0xff);
40+ ncopies = (l & 0xff) * ((l >> 8) & 0xff);
41 sync_size = array->component_size * array->array.raid_disks;
42 sync_size /= ncopies;
43 break;
44diff --git a/mdopen.c b/mdopen.c
45index 28410f4..c5ee2a6 100644
46--- a/mdopen.c
47+++ b/mdopen.c
48@@ -318,7 +318,7 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
49 else if (num < 0) {
50 /* need to choose a free number. */
51 char *_devnm = find_free_devnm(use_mdp);
52- if (devnm == NULL) {
53+ if (_devnm == NULL) {
54 pr_err("No avail md devices - aborting\n");
55 return -1;
56 }
57diff --git a/restripe.c b/restripe.c
58index 4d92190..cfe9666 100644
59--- a/restripe.c
60+++ b/restripe.c
61@@ -461,9 +461,6 @@ int raid6_check_disks(int data_disks, int start, int chunk_size,
62 curr_broken_disk = diskD;
63 }
64
65- if((Px == 0) && (Qx == 0))
66- curr_broken_disk = curr_broken_disk;
67-
68 if(curr_broken_disk >= data_disks + 2)
69 broken_status = 2;
70
71diff --git a/super-intel.c b/super-intel.c
72index 3f812d6..1838012 100644
73--- a/super-intel.c
74+++ b/super-intel.c
75@@ -10027,7 +10027,7 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st,
76 geo->size = max_size;
77 }
78
79- if ((direction == ROLLBACK_METADATA_CHANGES)) {
80+ if (direction == ROLLBACK_METADATA_CHANGES) {
81 /* accept size for rollback only
82 */
83 } else {
84--
852.5.1
86