提交 95079b8a 编写于 作者: K Kang Hu 提交者: Dmitry Torokhov

Input: remove a redundant max() call

dev->hint_events_per_packet is guaranteed to be >= packet_size.
so an extra max() call is not needed.
Signed-off-by: NKang Hu <hukangustc@gmail.com>
Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 dfaaed08
......@@ -2048,7 +2048,7 @@ int input_register_device(struct input_dev *dev)
if (dev->hint_events_per_packet < packet_size)
dev->hint_events_per_packet = packet_size;
dev->max_vals = max(dev->hint_events_per_packet, packet_size) + 2;
dev->max_vals = dev->hint_events_per_packet + 2;
dev->vals = kcalloc(dev->max_vals, sizeof(*dev->vals), GFP_KERNEL);
if (!dev->vals) {
error = -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册