Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp2326703imc; Sat, 23 Feb 2019 00:41:08 -0800 (PST) X-Google-Smtp-Source: AHgI3IY8yztfADfY+2STsHZn6sg6zQ3ZRUTQmZ7ckGg36ftWNCgG4JrPYsq1cM/G3q9oOrHzHNnM X-Received: by 2002:a62:20d1:: with SMTP id m78mr8328479pfj.250.1550911268729; Sat, 23 Feb 2019 00:41:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550911268; cv=none; d=google.com; s=arc-20160816; b=vpVTYnRe61t/Zcirr72S+ydd4gXhGDVAu/6Tm/Yl8YVEfsUs6qXCYIbIUZITM6KVZu A3g3UilONEh5EGebllfYIDrJq29RpcuMtmLwjaZEz6PJL6WnIdHjCHPTFpZwn1QrSAwP bPP6eJNJNEC5CfCkDBTFpEjez9N7HphfCsVjvTwU8y3l80O8PF6zAGOghz1V25R0FRPX sy8cED9dNABrQeZFLpAFa7ok6tok9YgblBBSXiUf8wBA2dtsj/GIQs3KTAOXRoz65UZi oevnhrnMCiB2QNzM9+sQ9sdFcfyRa87JCAX84o9pHtrCQId20DPzh+XoWyzefMAmLcnS 6zOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=mRE4EeH9BJWqeXP2NAEJE2r/M7faNI+Juq6YWZdH5o4=; b=xHY/tDTY4z+YxcgS1WOGD0taHtd8+GCSBBErCKv9Ni0B4PxO9OrMZz8BQEaqwuZ861 oaUcBT13gONWv4fdp8a467tGlM6rjH7gvfEALpN8EP0neGE/mjitiuwwMfQpoqdEwwnM vGDFWasy/vQpdoasl30sfG+Tm59gRweCai+Tw6v0+VFqYz0d81/BV1tQXrB6OQmqqemj yFEhfBML7qC7onqrbZvAlHL8Sd+YFN8jX7iYE2vf/d2Yhdsh/Ca9D0smMkBONI8Cdkfa hwdUc3BnFUujcCBxdrVvkdrcLjUfZHPiOGvkDiOH4wIyYil+nLr1QniGunjJmZmE6jeZ wP0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BaiZMDtn; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p31si3313544pgb.440.2019.02.23.00.40.16; Sat, 23 Feb 2019 00:41:08 -0800 (PST) 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=@kernel.org header.s=default header.b=BaiZMDtn; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726367AbfBWIif (ORCPT + 99 others); Sat, 23 Feb 2019 03:38:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:41286 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725868AbfBWIif (ORCPT ); Sat, 23 Feb 2019 03:38:35 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B702D206A3; Sat, 23 Feb 2019 08:38:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550911114; bh=FCTejTSWX+J5iLRAW+f/HYmLWd4knmJLLei+UwQMoLY=; h=Date:From:To:Subject:References:In-Reply-To:From; b=BaiZMDtnS2UerpZNRPGbO5xRJ8GyCs1WWRJzTXhvreqbQZhp7dsTBelx1bQ+TVF6B WQVrMj4xH2Z0cWkhHYFWO3ZE5oKtza+7UDymohBu92ALT3k6rQk8VlOgF6FZ3AB3um UdIR7DafOOgLNyawLVl9kvNDAK5UKNKY0e3H8Kf8= Date: Sat, 23 Feb 2019 09:38:30 +0100 From: Greg KH To: sergio.paracuellos@gmail.com, quytelda@tamalin.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, yuzibode@126.com Subject: Re: [PATCH] staging/ks7070: Removed unused varibale Message-ID: <20190223083830.GA4902@kroah.com> References: <20190223063939.18261-1-tsu.yubo@gmail.com> <20190223074320.GA921@kroah.com> <20190223080941.ufsdrtxz4cewkik7@yubo-2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190223080941.ufsdrtxz4cewkik7@yubo-2> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 23, 2019 at 03:09:42AM -0500, YU Bo wrote: > On Sat, Feb 23, 2019 at 08:43:20AM +0100, Greg KH wrote: > > On Sat, Feb 23, 2019 at 01:39:39AM -0500, Bo YU wrote: > > > From: Bo Yu > > > > > > Compiling the kernel with W=1 results in the following warning: > > > > > > drivers/staging/ks7010/ks_hostif.c:465:6: warning: variable ‘mib_val_type’ > > > set but not used [-Wunused-but-set-variable] > > > u16 mib_val_type; > > > > > > drivers/staging/ks7010/ks_hostif.c:464:6: warning: variable ‘mib_val_size’ > > > set but not used [-Wunused-but-set-variable] > > > u16 mib_val_size; > > > > > > drivers/staging/ks7010/ks_hostif.c:786:6: warning: variable ‘result_code’ > > > set but not used [-Wunused-but-set-variable] > > > u16 result_code; > > > > > > Remove these variables. > > > > > > Rebase on next-20190222 > > > > > > Cc: Greg Kroah-Hartman > > > Cc: Sergio Paracuellos > > > Cc: Quytelda Kahja > > > > > > Signed-off-by: Bo Yu > > > --- > > > drivers/staging/ks7010/ks_hostif.c | 6 ------ > > > 1 file changed, 6 deletions(-) > > > > > > diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c > > > index d938b0997a53..913d8996437a 100644 > > > --- a/drivers/staging/ks7010/ks_hostif.c > > > +++ b/drivers/staging/ks7010/ks_hostif.c > > > @@ -461,13 +461,9 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv) > > > struct net_device *dev = priv->net_dev; > > > u32 mib_status; > > > u32 mib_attribute; > > > - u16 mib_val_size; > > > - u16 mib_val_type; > > > > > > mib_status = get_dword(priv); > > > mib_attribute = get_dword(priv); > > > - mib_val_size = get_word(priv); > > > - mib_val_type = get_word(priv); > > > > The function get_word() actually does something to the priv structure, > > so you just broke the driver :( > > > > > > > > if (mib_status) { > > > netdev_err(priv->net_dev, "attribute=%08X, status=%08X\n", > > > @@ -783,9 +779,7 @@ void hostif_ps_adhoc_set_confirm(struct ks_wlan_private *priv) > > > static > > > void hostif_infrastructure_set_confirm(struct ks_wlan_private *priv) > > > { > > > - u16 result_code; > > > > > > - result_code = get_word(priv); > > > priv->infra_status = 1; /* infrastructure mode set */ > > > hostif_sme_enqueue(priv, SME_MODE_SET_CONFIRM); > > > > Same here, odds are you just broke things :( > > > > Please be more careful. > Ok, I have through get_word() and get_byte() before modifing the code. > I think it should be better to encapsulate get_word without return value to do some operations > like that? right? Something should be done, as that api is pretty horrible. But I think that might be a lot more work to accomplish :) greg k-h