RE: [PATCH rtw-next v5] wifi: rtl8xxxu: Use local 'dev' variable for dev_warn()

Ping-Ke Shih <[email protected]>
Newsgroups org.kernel.vger.linux-wireless,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
rafad900 <[email protected]> wrote:
> @@ -3173,7 +3175,7 @@ static int rtl8xxxu_iqk_path_b(struct rtl8xxxu_priv *priv)
>             (((reg_ecc & 0x03ff0000) >> 16) != 0x36))
>                 result |= 0x02;
>         else
> -               dev_warn(&priv->udev->dev, "%s: Path B RX IQK failed!\n",
> +               dev_warn(dev, "%s: Path B RX IQK failed!\n",
>                          __func__);

Straighten ?

Please check this kind of pattern across whole patch before sending out.

>  out:
>         return result;


> @@ -5862,6 +5864,7 @@ static void rtl8xxxu_queue_rx_urb(struct rtl8xxxu_priv *priv,
>  static void rtl8xxxu_rx_urb_work(struct work_struct *work)
>  {
>         struct rtl8xxxu_priv *priv;
> +       struct device *dev;

In reverse X'mas tree order. 

>         struct rtl8xxxu_rx_urb *rx_urb, *tmp;
>         struct list_head local;
>         struct sk_buff *skb;
> @@ -5869,6 +5872,7 @@ static void rtl8xxxu_rx_urb_work(struct work_struct *work)
>         int ret;
> 
>         priv = container_of(work, struct rtl8xxxu_priv, rx_urb_wq);
> +       dev = &priv->udev->dev;
>         INIT_LIST_HEAD(&local);
> 
>         spin_lock_irqsave(&priv->rx_urb_lock, flags);
> @@ -5894,8 +5898,7 @@ static void rtl8xxxu_rx_urb_work(struct work_struct *work)
>                         rtl8xxxu_queue_rx_urb(priv, rx_urb);
>                         break;
>                 default:

Only here use local 'dev'. Why not assign the value here?
But for this case, it seems no gain. Just keep it as was?

> -                       dev_warn(&priv->udev->dev,
> -                                "failed to requeue urb with error %i\n", ret);
> +                       dev_warn(dev, "failed to requeue urb with error %i\n", ret);
>                         skb = (struct sk_buff *)rx_urb->urb.context;
>                         dev_kfree_skb(skb);
>                         usb_free_urb(&rx_urb->urb);
> --
> 2.43.0
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.