diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-29 06:25:13 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:26 -0500 |
commit | 3205e4fe0d831c0457e9139794437e9999559150 (patch) | |
tree | 85a962496915ee9d53deeffe6d0a4de2cc5299dc /drivers/media/IR/ir-keytable.c | |
parent | b4622c14a1450fa40dd89dc134ec008fd1c2d38c (diff) |
V4L/DVB (13856): ir-keytable: simplify and avoid a warning
/home/v4l/buildtest/v4l-dvb-master/v4l/ir-keytable.c: In function 'ir_setkeycode':
/home/v4l/buildtest/v4l-dvb-master/v4l/ir-keytable.c:190: warning: 'newkeymap' may be used uninitialized in this function
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR/ir-keytable.c')
-rw-r--r-- | drivers/media/IR/ir-keytable.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c index 4c11a0167fc9..161d70b57965 100644 --- a/drivers/media/IR/ir-keytable.c +++ b/drivers/media/IR/ir-keytable.c | |||
@@ -185,18 +185,14 @@ static void ir_delete_key(struct ir_scancode_table *rc_tab, int elem) | |||
185 | int newsize = rc_tab->size - 1; | 185 | int newsize = rc_tab->size - 1; |
186 | int resize = ir_is_resize_needed(rc_tab, newsize); | 186 | int resize = ir_is_resize_needed(rc_tab, newsize); |
187 | struct ir_scancode *oldkeymap = rc_tab->scan; | 187 | struct ir_scancode *oldkeymap = rc_tab->scan; |
188 | struct ir_scancode *newkeymap; | 188 | struct ir_scancode *newkeymap = NULL; |
189 | 189 | ||
190 | if (resize) { | 190 | if (resize) |
191 | newkeymap = kzalloc(ir_roundup_tablesize(newsize) * | 191 | newkeymap = kzalloc(ir_roundup_tablesize(newsize) * |
192 | sizeof(*newkeymap), GFP_ATOMIC); | 192 | sizeof(*newkeymap), GFP_ATOMIC); |
193 | 193 | ||
194 | /* There's no memory for resize. Keep the old table */ | 194 | /* There's no memory for resize. Keep the old table */ |
195 | if (!newkeymap) | 195 | if (!resize || !newkeymap) { |
196 | resize = 0; | ||
197 | } | ||
198 | |||
199 | if (!resize) { | ||
200 | newkeymap = oldkeymap; | 196 | newkeymap = oldkeymap; |
201 | 197 | ||
202 | /* We'll modify the live table. Lock it */ | 198 | /* We'll modify the live table. Lock it */ |