From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jules Irenge <jbi.octave@gmail.com>
Cc: outreachy-kernel@googlegroups.com, devel@driverdev.osuosl.org,
gregkh@linuxfoundation.org, Larry.Finger@lwfinger.net
Subject: Re: [PATCH] staging: rtl8712: Add comment to lock declaration
Date: Tue, 8 Oct 2019 09:16:36 +0300 [thread overview]
Message-ID: <20191008061455.GC12948@kadam> (raw)
In-Reply-To: <20191007205248.24466-1-jbi.octave@gmail.com>
On Mon, Oct 07, 2019 at 09:52:48PM +0100, Jules Irenge wrote:
> Add comment to spinlock declaration to fix warning issued by checkpatch.pl
> "CHECK: spinlock_t definition without comment".
>
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
> ---
> drivers/staging/rtl8712/drv_types.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8712/drv_types.h b/drivers/staging/rtl8712/drv_types.h
> index 0c4325073c63..960d8709aada 100644
> --- a/drivers/staging/rtl8712/drv_types.h
> +++ b/drivers/staging/rtl8712/drv_types.h
> @@ -160,7 +160,7 @@ struct _adapter {
> int pid; /*process id from UI*/
> struct work_struct wk_filter_rx_ff0;
> u8 blnEnableRxFF0Filter;
> - spinlock_t lock_rx_ff0_filter;
> + spinlock_t lock_rx_ff0_filter; /*spinlock to protect interrupt request*/
This spinlock seems to be nonsense. It's only used one time:
drivers/staging/rtl8712/xmit_linux.c
94 void r8712_SetFilter(struct work_struct *work)
95 {
96 struct _adapter *adapter = container_of(work, struct _adapter,
97 wk_filter_rx_ff0);
98 u8 oldvalue = 0x00, newvalue = 0x00;
99 unsigned long irqL;
100
101 oldvalue = r8712_read8(adapter, 0x117);
102 newvalue = oldvalue & 0xfe;
103 r8712_write8(adapter, 0x117, newvalue);
104
105 spin_lock_irqsave(&adapter->lock_rx_ff0_filter, irqL);
106 adapter->blnEnableRxFF0Filter = 1;
It only protects writing to ->blnEnableRxFF0Filter but it doesn't
protect reading so it can't possibly work.
107 spin_unlock_irqrestore(&adapter->lock_rx_ff0_filter, irqL);
108 do {
109 msleep(100);
110 } while (adapter->blnEnableRxFF0Filter == 1);
111 r8712_write8(adapter, 0x117, oldvalue);
112 }
Also put a space after /* and before */ so the comment looks like:
/* spinlock to protect interrupt request */
But in this case, the comment isn't correct so please just leave it
as-is until someone can fix the locking.
regards,
dan carpenter
prev parent reply other threads:[~2019-10-08 6:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-07 20:52 [PATCH] staging: rtl8712: Add comment to lock declaration Jules Irenge
2019-10-07 20:55 ` [Outreachy kernel] " Julia Lawall
2019-10-09 11:18 ` Jules Irenge
2019-10-08 6:16 ` Dan Carpenter [this message]
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=20191008061455.GC12948@kadam \
--to=dan.carpenter@oracle.com \
--cc=Larry.Finger@lwfinger.net \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jbi.octave@gmail.com \
--cc=outreachy-kernel@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.