Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2035810pxy; Mon, 2 Aug 2021 17:30:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeM5o1jbgeeZCR2aMjMATGX+TYTKO0uzTbEWvCnPiZsO4Og/W8NkucI0ELZLAJ1/4CGv3k X-Received: by 2002:a17:906:3499:: with SMTP id g25mr18047365ejb.471.1627950612539; Mon, 02 Aug 2021 17:30:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627950612; cv=none; d=google.com; s=arc-20160816; b=Qz3q4/6D6MVz1IVTDNVNfmAdOT6CYEWIuX8oE4MZgcVH7/pUcWnYYteWk11mvMMMAj NBV0YzlMGdtRV1RQHBv7Ic3F0yYRMl/u9mlygD9xcuRcTA5r0hFrICZcrkaWjQEg/ngp gKpLZ8/0d7qr1XFRmp7Z8kkZ1nr7AWVOlq52gp9pjsI1TcTvhbok8GHxTksIoUKAaOlC AOdiZRG90I+k0UDp/0Kwr3RkRXTv68nHFtK5Wf+r51sjQRmZEJOPwSDWNQZRNEdi8Va5 xmg9s/sdFxaC0d90nYhXyhO4t5FZeRp52NhOS1g+ecCLeG7JcKESQIbjGeZbwStQBAQq UPEQ== 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=a6zMTnyhxtAg+is2Anr1ik8iwgNvzi3rO1H5TWqTrow=; b=kwhUCabuRXL1/voarGOsFVXE5fDoQIfYs1J4SPaPUdYLpVOl/Gc2ZOZatMg9HYgTYF s78hbWgGuBWp9n/8LGNyHBoi7Lu6cg5bcUUHXpKX5JDek7S+FNuzHcXG/pE+xi4OEB1g UbZIYQGcXTPdJ34TFWny+GwVi0r5x4yIVU0jlhLvK1YKZSBVEgNVPsiuf0HI4yENy/bD 7Zt5O0Nkv0ERP+r/+fGChvzlsrYnMTXPQTMHEdH4Wqtk0CwpRq/dvcCMExHE2/Ck07kV V6MXIK37uDoOkhwsTckUM6MWGofT8uMma7e99PoKu0LwLVRa7WXBpSsk8lQuGnZDF+c0 /LvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ms3MufsY; 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 ht8si11368129ejc.381.2021.08.02.17.29.48; Mon, 02 Aug 2021 17:30:12 -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=ms3MufsY; 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 S232829AbhHCA2V (ORCPT + 99 others); Mon, 2 Aug 2021 20:28:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232311AbhHCA2U (ORCPT ); Mon, 2 Aug 2021 20:28:20 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24EF6C06175F; Mon, 2 Aug 2021 17:28:10 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id l34-20020a05600c1d22b02902573c214807so566143wms.2; Mon, 02 Aug 2021 17:28:10 -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=a6zMTnyhxtAg+is2Anr1ik8iwgNvzi3rO1H5TWqTrow=; b=ms3MufsY0PL33FUD0/BqRTZXAw5KkvYccyQI0Zm3JxM6faJ4hI2TDbztO8P3KdB/eP YZhL703hny09+LjmCtS4xoXL3vWDRgxGK88uUG1eAO0V+HSxY7VTEVjEFWQFjRkqvn5x j6vHBV7fsAtT2BKPa7mn3XYyeH8dg17bfqH3pYspa2epPBaW42eLHa8iioS0gaqTRNFT YewIsOQfGmIdYs9iz0RtmyqsMm3XdKszxurVJGrow551BcJHZ02RXGjVnCzuGv0QKHtH Gu+ldbHqXpO6YigUSXkFidRQhUgenFuvPz9asjrAr4bN7VHjzeG/RVctULO8lTuJwRxX 0DiA== 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=a6zMTnyhxtAg+is2Anr1ik8iwgNvzi3rO1H5TWqTrow=; b=SpIOdCS4CMC3sOHNUl2M6JeQKA3ERo7bOFVWdiukT68TK5tBkc1QRlhIFF1ox+z46c d2dyULUDZj4NK3igNpiPO3Wvd4jb9TyhZeIM07squooA5ltf4vty++YvAcmP+spXu1Dn vPzC1i+6Zwv2JsbO2M8EJrEBQYBb8Pqtq9ksYgpSOTsJPbZJDNulmT527M8rYvV7/ioz 7awYWldeVKsrgi7ml9d07lQbS+IKyS2Nyhsyu9MFIxmgYnCGwSYtS+KCv6uNpCDqwn3Y bQTNiEhbh1yCg7Veu9Jm/TQnkInJM+AgkW+vPGJmrsEoKnkuE0/2KpcjI/028H/UzX+u inpA== X-Gm-Message-State: AOAM530+mfNcbXHI3TCvahjkUZjtjfgJCYaOKsSeYQ0/rzHipCM3QxD7 5XgSnCqDfkYDqtOZ0S27crzMTpAvavJMQg== X-Received: by 2002:a7b:c402:: with SMTP id k2mr1428731wmi.136.1627950488804; Mon, 02 Aug 2021 17:28:08 -0700 (PDT) Received: from pc ([196.235.140.151]) by smtp.gmail.com with ESMTPSA id l41sm12748562wmp.23.2021.08.02.17.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 17:28:08 -0700 (PDT) Date: Tue, 3 Aug 2021 01:28:06 +0100 From: Salah Triki To: Pete Zaitcev , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: class: usblp: replace conditional statement with min() Message-ID: <20210803002806.GA1541734@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 min() in order to make code cleaner. Issue found by coccinelle. Signed-off-by: Salah Triki --- drivers/usb/class/usblp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index f27b4aecff3d..fd779a989526 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c @@ -264,7 +264,7 @@ static int usblp_ctrl_msg(struct usblp *usblp, int request, int type, int dir, i dev_dbg(&usblp->intf->dev, "usblp_control_msg: rq: 0x%02x dir: %d recip: %d value: %d idx: %d len: %#x result: %d\n", request, !!dir, recip, value, index, len, retval); - return retval < 0 ? retval : 0; + return min(retval, 0); } #define usblp_read_status(usblp, status)\ -- 2.25.1