Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2412938ybi; Mon, 1 Jul 2019 11:35:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzYo9M98iO9PRY9KqxfBP9FVEsoJoYO2naPqGVMbyj+oG9me/0xAqwqkzFkUqglJxZC0mX X-Received: by 2002:a65:4cc4:: with SMTP id n4mr27091805pgt.307.1562006102765; Mon, 01 Jul 2019 11:35:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562006102; cv=none; d=google.com; s=arc-20160816; b=bXJrs0m1Ekb3+5a4y9eU2o5V+QMgteNxzCQ/6D6u96U03xhq+YZlq4ZWfWBeqvu+cU aruWviaq7WgjNINRZqd5AeOPmLjdgoIp7UcPBNKKtAxUmU+KskVoC/GAJGw2nfnHOXlr FxICvnmAmig/5gx5rGBJ6liKjvZ8y9aecioRv94bsJgvUOP9ZJP0S9qvnEmXw1o97B42 dQoTj9wnQtZBNrwDBF3BySI/YqQKFXuYnDMPstXkS8IPGbsxIBoxcZho8AITBCQvWhPK 5ztSJxhn84o63GR3XroKA5O2DfzgfDk8N3ku0p4RhlQHQe2WUChR/vhCV9Z5FWin8rzY WX0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=vo1i346r1xOesxPoRQa7nWWhSyL2ujUWb8aG0q2okzs=; b=VT3LL1NK1zFB25tvyAkZQtCe4u3/6TJShluQk/ZcXu+HhryDUE1jmZFjp2sbz102mQ 8dEFl8G2ymxIOfasXzfxZSzxK0q0VoTRFBirrkYJ1DbTgoIM31fpLvk2U5EorARgksOc 9Y6AUraOEnfqYVl4Ka2HVncxuBDlxRdAv8SxAA6eITRuR7B+KP8bGcbLTRKqKDmQjpTJ O2Y56ofqf5pSl0E+K4EQ3Ft6d6JwbwB6YE4p7/Laknf58p6mrbAyzo6WJTqzBiV8iOGr U/QjCsHG3DlfowP9y56+qBHnEgpN9YALmUXdGcJBQRLcRjB5tYtv+rvm0Ak8jLjhB57e Tv9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ThTM9wBx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id b96si568168pjc.0.2019.07.01.11.34.45; Mon, 01 Jul 2019 11:35:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ThTM9wBx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726586AbfGAScq (ORCPT + 99 others); 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-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-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.7.4