Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp2307330imc; Sat, 23 Feb 2019 00:10:28 -0800 (PST) X-Google-Smtp-Source: AHgI3IZWjyh19FUWqLWxdQ1jiD6gl2ZPWhbbcK+R/4oO4IGm6ItVlkpOnQ6tq17pX9lfZg8GwCNX X-Received: by 2002:a62:20c9:: with SMTP id m70mr8254974pfj.118.1550909427934; Sat, 23 Feb 2019 00:10:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550909427; cv=none; d=google.com; s=arc-20160816; b=k1Ng3HwZfTfymjfDBbDyH6jz87612iyM50dCz+huLWxjADZ6opN7fqusj4oOFV8hFM zlh9A0ffPPtsLQd41/ITjcE8NACHRHyVBZ2DinLURXsnOt2sWHHNEntTQCUALCw+2W/G nijohowV3xSPfGsf2sU1LIUy7Q5gEepo9iuCpuG8331/xSyJ+m97Cj4ZxU5GnxLo4BNC b8+l9jXVJpU63EcWnaiDWQrYLxPXSeayBRsJEwuT6BLENKJZZjie5cr+hhck71mklwRH 5lwC1BXN8JRt2ezVB6K9kAMM652RztsZBLpY7XEw1bhSNpMZE+aIQPs0qsNKDImuKWFv uOEw== 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:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=J8/WNnvcRkZFRyKH0YtNAngMTMrhvhGst1IsnfFKbow=; b=fdCZVaWDwCDZumJEyK0XxznDaLmgXHgDs3K5wbknnEg+HscUVysRlSIbeOLr9xuXGi 0Cu4oqJfPjUA3o9o6fz8o29F11QzoObmyCdcGT0aho4+RSsmR1OpLhpvtn7ZZZefdQ2J EPgdmSDMzi1VC6X05uzhUMIsGiW67ZpDpp2YHuD3C9rvj5IC5WPl3V8pmquQRZPokcOj NDyDi9trHVzYL50sFUv6xnfj42Yh7n/DRjltVZXY/ofTmHjNfp8qE0k9tuBpABGsPyXB eFqhmL/Pc13Gnxyh6fvrJiDZfxC9cmxzyNpEqdbaGTPpPSb2ZFI26GKo5z+vjorSylVI XJdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Zfgp6zwG; 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 u63si3155064pgd.385.2019.02.23.00.10.12; Sat, 23 Feb 2019 00:10:27 -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=@gmail.com header.s=20161025 header.b=Zfgp6zwG; 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 S1726050AbfBWIJq (ORCPT + 99 others); Sat, 23 Feb 2019 03:09:46 -0500 Received: from mail-yb1-f195.google.com ([209.85.219.195]:44914 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725785AbfBWIJp (ORCPT ); Sat, 23 Feb 2019 03:09:45 -0500 Received: by mail-yb1-f195.google.com with SMTP id j85so1795272ybg.11 for ; Sat, 23 Feb 2019 00:09:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=J8/WNnvcRkZFRyKH0YtNAngMTMrhvhGst1IsnfFKbow=; b=Zfgp6zwGz7GaXPTO9iGMqT+BoKfp0Bp7lWCPaLUAMHusAcyXp8nh96ryX7GEcpnzlB 31xig2RknzeKRcERDbukerKyP4f8un+94CnKx1njmMsrZsu7ko2YcnX6ZNiyJG7Zqg69 iwZuBiXWUsplxsukJD/cVj7DvMcfB35j32fX10gxcvcQAYFA4uxvfuDvEIhXwB7HmsI4 0qcJyRYLgN96lEIpLFA9BtJQB0URDa6ZhkVOS9DLGIoy/S6k9RqRdXhmccNGCJvj6puA a6xrlzf84rhWSO/WoBejpwbSDClPkYDOEBHkk22L7mE/KPL1SLvu3RJSyZsxwckOOBup 6xuA== 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 :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=J8/WNnvcRkZFRyKH0YtNAngMTMrhvhGst1IsnfFKbow=; b=JJwUDEs/Xp8bGaC1yLhhoB/yI17XyxQRImtyYG8yepPuNMuJ9duHAG6K7Sas4HqbYC z2a2DVkLluwqmU5L3fX7wsT+43qLae5WYCZjpQF08c37j5MYW00iug3hV2jQYPmFVw4l zCYqwqmJHZ2v9m5TSPic1AhrNbWi48rZEMLaBZ61aUYm5RHMMngVdNvu7rd7Tz8s4gP2 i2OLlz6T9j3mXIgSPAN4x94oCVCx1TStlayQMXE8Aqe1yRc4eM1VxdhMc52iNAYRxC/m nIp3wuI53P2bjjZNT5xmR8nM6vP3yGtUIRe1KumAuwVEziYMj5VaT3L5NYGyfGtZqnAz D4Xw== X-Gm-Message-State: AHQUAua0MvsXgxA/Q/l1TmqD06czwTj0BE2tqfibb+hSbOqlL3D317FG MdmUhXFoQY0oWR4fzdg8hhh+tCdNy8s= X-Received: by 2002:a25:c43:: with SMTP id 64mr6543272ybm.457.1550909384167; Sat, 23 Feb 2019 00:09:44 -0800 (PST) Received: from yubo-2 ([191.101.9.198]) by smtp.gmail.com with ESMTPSA id 21sm1304196ywg.55.2019.02.23.00.09.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Feb 2019 00:09:43 -0800 (PST) Date: Sat, 23 Feb 2019 03:09:42 -0500 From: YU Bo To: Greg KH Cc: 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: <20190223080941.ufsdrtxz4cewkik7@yubo-2> Mail-Followup-To: Greg KH , sergio.paracuellos@gmail.com, quytelda@tamalin.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, yuzibode@126.com References: <20190223063939.18261-1-tsu.yubo@gmail.com> <20190223074320.GA921@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190223074320.GA921@kroah.com> User-Agent: NeoMutt/20180512-62-03f98a 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 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? > >greg k-h