Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7198634pxb; Thu, 18 Feb 2021 04:17:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDuGi3Hk9sYuiePTkQ8LDIlXNTi1U8MAGOGMxp3p3ff0nMMO/dU7J7VK7zamGtLukVy3DU X-Received: by 2002:a17:906:d71:: with SMTP id s17mr3870232ejh.126.1613650642641; Thu, 18 Feb 2021 04:17:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613650642; cv=none; d=google.com; s=arc-20160816; b=EAojbkuFnGL4zZYQwEli6JLxICRy63NNdJssjLQ4HsJWv96UyckWOYDlhCFHFZAX5A nyKZfp/V5YecWArj9Aii5eUZ7tFI1+7IZ32btUBuPMSjoVTskRPzMRzeJUqCY2E/2Gu7 OflUaFcrH9VH4qBtiS21lHZdCUvS5le0wsI+2ky3d4ydsE4vRZRfa5aLW/ykTJGdbodn mb8sNmHc6VDfF4NdsO8DOL7vQJX5zIfZxbT+MoKXSFFq2P4E2xmGzSVj5G+YOjPH8gEy Us4fA++qnayUyf491DUGxoK8rXkUMatJiyunGvQIwKnukiemhPbWeo0gtHWL31gxxahK nABg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=C9eKauYWspJ36S+98RD6x/c0BRHCDLjF1zWGjK5SD+k=; b=I8m/+mCorbjfOyZqyGRPcn64q5mJDZyGORnU5J3ifCZWRYpeWIAKP6S4ly7Y+u2rcV 3QhtNfvajEo7KHipG9uAZ4le7AhvoQC6qsC5q1DcHSluXEL/3ANP/R4NahOPk3RZaf/3 D3qi3WKhU4NTs5+4d85msC6SBFE4mFHeLtVViRlaZX9F8qvAzQ/uy7Ehm0e7Dy6NjZFg X0Kx9roCHs+tsqS+GOxGrIrTpukGi88twxD5itzakzqv/al5O6N0xa4QTVu8pgi0+iu+ AwhyMwCeD+3fFvqAlyhQ9XaFWthNgZi0TXbJwjplo0y3x6A13N4DDTVAMt39lcdxf8b2 BXZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tL+9kgJa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r13si3528920edd.388.2021.02.18.04.16.58; Thu, 18 Feb 2021 04:17:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tL+9kgJa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232386AbhBRMJI (ORCPT + 99 others); Thu, 18 Feb 2021 07:09:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:56850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbhBRKgw (ORCPT ); Thu, 18 Feb 2021 05:36:52 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7537464DF0; Thu, 18 Feb 2021 09:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613641235; bh=FBgOPfIf3FC5lff30PU6rn5fUjdaBUeL1E0K+BMPxKI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tL+9kgJaEcLuwkMVwNo0aCdBiv1m/MfJrHr86iQbWTzYp2ed7cdgaed7uJ2SOcl5s TckTA6KZ0woMrehJxyI3OtYKUOsIt17vuAdNqKLl2BRgHRIdNPK7VF+IW87ZOClCvg V5wJdqXFCcwLvdAJ8EmPQVGc32X+YU96KS2h1f/s= Date: Thu, 18 Feb 2021 10:40:32 +0100 From: Greg KH To: Muhammad Usama Anjum Cc: lee.jones@linaro.org, johannes@sipsolutions.net, arnd@arndb.de, kuba@kernel.org, gustavoars@kernel.org, wanghai38@huawei.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: wimax/i2400m: don't change the endianness of one byte variable Message-ID: References: <20210218092154.GA46388@LEGION> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210218092154.GA46388@LEGION> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 18, 2021 at 02:21:54PM +0500, Muhammad Usama Anjum wrote: > It is wrong to change the endianness of a variable which has just one > byte size. > > Sparse warnings fixed: > drivers/staging//wimax/i2400m/control.c:452:17: warning: cast to restricted __le32 > drivers/staging//wimax/i2400m/control.c:452:17: warning: cast to restricted __le32 > drivers/staging//wimax/i2400m/op-rfkill.c:159:14: warning: cast to restricted __le32 > drivers/staging//wimax/i2400m/op-rfkill.c:160:14: warning: cast to restricted __le32 > > Signed-off-by: Muhammad Usama Anjum > --- > drivers/staging/wimax/i2400m/control.c | 4 ++-- > drivers/staging/wimax/i2400m/op-rfkill.c | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/wimax/i2400m/control.c b/drivers/staging/wimax/i2400m/control.c > index 1e270b2101e8..b6b2788af162 100644 > --- a/drivers/staging/wimax/i2400m/control.c > +++ b/drivers/staging/wimax/i2400m/control.c > @@ -452,8 +452,8 @@ void i2400m_report_state_parse_tlv(struct i2400m *i2400m, > d_printf(2, dev, "%s: RF status TLV " > "found (0x%04x), sw 0x%02x hw 0x%02x\n", > tag, I2400M_TLV_RF_STATUS, > - le32_to_cpu(rfss->sw_rf_switch), > - le32_to_cpu(rfss->hw_rf_switch)); > + rfss->sw_rf_switch, > + rfss->hw_rf_switch); What do you mean by "one byte"? This is a le32 sized variable, right? If not, why isn't the le32_to_cpu() call complaining? > i2400m_report_tlv_rf_switches_status(i2400m, rfss); > } > if (0 == i2400m_tlv_match(tlv, I2400M_TLV_MEDIA_STATUS, sizeof(*ms))) { > diff --git a/drivers/staging/wimax/i2400m/op-rfkill.c b/drivers/staging/wimax/i2400m/op-rfkill.c > index fbddf2e18c14..a159808f0ec2 100644 > --- a/drivers/staging/wimax/i2400m/op-rfkill.c > +++ b/drivers/staging/wimax/i2400m/op-rfkill.c > @@ -156,8 +156,8 @@ void i2400m_report_tlv_rf_switches_status( > enum i2400m_rf_switch_status hw, sw; > enum wimax_st wimax_state; > > - sw = le32_to_cpu(rfss->sw_rf_switch); > - hw = le32_to_cpu(rfss->hw_rf_switch); > + sw = rfss->sw_rf_switch; > + hw = rfss->hw_rf_switch; Same here. thanks, greg k-h