Skip to content

Commit

Permalink
V4L/DVB (13530): Fix wrong parameter order in memset
Browse files Browse the repository at this point in the history
Edwin Török found the following:

In function ‘memset’,
inlined from ‘ir_input_init’ at drivers/media/common/ir-functions.c:67:
/home/edwin/builds/linux-2.6/arch/x86/include/asm/string_64.h:61:
warning: call to ‘__warn_memset_zero_len’ declared with attribute
warning: memset used with constant zero length parameter; this could be
due to transposed parameters
memset(ir->ir_codes, sizeof(ir->ir_codes), 0);

In actual practice the only caller I can find happens to already have cleared
the buffer before calling ir_input_init.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Alan Cox authored and Mauro Carvalho Chehab committed Nov 27, 2009
1 parent 9807362 commit 361c951
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/common/ir-functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void ir_input_init(struct input_dev *dev, struct ir_input_state *ir,

ir->ir_type = ir_type;

memset(ir->ir_codes, sizeof(ir->ir_codes), 0);
memset(ir->ir_codes, 0, sizeof(ir->ir_codes));

/*
* FIXME: This is a temporary workaround to use the new IR tables
Expand Down

0 comments on commit 361c951

Please sign in to comment.