Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2043510pxy; Mon, 2 Aug 2021 17:43:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxDam/XAazxUpr+0l8rulAs3EKqnB9byZj9WhOQogdtRQ0XY3DErX/i9k8Mm6LJ9aX0ITO X-Received: by 2002:a05:6402:3128:: with SMTP id dd8mr22988133edb.367.1627951386210; Mon, 02 Aug 2021 17:43:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627951386; cv=none; d=google.com; s=arc-20160816; b=KmJd/7y7sfZKZE4heVYPeM86NFOtwdveRx4qJITYyaZRF+HSydfmKNlweEZ+u1s/be aZxg8CZ62wWv63Rx/4Cthyl4C1XeywNINdr0SxUNyEoq0Skm9XNzLsvGuGEX0XGYGK0K zEwvS0ccPanXK67AYMSB+Bv5JW6Cl9bgzuDX/8puYtGQo+YeIWdoSKxbsPkxnb4WjFn3 ajhIPuPt+DKnIrertc1hWd37yrlCPoRjzjUnxo3MUPkDXWTLejVGKS5+yDQ2z3XnS5nr NojSf9kJ1Btf8egKt526k5tYVLpfJ+l82NbF+qs+weXJa1X+N9SctkLhq3t6V6ahWCze C/wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=l/8Ed6S0tN2RxUJlIUubNrUkmTB8gmmGFdOP6HVjrCw=; b=qNCIYaqt1GEUCmoRblQRO22QxAiFSuqXB99NpriwZhTOerddtvIFnSN9X46F2nlVcs aNxlfpic3FkmNVwEwRFT5w7LF0m8qK6AVe0LK8lg8hvXKEVHG8gH5m2QY7eR1f0rdbZm jfUAMVDhi+dtahcrTgiCjXOEgTkdXoBOtD5Qke+wvxRAwY4HQqx1gqA9iMsVDruc0vYy 5Ld4q1Jjcko/anu1rWbT74I6wPsIQRL9sBzH6OYvol2Hqq1bag3kl13jsHAb9xi+kzVt bibOYEyCJu5cgO+Wml/I2c/ZJ4YmHpdoWGTn9IfSzFsEAq17kNC1hde7seAT3riRSkDD lTIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RHXZddUx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v22si10821564eds.314.2021.08.02.17.42.41; Mon, 02 Aug 2021 17:43:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RHXZddUx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233273AbhHCAjP (ORCPT + 99 others); Mon, 2 Aug 2021 20:39:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232540AbhHCAjM (ORCPT ); Mon, 2 Aug 2021 20:39:12 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AC46C06175F; Mon, 2 Aug 2021 17:39:01 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id h13so9913585wrp.1; Mon, 02 Aug 2021 17:39:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=l/8Ed6S0tN2RxUJlIUubNrUkmTB8gmmGFdOP6HVjrCw=; b=RHXZddUxeu9vMosOBdyoYFmH6hmpjVoW82NV/WeNb2JH88GZf9wV3rcfj4TWW4IP1h LNBcMyNVo6I0I9fOPXrhlB7U+5J3szLweAlwL7GoZn0AvijkIrnszvqT/QZ9q2IOQ37V juC3PmTDRpe3jJxNgnmRXMP3bM8Uwknaf7BpJLtsoO8FnpMhkIt7niYfYc3oV66LyoxG LgcsYLuI+4wlH5dDFZtKsX0K6CGFgomOGcBKU8p72aCd3b1s7/UqWXP50kGDHGxNazCA XZrxs/X9K7TbpiJZROpPYN0to6b+oc57Zi7gUwSR7DitI6RMucnxU7GgyY1Q3xlgiZYF +p+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=l/8Ed6S0tN2RxUJlIUubNrUkmTB8gmmGFdOP6HVjrCw=; b=MubJrcDesCtVaQ4yqwNF9X0U47Wbw0GpzaA2gpE2AO1kYul6uRAg7q3GzzA4ti8RLn ZpnaI2v4XYgGj6HsaX3esCxNlz0oJsFHoKk8jNtLp/73OvthHIOTFM2Lno6ZexZVd/ZW G0DTYGbLplq6LgIyZiQhLjDAdccBJPnuX1oX7/zIQDpC4alPqhHPd/UljSIf9xWCyFH6 0YeDz9miNvPUVYcb9yqyhEFbyM7/52RCiopuWNmMdr+xDqLWcDANIel14ef4k9kE9fJH I8rccRhFy4wZyKfHONYNN1FCUjbC9w0a7CHtBVKvyTSvzPZTa+Onok9Qbd7SjX2y8MkY gIrQ== X-Gm-Message-State: AOAM5308uiF/gAvqBKSCaDAGSqZTEfvI3frwr58SzLlSWYbeiyeSkDGU /3uiTbka0Q7UVtyVr03/p08= X-Received: by 2002:adf:f4c5:: with SMTP id h5mr18618668wrp.292.1627951140105; Mon, 02 Aug 2021 17:39:00 -0700 (PDT) Received: from pc ([196.235.140.151]) by smtp.gmail.com with ESMTPSA id z6sm11645350wmp.1.2021.08.02.17.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 17:38:59 -0700 (PDT) Date: Tue, 3 Aug 2021 01:38:57 +0100 From: Salah Triki To: Dmitry Torokhov , Salah Triki , Johan Hovold , Lee Jones , gregkh@linuxfoundation.org Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] input: touchscreen: replace conditional statement with max() Message-ID: <20210803003857.GA1560352@pc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace conditional statement with max() in order to make code cleaner. Issue found by coccinelle. Signed-off-by: Salah Triki --- drivers/input/touchscreen/usbtouchscreen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index 43c521f50c85..69f36d4f6cea 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c @@ -269,7 +269,7 @@ static int e2i_read_data(struct usbtouch_usb *dev, unsigned char *pkt) tmp = tmp - 0xA000; dev->touch = (tmp > 0); - dev->press = (tmp > 0 ? tmp : 0); + dev->press = max(tmp, 0); return 1; } -- 2.25.1