Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2403017ybi; Mon, 1 Jul 2019 11:23:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzE+IYYPWBNBdGdZVw4QMuQtl1CPff60jWZ/wfSrjYqrY+0mewGhv1q5bAZqEP3P7y0s0qT X-Received: by 2002:a17:902:a414:: with SMTP id p20mr28969422plq.187.1562005434725; Mon, 01 Jul 2019 11:23:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562005434; cv=none; d=google.com; s=arc-20160816; b=wO/kayH+8bb079bgPv1Crw6Wvy9M4nZz2EOw6AloUCGDgyIecOc8jDs0MCRxqeTZcK GIlt1mbTlXtQPEOj+VGLxuO9MpaNprgmpbfEwNY6rdNDOUmuIV5/0QrKb7w2aXU3m6ux A4qd6iMwpcbrIImnzSS1BJfMRkZ6l9edp/ujHUAS6G6NzIY3zzuJbnuTpJolGoRB99s2 gKZ3xkw/iwjpqhQUpxPe/N+XIVbsMm9nDOj/2fuiKeEVZC1CcoizsYaSgBwe+RdKriJT xuvmEfMxxQZj88t/nlXiQ8OSAI1tQa1xTwM4taja1lvaMayf49DUWGBhThSo9L5gesdQ VsKQ== 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=xv1X++7+CI+KR+tJVwJzAPl/RmtdeOQuhyVLw8iciNU=; b=C7yxBcaF5WsETV55i05bBOXWI2+Zj9vJfdVxEq7ypmzkCMD0yG+O8UkChrklTYrgOZ M06+V7JBlrdOGyco8ar2Zq0bgzrGtYgD5D3t8RKntn2B+2A/p/2U81MQbIo5bPfWdlF0 GQNqCD3X30bWcP5w8OljlIOeCW+fBRAzyl4AVCZXMgx8gKqMlu5YTPQpsMyZksoSJ+LZ Cco1Mq93TijEwmWTCu72IVUcmgVGP7u/ERAjErMr4LzC4DujvaZ47n82hIbE4HGK6ztx cU6rXi/vSt+rNKAgwam5CSfBEYa22XRwiZkWKLYm93+/2MD3tg/lSovhXfOlTteEIQfk QWEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DH6GkKqO; 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 e123si12223584pfa.252.2019.07.01.11.23.40; Mon, 01 Jul 2019 11:23:54 -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=DH6GkKqO; 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 S1727277AbfGASUi (ORCPT + 99 others); Mon, 1 Jul 2019 14:20:38 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:42723 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727255AbfGASUi (ORCPT ); Mon, 1 Jul 2019 14:20:38 -0400 Received: by mail-pl1-f195.google.com with SMTP id ay6so7716151plb.9; Mon, 01 Jul 2019 11:20:37 -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=xv1X++7+CI+KR+tJVwJzAPl/RmtdeOQuhyVLw8iciNU=; b=DH6GkKqOT5YLbrfoJIxW4QbU0VIhZpjq3lUNJkf3qYJHheK+Qw3FFiHXqqj/QObvjI ymZ8SAbIPtGCmSfLr92WLx+ve5/g1+HQmanI0flHh5YVfZWkdw77ZdB1lnVkodbJZIyo Q65JksjK0jc21mhT4hheYRLD0y9LU+cSxSnXTFQKx9uteHPsGPZ6iT+Ncdc5QKRw23mN O+BDoQV9YhR81uKWlVuVWrpkmW+myvwc87eRSDC5yRfk5a7yrgc4d8Y6W6T0eCPWJGL/ pLuwYMkeS+74LrUzoI65KO0UwyN6sjQtTYWKkL8QxDojJfjaHOcslgma1dqG4qykDHJ9 g7eg== 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=xv1X++7+CI+KR+tJVwJzAPl/RmtdeOQuhyVLw8iciNU=; b=PD+W61gbhA99X2kDeDJ3DWO4qc5+VhKpDC7S7OkaIs0Stx3+PeRBoD9On9sSdQ7zHU T0KBQD3BXcavrA5RFzeoDOJdMLRAH9XPwtM2dOSl3MM9sQB1a0QXUVjFDYwi5Gcgb+Dt 6IiViRaH0JISYxo5OuFeEDwoDxPs3Ju/7g1FMirAhCb2+kO43+Q90SavJ6nFcvjlSRGM 3iCQIZh/ZLO9dLMprzEX2FRkScuFW+G987rL5m9uilzraJOO6GHOfsXkc3qhlzUk40Si Iban1zlVYYfVEVw4+nDbL5P1BOY+EiBQFxiZzWlo2HLhN5Am0jBGyhHMOoSEp1pad/z/ Hi1g== X-Gm-Message-State: APjAAAWr8vyCdKBlSSHf4Ef+Nfh3jK3dtRhglfYQ2Eke293FNwI/aBLk XrW77nG/L4WYcKGVNaGq/eU= X-Received: by 2002:a17:902:b612:: with SMTP id b18mr14279395pls.8.1562005237182; Mon, 01 Jul 2019 11:20:37 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.92.187]) by smtp.gmail.com with ESMTPSA id v131sm10791495pgb.87.2019.07.01.11.20.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jul 2019 11:20:36 -0700 (PDT) Date: Mon, 1 Jul 2019 23:50:31 +0530 From: Hariprasad Kelam To: Felipe Balbi , Greg Kroah-Hartman , Hariprasad Kelam , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] USB: gadget: function: fix issue Unneeded variable: "value" Message-ID: <20190701182031.GA10455@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 registed with callback function Signed-off-by: Hariprasad Kelam --- 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