From patchwork Mon Jul 1 18:32:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hariprasad Kelam X-Patchwork-Id: 11026617 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8FF64138B for ; Mon, 1 Jul 2019 18:32:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 849931FE8D for ; Mon, 1 Jul 2019 18:32:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 792D2287BD; Mon, 1 Jul 2019 18:32:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 042EE1FE8D for ; Mon, 1 Jul 2019 18:32:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726442AbfGAScq (ORCPT ); Mon, 1 Jul 2019 14:32:46 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:40325 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725853AbfGAScq (ORCPT ); Mon, 1 Jul 2019 14:32:46 -0400 Received: by mail-pg1-f195.google.com with SMTP id w10so6425114pgj.7; Mon, 01 Jul 2019 11:32:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=vo1i346r1xOesxPoRQa7nWWhSyL2ujUWb8aG0q2okzs=; b=ThTM9wBxTrDRpjGI9ydlr5fF7lUNHmjx8j1Xwr+w3ReamdJ2UtrGNav7aDVtqMYFF9 wcXs6Ax/7BE0Zmpvlx2VZhsRzpjbOJ/DOSTJcmveZu8+UK1c7ZP9e4akKEW1zmPSYyjZ s+QcAExW2q1wYQ1rg/zJPx/s8w4bS3Xq2EPpISBPOaPb2JbfiZsjTaeKUwUE/3WzyYmf MkdPlJt9jJUGpWx4DXfiEwsD/FcT4SmiZa4WtraOYw67iwyLHJCdoNZguo1reL759ro6 vuxFdJwZAQtJEG3ATFpqV/fClwA9er9CsP8CO5hNwjDd1xscRkqS0ay0g8iMzxSvuM4N izFg== 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:subject:message-id:mime-version :content-disposition:user-agent; bh=vo1i346r1xOesxPoRQa7nWWhSyL2ujUWb8aG0q2okzs=; b=UjUU7dau5KE99bCC6llVzHXVrD5js+UershKD4+8oZH0jFOE0RHcum6AaPqKUdxmdS 2OCnyVshBX+nPpBGRVzBqa9YRdCNMRoCB9v/xPP4M9lcdUo+HNazVJoxTuLZDpUHAaXI G7Y87jJbj5p5gMfnzOMCa6Lg5CfdnM9zV1g9b6FUZv242dTrqNDQecC5W0TBmSnjyzk5 mVCOLl7CsKaJHzIEWkTYmLStQq+SXs7hXFKUraqyvkr8hr9M2XmjHVInpzF/UbPQKtjw gzgYEeksGfO9eltd6Z15GO6JXzw3hmHxA1RY4uBKRi2V31tVz5Sw5fDoDMy07JpVkXJs g+TA== X-Gm-Message-State: APjAAAWYBGKZhYYKPQj8FvP42K+MmzCs1Xr9xNb/B0CTn4+P5jXJfErg 9yFP+yLR2qYrBEfkDlAkmOQ= X-Google-Smtp-Source: APXvYqyNdvEi1XzOHbT0sCdF/WrgGzVtPHJ4XyV3sShwO2UtR1JkYsFW7El49dK+pDP+uJBUzvhdTA== X-Received: by 2002:a63:755e:: with SMTP id f30mr17934651pgn.246.1562005965725; Mon, 01 Jul 2019 11:32:45 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.92.187]) by smtp.gmail.com with ESMTPSA id br18sm216858pjb.20.2019.07.01.11.32.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jul 2019 11:32:44 -0700 (PDT) Date: Tue, 2 Jul 2019 00:02:41 +0530 From: Hariprasad Kelam To: Felipe Balbi , Greg Kroah-Hartman , Hariprasad Kelam , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [Patch v2] USB: gadget: function: fix issue Unneeded variable: "value" Message-ID: <20190701183241.GA13275@hari-Inspiron-1545> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP fix below issue reported by coccicheck drivers/usb/gadget/function/f_eem.c:169:7-12: Unneeded variable: "value". Return "- EOPNOTSUPP" on line 179 We can not change return type of eem_setup as its registered with callback function Signed-off-by: Hariprasad Kelam --- v2 fix typo in commit message drivers/usb/gadget/function/f_eem.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_eem.c b/drivers/usb/gadget/function/f_eem.c index c13befa..b81a91d 100644 --- a/drivers/usb/gadget/function/f_eem.c +++ b/drivers/usb/gadget/function/f_eem.c @@ -166,7 +166,6 @@ static struct usb_gadget_strings *eem_strings[] = { static int eem_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl) { struct usb_composite_dev *cdev = f->config->cdev; - int value = -EOPNOTSUPP; u16 w_index = le16_to_cpu(ctrl->wIndex); u16 w_value = le16_to_cpu(ctrl->wValue); u16 w_length = le16_to_cpu(ctrl->wLength); @@ -176,7 +175,7 @@ static int eem_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl) w_value, w_index, w_length); /* device either stalls (value < 0) or reports success */ - return value; + return -EOPNOTSUPP; }