Input: remove a redundant max() call
authorKang Hu <hukangustc@gmail.com>
Thu, 31 Oct 2013 07:47:53 +0000 (00:47 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 31 Oct 2013 15:46:07 +0000 (08:46 -0700)
dev->hint_events_per_packet is guaranteed to be >= packet_size.
so an extra max() call is not needed.

Signed-off-by: Kang Hu <hukangustc@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/input.c

index c0446992892533b24d3853d043cf088451db5662..fb513daa40f7e3836d64907e30df801bc66d049a 100644 (file)
@@ -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;