linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] staging: rtl8192e: Use standard api to calculate frequency to channel
Date: Thu, 15 Jun 2023 12:46:05 +0200	[thread overview]
Message-ID: <2023061555-spyglass-most-fccf@gregkh> (raw)
In-Reply-To: <fc332e81f6677965e9e51f1fcef9815997effcb5.1686166624.git.philipp.g.hortmann@gmail.com>

On Thu, Jun 08, 2023 at 08:52:18AM +0200, Philipp Hortmann wrote:
> Use ieee80211_freq_khz_to_channel() to calculate frequency to channel to
> omit proprietary code.
> 
> Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
> ---
> Tested this code with separate debug code as this part is usually unused.
> ---
>  drivers/staging/rtl8192e/rtllib_softmac_wx.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
> index 78a70e5f1974..6fd2e94d5f8a 100644
> --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c
> +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
> @@ -42,15 +42,8 @@ int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a,
>  	if (fwrq->e == 1) {
>  		if ((fwrq->m >= (int)2.412e8 &&
>  		     fwrq->m <= (int)2.487e8)) {
> -			int f = fwrq->m / 100000;
> -			int c = 0;
> -
> -			while ((c < 14) && (f != rtllib_wlan_frequencies[c]))
> -				c++;
> -
> -			/* hack to fall through */
> +			fwrq->m = ieee80211_freq_khz_to_channel(fwrq->m / 100);
>  			fwrq->e = 0;
> -			fwrq->m = c + 1;
>  		}
>  	}
>  
> -- 
> 2.40.1
> 
> 

Does not apply to my tree for some reason, can you rebase and resubmit?

thanks,

greg k-h

  reply	other threads:[~2023-06-15 10:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08  6:52 [PATCH 0/2] staging: rtl8192e: Use standard api to calculate frequency <-> channel Philipp Hortmann
2023-06-08  6:52 ` [PATCH 1/2] staging: rtl8192e: Use standard api to calculate frequency to channel Philipp Hortmann
2023-06-15 10:46   ` Greg Kroah-Hartman [this message]
2023-06-15 10:47     ` Greg Kroah-Hartman
2023-06-08  6:52 ` [PATCH 2/2] staging: rtl8192e: Use standard api to calculate channel to frequency Philipp Hortmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2023061555-spyglass-most-fccf@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=philipp.g.hortmann@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).