diff mbox series

Hid: Intel-thc-hid: Intel-thc: Fix "dubious: !x | !y" issue

Message ID 20250213024021.2477473-1-even.xu@intel.com (mailing list archive)
State New
Delegated to: Jiri Kosina
Headers show
Series Hid: Intel-thc-hid: Intel-thc: Fix "dubious: !x | !y" issue | expand

Commit Message

Xu, Even Feb. 13, 2025, 2:40 a.m. UTC
Change to use "||" to make it more readable and avoid miss
understanding.

Signed-off-by: Even Xu <even.xu@intel.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501292144.eFDq4ovr-lkp@intel.com
---
 drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jiri Kosina Feb. 18, 2025, 9:10 p.m. UTC | #1
On Thu, 13 Feb 2025, Even Xu wrote:

> Change to use "||" to make it more readable and avoid miss
> understanding.
> 
> Signed-off-by: Even Xu <even.xu@intel.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202501292144.eFDq4ovr-lkp@intel.com
> ---
>  drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c b/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c
> index eb23bea77686..8f97e71df7f4 100644
> --- a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c
> +++ b/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c
> @@ -295,7 +295,7 @@ static void release_dma_buffers(struct thc_device *dev,
>  		return;
>  
>  	for (i = 0; i < config->prd_tbl_num; i++) {
> -		if (!config->sgls[i] | !config->sgls_nent[i])
> +		if (!config->sgls[i] || !config->sgls_nent[i])
>  			continue;

Applied, thanks.
Xu, Even Feb. 19, 2025, 12:49 a.m. UTC | #2
Thanks Jiri!

Best Regards,
Even Xu

> -----Original Message-----
> From: Jiri Kosina <jikos@kernel.org>
> Sent: Wednesday, February 19, 2025 5:10 AM
> To: Xu, Even <even.xu@intel.com>
> Cc: david.laight.linux@gmail.com; bentiss@kernel.org;
> srinivas.pandruvada@linux.intel.com; mpearson-lenovo@squebb.ca; linux-
> input@vger.kernel.org; linux-kernel@vger.kernel.org; lkp <lkp@intel.com>
> Subject: Re: [PATCH] Hid: Intel-thc-hid: Intel-thc: Fix "dubious: !x | !y" issue
> 
> On Thu, 13 Feb 2025, Even Xu wrote:
> 
> > Change to use "||" to make it more readable and avoid miss
> > understanding.
> >
> > Signed-off-by: Even Xu <even.xu@intel.com>
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes:
> > https://lore.kernel.org/oe-kbuild-all/202501292144.eFDq4ovr-lkp@intel.
> > com
> > ---
> >  drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c
> > b/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c
> > index eb23bea77686..8f97e71df7f4 100644
> > --- a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c
> > +++ b/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c
> > @@ -295,7 +295,7 @@ static void release_dma_buffers(struct thc_device
> *dev,
> >  		return;
> >
> >  	for (i = 0; i < config->prd_tbl_num; i++) {
> > -		if (!config->sgls[i] | !config->sgls_nent[i])
> > +		if (!config->sgls[i] || !config->sgls_nent[i])
> >  			continue;
> 
> Applied, thanks.
> 
> --
> Jiri Kosina
> SUSE Labs
diff mbox series

Patch

diff --git a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c b/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c
index eb23bea77686..8f97e71df7f4 100644
--- a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c
+++ b/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c
@@ -295,7 +295,7 @@  static void release_dma_buffers(struct thc_device *dev,
 		return;
 
 	for (i = 0; i < config->prd_tbl_num; i++) {
-		if (!config->sgls[i] | !config->sgls_nent[i])
+		if (!config->sgls[i] || !config->sgls_nent[i])
 			continue;
 
 		dma_unmap_sg(dev->dev, config->sgls[i],