Linux kernel staging patches
 help / color / mirror / Atom feed
* Re: [PATCH v3] staging: rtl8723bs: remove unnecessary NULL check before vfree
From: Greg Kroah-Hartman @ 2026-05-28  7:28 UTC (permalink / raw)
  To: Bastien Cossette; +Cc: Dan Carpenter, linux-staging
In-Reply-To: <20260528070554.40315-1-bastiencossette29@icloud.com>

On Thu, May 28, 2026 at 03:05:54AM -0400, Bastien Cossette wrote:
> The vfree() function handles NULL pointers natively. Cleaning up the
> redundant if check simplifies the code and adheres to core kernel
> coding styles.
> 
> Signed-off-by: Bastien Cossette <bastiencossette29@icloud.com>
> ---
>  drivers/staging/rtl8723bs/hal/hal_com.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
> index 728a2171fbcb..00c511b38595 100644
> --- a/drivers/staging/rtl8723bs/hal/hal_com.c
> +++ b/drivers/staging/rtl8723bs/hal/hal_com.c
> @@ -23,14 +23,11 @@ u8 rtw_hal_data_init(struct adapter *padapter)
>  
>  void rtw_hal_data_deinit(struct adapter *padapter)
>  {
> -	if (padapter->HalData) {
> -		vfree(padapter->HalData);
> -		padapter->HalData = NULL;
> -		padapter->hal_data_sz = 0;
> -	}
> +	vfree(padapter->HalData);
> +	padapter->HalData = NULL;
> +	padapter->hal_data_sz = 0;
>  }
>  
> -
>  void dump_chip_info(struct hal_version	chip_version)
>  {
>  	char buf[128];
> -- 
> 2.53.0
> 
> 


Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- This looks like a new version of a previously submitted patch, but you
  did not list below the --- line any changes from the previous version.
  Please read the section entitled "The canonical patch format" in the
  kernel file, Documentation/process/submitting-patches.rst for what
  needs to be done here to properly describe this.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

^ permalink raw reply

* Re: [PATCH] staging: rtl8723bs: remove unnecessary NULL check before vfree
From: Greg Kroah-Hartman @ 2026-05-28  7:25 UTC (permalink / raw)
  To: Bastien Cossette; +Cc: linux-staging
In-Reply-To: <20260528065723.39968-1-bastiencossette29@icloud.com>

On Thu, May 28, 2026 at 02:57:23AM -0400, Bastien Cossette wrote:
> The vfree() function handles NULL pointers natively. Cleaning up the
> redundant if check simplifies the code and adheres to core kernel
> coding styles.
> 
> Signed-off-by: Bastien Cossette <bastiencossette29@icloud.com>
> ---
>  drivers/staging/rtl8723bs/hal/hal_com.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
> index 728a2171fbcb..24dfae2dd759 100644
> --- a/drivers/staging/rtl8723bs/hal/hal_com.c
> +++ b/drivers/staging/rtl8723bs/hal/hal_com.c
> @@ -23,14 +23,10 @@ u8 rtw_hal_data_init(struct adapter *padapter)
>  
>  void rtw_hal_data_deinit(struct adapter *padapter)
>  {
> -	if (padapter->HalData) {
> -		vfree(padapter->HalData);
> -		padapter->HalData = NULL;
> -		padapter->hal_data_sz = 0;
> -	}
> +	vfree(padapter->HalData);
> +	padapter->hal_data_sz = 0;

What about setting HalData to NULL?  Is other code relying on that?

>  }
>  
> -

This change is not relevant for the other one :(

thanks,

greg k-h

^ permalink raw reply

* Re: [PATCH v3] staging: rtl8723bs: remove unnecessary NULL check before vfree
From: Dan Carpenter @ 2026-05-28  7:25 UTC (permalink / raw)
  To: Bastien Cossette; +Cc: Greg Kroah-Hartman, linux-staging
In-Reply-To: <20260528070554.40315-1-bastiencossette29@icloud.com>

On Thu, May 28, 2026 at 03:05:54AM -0400, Bastien Cossette wrote:
> The vfree() function handles NULL pointers natively. Cleaning up the
> redundant if check simplifies the code and adheres to core kernel
> coding styles.
> 
> Signed-off-by: Bastien Cossette <bastiencossette29@icloud.com>
> ---

Please read my review comments to earlier patches.
Please wait a day between resends.

regards,
dan carpenter


^ permalink raw reply

* Re: [PATCH] staging: vme_user: fix CamelCase macros by converting to uppercase with underscores
From: Dan Carpenter @ 2026-05-28  7:24 UTC (permalink / raw)
  To: Lucas Faria Mendes; +Cc: gregkh, linux-kernel, linux-staging
In-Reply-To: <20260527191203.494292-1-lucas.fariamo08@gmail.com>

On Wed, May 27, 2026 at 04:12:03PM -0300, Lucas Faria Mendes wrote:
> Fix the following CHECK style issues reported by checkpatch.pl:
> Avoid CamelCase: <VME_2eVME>
> Avoid CamelCase: <VME_2eSST>
> Avoid CamelCase: <VME_2eSSTB>
> Avoid CamelCase: <VME_2eSST160>
> Avoid CamelCase: <VME_2eSST267>
> Avoid CamelCase: <VME_2eSST320>
> 
> Convert the lowercase 'e' to uppercase 'E' and separate the protocol
> naming elements using underscores (e.g., VME_2E_VME). Update all macro
> definitions in vme.h and their respective usages across the driver
> files to comply with the Linux kernel coding style.
> 

No.  The original is the correct way.  Here correctness is more
important than the CamelCase rule.

regards,
dan carpenter


^ permalink raw reply

* [PATCH v3] staging: rtl8723bs: remove unnecessary NULL check before vfree
From: Bastien Cossette @ 2026-05-28  7:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Dan Carpenter, linux-staging, Bastien Cossette

The vfree() function handles NULL pointers natively. Cleaning up the
redundant if check simplifies the code and adheres to core kernel
coding styles.

Signed-off-by: Bastien Cossette <bastiencossette29@icloud.com>
---
 drivers/staging/rtl8723bs/hal/hal_com.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index 728a2171fbcb..00c511b38595 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -23,14 +23,11 @@ u8 rtw_hal_data_init(struct adapter *padapter)
 
 void rtw_hal_data_deinit(struct adapter *padapter)
 {
-	if (padapter->HalData) {
-		vfree(padapter->HalData);
-		padapter->HalData = NULL;
-		padapter->hal_data_sz = 0;
-	}
+	vfree(padapter->HalData);
+	padapter->HalData = NULL;
+	padapter->hal_data_sz = 0;
 }
 
-
 void dump_chip_info(struct hal_version	chip_version)
 {
 	char buf[128];
-- 
2.53.0


^ permalink raw reply related

* Re: [PATCH v2] staging: rtl8723bs: remove unnecessary NULL check before vfree
From: Dan Carpenter @ 2026-05-28  7:03 UTC (permalink / raw)
  To: Bastien Cossette; +Cc: Greg Kroah-Hartman, linux-staging
In-Reply-To: <20260528070045.40135-1-bastiencossette29@icloud.com>

On Thu, May 28, 2026 at 03:00:45AM -0400, Bastien Cossette wrote:
> The vfree() function handles NULL pointers natively. Cleaning up the
> redundant if check simplifies the code and adheres to core kernel
> coding styles.
> 
> Signed-off-by: Bastien Cossette <bastiencossette29@icloud.com>
> ---

Please don't resend patches in the same day.  Also we need a note
about what changed.

https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/

regards,
dan carpenter

^ permalink raw reply

* Re: [PATCH] staging: rtl8723bs: remove unnecessary NULL check before vfree
From: Dan Carpenter @ 2026-05-28  7:02 UTC (permalink / raw)
  To: Bastien Cossette; +Cc: Greg Kroah-Hartman, linux-staging
In-Reply-To: <20260528065723.39968-1-bastiencossette29@icloud.com>

On Thu, May 28, 2026 at 02:57:23AM -0400, Bastien Cossette wrote:
> The vfree() function handles NULL pointers natively. Cleaning up the
> redundant if check simplifies the code and adheres to core kernel
> coding styles.
> 
> Signed-off-by: Bastien Cossette <bastiencossette29@icloud.com>
> ---
>  drivers/staging/rtl8723bs/hal/hal_com.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
> index 728a2171fbcb..24dfae2dd759 100644
> --- a/drivers/staging/rtl8723bs/hal/hal_com.c
> +++ b/drivers/staging/rtl8723bs/hal/hal_com.c
> @@ -23,14 +23,10 @@ u8 rtw_hal_data_init(struct adapter *padapter)
>  
>  void rtw_hal_data_deinit(struct adapter *padapter)
>  {
> -	if (padapter->HalData) {
> -		vfree(padapter->HalData);
> -		padapter->HalData = NULL;
> -		padapter->hal_data_sz = 0;
> -	}
> +	vfree(padapter->HalData);
> +	padapter->hal_data_sz = 0;


You can't delete the "padapter->HalData = NULL;" assignment.

>  }
>  
> -

Do white space changes in their own patch.

regards,
dan carpenter



^ permalink raw reply

* [PATCH v2] staging: rtl8723bs: remove unnecessary NULL check before vfree
From: Bastien Cossette @ 2026-05-28  7:00 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging, Bastien Cossette

The vfree() function handles NULL pointers natively. Cleaning up the
redundant if check simplifies the code and adheres to core kernel
coding styles.

Signed-off-by: Bastien Cossette <bastiencossette29@icloud.com>
---
 drivers/staging/rtl8723bs/hal/hal_com.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index 728a2171fbcb..00c511b38595 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -23,14 +23,11 @@ u8 rtw_hal_data_init(struct adapter *padapter)
 
 void rtw_hal_data_deinit(struct adapter *padapter)
 {
-	if (padapter->HalData) {
-		vfree(padapter->HalData);
-		padapter->HalData = NULL;
-		padapter->hal_data_sz = 0;
-	}
+	vfree(padapter->HalData);
+	padapter->HalData = NULL;
+	padapter->hal_data_sz = 0;
 }
 
-
 void dump_chip_info(struct hal_version	chip_version)
 {
 	char buf[128];
-- 
2.53.0


^ permalink raw reply related

* Re: [PATCH] vme_user: tighten slave window bounds and validate offsets
From: Dan Carpenter @ 2026-05-28  7:00 UTC (permalink / raw)
  To: Lucas Faria Mendes; +Cc: gregkh, linux-kernel, linux-staging
In-Reply-To: <20260527211425.569038-1-lucas.fariamo08@gmail.com>

On Wed, May 27, 2026 at 06:14:24PM -0300, Lucas Faria Mendes wrote:
> Limit slave read/write operations to the allocated buffer size to
> prevent out-of-bounds access when a slave window is
> configured larger than its buffer.
> Treat zero-sized windows and invalid file positions as errors,
> and reject VME_SET_SLAVE requests that exceed the slave buffer.
> This makes the user access driver more robust and avoids
> silent EOF on invalid offsets.
> 
> Signed-off-by: Lucas Faria Mendes <lucas.fariamo08@gmail.com>

No Fixes tag.

This is a grab bag of changes.  It needs to be split up into
multiple changes.

> 
> diff --git a/drivers/staging/vme_user/vme_user.c b/drivers/staging/vme_user/vme_user.c
> index 11e25c2f6..ca65cb57c 100644
> --- a/drivers/staging/vme_user/vme_user.c
> +++ b/drivers/staging/vme_user/vme_user.c
> @@ -181,6 +181,7 @@ static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count,
>  	unsigned int minor = iminor(file_inode(file));
>  	ssize_t retval;
>  	size_t image_size;
> +	size_t max_size;
> 
>  	if (minor == CONTROL_MINOR)
>  		return 0;
> @@ -189,16 +190,24 @@ static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count,
> 
>  	/* XXX Do we *really* want this helper - we can use vme_*_get ? */
>  	image_size = vme_get_size(image[minor].resource);
> +	if (!image_size) {
> +		mutex_unlock(&image[minor].mutex);
> +		return -EINVAL;

The original code looks pretty shady.  Sure.  This is fine.

> +	}
> +
> +	max_size = image_size;
> +	if (type[minor] == SLAVE_MINOR && max_size > image[minor].size_buf)
> +		max_size = image[minor].size_buf;

I don't understand this chunk.  It seems unrelated to a zero
return from vme_get_size().  It needs to be in a separate patch.

> 
>  	/* Ensure we are starting at a valid location */
> -	if ((*ppos < 0) || (*ppos > (image_size - 1))) {
> +	if ((*ppos < 0) || (*ppos >= max_size)) {

Fine.  The zero size - 1 is no good.

>  		mutex_unlock(&image[minor].mutex);
> -		return 0;
> +		return -EINVAL;

No.  You can't change this because it's API.  Also unrelated.

>  	}
> 
>  	/* Ensure not reading past end of the image */
> -	if (*ppos + count > image_size)
> -		count = image_size - *ppos;
> +	if (*ppos + count > max_size)
> +		count = max_size - *ppos;

This is unrelated to zero size so it would go in the other patch.


> 
>  	switch (type[minor]) {
>  	case MASTER_MINOR:
> @@ -224,6 +233,7 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf,
>  	unsigned int minor = iminor(file_inode(file));
>  	ssize_t retval;
>  	size_t image_size;
> +	size_t max_size;
> 
>  	if (minor == CONTROL_MINOR)
>  		return 0;
> @@ -231,16 +241,24 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf,
>  	mutex_lock(&image[minor].mutex);
> 
>  	image_size = vme_get_size(image[minor].resource);
> +	if (!image_size) {
> +		mutex_unlock(&image[minor].mutex);
> +		return -EINVAL;
> +	}
> +
> +	max_size = image_size;
> +	if (type[minor] == SLAVE_MINOR && max_size > image[minor].size_buf)
> +		max_size = image[minor].size_buf;
> 
>  	/* Ensure we are starting at a valid location */
> -	if ((*ppos < 0) || (*ppos > (image_size - 1))) {
> +	if ((*ppos < 0) || (*ppos >= max_size)) {
>  		mutex_unlock(&image[minor].mutex);
> -		return 0;
> +		return -EINVAL;
>  	}
> 
>  	/* Ensure not reading past end of the image */
> -	if (*ppos + count > image_size)
> -		count = image_size - *ppos;
> +	if (*ppos + count > max_size)
> +		count = max_size - *ppos;
> 
>  	switch (type[minor]) {
>  	case MASTER_MINOR:

Same review comments.

> @@ -394,6 +412,9 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
>  				return -EFAULT;
>  			}
> 
> +			if (slave.size > image[minor].size_buf)
> +				return -EINVAL;

This change is not explained well.  It would need to be in it's own
commit message.

The size is supposed to be checked in vme_check_window() so this
is the wrong place.  I looked at the checking and it seems okay
to me.

The rest is just more of the same.

regards,
dan carpenter


^ permalink raw reply

* [PATCH] staging: rtl8723bs: remove unnecessary NULL check before vfree
From: Bastien Cossette @ 2026-05-28  6:57 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging, Bastien Cossette

The vfree() function handles NULL pointers natively. Cleaning up the
redundant if check simplifies the code and adheres to core kernel
coding styles.

Signed-off-by: Bastien Cossette <bastiencossette29@icloud.com>
---
 drivers/staging/rtl8723bs/hal/hal_com.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index 728a2171fbcb..24dfae2dd759 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -23,14 +23,10 @@ u8 rtw_hal_data_init(struct adapter *padapter)
 
 void rtw_hal_data_deinit(struct adapter *padapter)
 {
-	if (padapter->HalData) {
-		vfree(padapter->HalData);
-		padapter->HalData = NULL;
-		padapter->hal_data_sz = 0;
-	}
+	vfree(padapter->HalData);
+	padapter->hal_data_sz = 0;
 }
 
-
 void dump_chip_info(struct hal_version	chip_version)
 {
 	char buf[128];
-- 
2.53.0


^ permalink raw reply related

* Re: [PATCH] vme_user: tighten slave window bounds and validate offsets
From: Greg KH @ 2026-05-28  5:33 UTC (permalink / raw)
  To: Lucas Faria Mendes; +Cc: linux-kernel, linux-staging
In-Reply-To: <20260527211425.569038-1-lucas.fariamo08@gmail.com>

On Wed, May 27, 2026 at 06:14:24PM -0300, Lucas Faria Mendes wrote:
> Limit slave read/write operations to the allocated buffer size to
> prevent out-of-bounds access when a slave window is
> configured larger than its buffer.
> Treat zero-sized windows and invalid file positions as errors,
> and reject VME_SET_SLAVE requests that exceed the slave buffer.
> This makes the user access driver more robust and avoids
> silent EOF on invalid offsets.

Odd line-wrapping :(

How did you find this issue?  How was it tested?

thanks,

greg k-h

^ permalink raw reply

* [PATCH] vme_user: tighten slave window bounds and validate offsets
From: Lucas Faria Mendes @ 2026-05-27 21:14 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, linux-staging, Lucas Faria Mendes

Limit slave read/write operations to the allocated buffer size to
prevent out-of-bounds access when a slave window is
configured larger than its buffer.
Treat zero-sized windows and invalid file positions as errors,
and reject VME_SET_SLAVE requests that exceed the slave buffer.
This makes the user access driver more robust and avoids
silent EOF on invalid offsets.

Signed-off-by: Lucas Faria Mendes <lucas.fariamo08@gmail.com>

diff --git a/drivers/staging/vme_user/vme_user.c b/drivers/staging/vme_user/vme_user.c
index 11e25c2f6..ca65cb57c 100644
--- a/drivers/staging/vme_user/vme_user.c
+++ b/drivers/staging/vme_user/vme_user.c
@@ -181,6 +181,7 @@ static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count,
 	unsigned int minor = iminor(file_inode(file));
 	ssize_t retval;
 	size_t image_size;
+	size_t max_size;

 	if (minor == CONTROL_MINOR)
 		return 0;
@@ -189,16 +190,24 @@ static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count,

 	/* XXX Do we *really* want this helper - we can use vme_*_get ? */
 	image_size = vme_get_size(image[minor].resource);
+	if (!image_size) {
+		mutex_unlock(&image[minor].mutex);
+		return -EINVAL;
+	}
+
+	max_size = image_size;
+	if (type[minor] == SLAVE_MINOR && max_size > image[minor].size_buf)
+		max_size = image[minor].size_buf;

 	/* Ensure we are starting at a valid location */
-	if ((*ppos < 0) || (*ppos > (image_size - 1))) {
+	if ((*ppos < 0) || (*ppos >= max_size)) {
 		mutex_unlock(&image[minor].mutex);
-		return 0;
+		return -EINVAL;
 	}

 	/* Ensure not reading past end of the image */
-	if (*ppos + count > image_size)
-		count = image_size - *ppos;
+	if (*ppos + count > max_size)
+		count = max_size - *ppos;

 	switch (type[minor]) {
 	case MASTER_MINOR:
@@ -224,6 +233,7 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf,
 	unsigned int minor = iminor(file_inode(file));
 	ssize_t retval;
 	size_t image_size;
+	size_t max_size;

 	if (minor == CONTROL_MINOR)
 		return 0;
@@ -231,16 +241,24 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf,
 	mutex_lock(&image[minor].mutex);

 	image_size = vme_get_size(image[minor].resource);
+	if (!image_size) {
+		mutex_unlock(&image[minor].mutex);
+		return -EINVAL;
+	}
+
+	max_size = image_size;
+	if (type[minor] == SLAVE_MINOR && max_size > image[minor].size_buf)
+		max_size = image[minor].size_buf;

 	/* Ensure we are starting at a valid location */
-	if ((*ppos < 0) || (*ppos > (image_size - 1))) {
+	if ((*ppos < 0) || (*ppos >= max_size)) {
 		mutex_unlock(&image[minor].mutex);
-		return 0;
+		return -EINVAL;
 	}

 	/* Ensure not reading past end of the image */
-	if (*ppos + count > image_size)
-		count = image_size - *ppos;
+	if (*ppos + count > max_size)
+		count = max_size - *ppos;

 	switch (type[minor]) {
 	case MASTER_MINOR:
@@ -394,6 +412,9 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 				return -EFAULT;
 			}

+			if (slave.size > image[minor].size_buf)
+				return -EINVAL;
+
 			/* XXX	We do not want to push aspace, cycle and width
 			 *	to userspace as they are
 			 */
---
 drivers/staging/vme_user/vme_user.c | 37 ++++++++++++++++++++++-------
 1 file changed, 29 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/vme_user/vme_user.c b/drivers/staging/vme_user/vme_user.c
index 11e25c2f6..ca65cb57c 100644
--- a/drivers/staging/vme_user/vme_user.c
+++ b/drivers/staging/vme_user/vme_user.c
@@ -181,6 +181,7 @@ static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count,
 	unsigned int minor = iminor(file_inode(file));
 	ssize_t retval;
 	size_t image_size;
+	size_t max_size;
 
 	if (minor == CONTROL_MINOR)
 		return 0;
@@ -189,16 +190,24 @@ static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count,
 
 	/* XXX Do we *really* want this helper - we can use vme_*_get ? */
 	image_size = vme_get_size(image[minor].resource);
+	if (!image_size) {
+		mutex_unlock(&image[minor].mutex);
+		return -EINVAL;
+	}
+
+	max_size = image_size;
+	if (type[minor] == SLAVE_MINOR && max_size > image[minor].size_buf)
+		max_size = image[minor].size_buf;
 
 	/* Ensure we are starting at a valid location */
-	if ((*ppos < 0) || (*ppos > (image_size - 1))) {
+	if ((*ppos < 0) || (*ppos >= max_size)) {
 		mutex_unlock(&image[minor].mutex);
-		return 0;
+		return -EINVAL;
 	}
 
 	/* Ensure not reading past end of the image */
-	if (*ppos + count > image_size)
-		count = image_size - *ppos;
+	if (*ppos + count > max_size)
+		count = max_size - *ppos;
 
 	switch (type[minor]) {
 	case MASTER_MINOR:
@@ -224,6 +233,7 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf,
 	unsigned int minor = iminor(file_inode(file));
 	ssize_t retval;
 	size_t image_size;
+	size_t max_size;
 
 	if (minor == CONTROL_MINOR)
 		return 0;
@@ -231,16 +241,24 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf,
 	mutex_lock(&image[minor].mutex);
 
 	image_size = vme_get_size(image[minor].resource);
+	if (!image_size) {
+		mutex_unlock(&image[minor].mutex);
+		return -EINVAL;
+	}
+
+	max_size = image_size;
+	if (type[minor] == SLAVE_MINOR && max_size > image[minor].size_buf)
+		max_size = image[minor].size_buf;
 
 	/* Ensure we are starting at a valid location */
-	if ((*ppos < 0) || (*ppos > (image_size - 1))) {
+	if ((*ppos < 0) || (*ppos >= max_size)) {
 		mutex_unlock(&image[minor].mutex);
-		return 0;
+		return -EINVAL;
 	}
 
 	/* Ensure not reading past end of the image */
-	if (*ppos + count > image_size)
-		count = image_size - *ppos;
+	if (*ppos + count > max_size)
+		count = max_size - *ppos;
 
 	switch (type[minor]) {
 	case MASTER_MINOR:
@@ -394,6 +412,9 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 				return -EFAULT;
 			}
 
+			if (slave.size > image[minor].size_buf)
+				return -EINVAL;
+
 			/* XXX	We do not want to push aspace, cycle and width
 			 *	to userspace as they are
 			 */
-- 
2.53.0


^ permalink raw reply related

* [PATCH] staging: greybus: Remove unused macro
From: Michail Tatas @ 2026-05-27 20:00 UTC (permalink / raw)
  To: pure.logic, johan, elder, gregkh; +Cc: greybus-dev, linux-staging, linux-kernel

Remove unused macro as indicated by the compiler
when building with make W=2

Signed-off-by: Michail Tatas <michail.tatas@gmail.com>
---
 drivers/staging/greybus/loopback.c | 26 --------------------------
 1 file changed, 26 deletions(-)

diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c
index 4d085d3cd471..7442b1c4e86c 100644
--- a/drivers/staging/greybus/loopback.c
+++ b/drivers/staging/greybus/loopback.c
@@ -167,32 +167,6 @@ static DEVICE_ATTR_RO(name##_avg)
 	gb_loopback_ro_stats_attr(field, max, u);		\
 	gb_loopback_ro_avg_attr(field)
 
-#define gb_loopback_attr(field, type)					\
-static ssize_t field##_show(struct device *dev,				\
-			    struct device_attribute *attr,		\
-			    char *buf)					\
-{									\
-	struct gb_loopback *gb = dev_get_drvdata(dev);			\
-	return sysfs_emit(buf, "%" #type "\n", gb->field);			\
-}									\
-static ssize_t field##_store(struct device *dev,			\
-			    struct device_attribute *attr,		\
-			    const char *buf,				\
-			    size_t len)					\
-{									\
-	int ret;							\
-	struct gb_loopback *gb = dev_get_drvdata(dev);			\
-	mutex_lock(&gb->mutex);						\
-	ret = sscanf(buf, "%"#type, &gb->field);			\
-	if (ret != 1)							\
-		len = -EINVAL;						\
-	else								\
-		gb_loopback_check_attr(gb, bundle);			\
-	mutex_unlock(&gb->mutex);					\
-	return len;							\
-}									\
-static DEVICE_ATTR_RW(field)
-
 #define gb_dev_loopback_ro_attr(field)				\
 static ssize_t field##_show(struct device *dev,		\
 			    struct device_attribute *attr,		\
-- 
2.43.0


^ permalink raw reply related

* [PATCH] staging: vme_user: fix CamelCase macros by converting to uppercase with underscores
From: Lucas Faria Mendes @ 2026-05-27 19:12 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, linux-staging, Lucas Faria Mendes

Fix the following CHECK style issues reported by checkpatch.pl:
Avoid CamelCase: <VME_2eVME>
Avoid CamelCase: <VME_2eSST>
Avoid CamelCase: <VME_2eSSTB>
Avoid CamelCase: <VME_2eSST160>
Avoid CamelCase: <VME_2eSST267>
Avoid CamelCase: <VME_2eSST320>

Convert the lowercase 'e' to uppercase 'E' and separate the protocol
naming elements using underscores (e.g., VME_2E_VME). Update all macro
definitions in vme.h and their respective usages across the driver
files to comply with the Linux kernel coding style.

Signed-off-by: Lucas Faria Mendes <lucas.fariamo08@gmail.com>

diff --git a/drivers/staging/vme_user/vme.h b/drivers/staging/vme_user/vme.h
index b6413605e..03b7b11c1 100644
--- a/drivers/staging/vme_user/vme.h
+++ b/drivers/staging/vme_user/vme.h
@@ -33,13 +33,13 @@ enum vme_resource_type {
 #define VME_SCT		0x1
 #define VME_BLT		0x2
 #define VME_MBLT	0x4
-#define VME_2eVME	0x8
-#define VME_2eSST	0x10
-#define VME_2eSSTB	0x20
+#define VME_2E_VME	0x8
+#define VME_2E_SST	0x10
+#define VME_2E_SSTB	0x20

-#define VME_2eSST160	0x100
-#define VME_2eSST267	0x200
-#define VME_2eSST320	0x400
+#define VME_2E_SST160	0x100
+#define VME_2E_SST267	0x200
+#define VME_2E_SST320	0x400

 #define	VME_SUPER	0x1000
 #define	VME_USER	0x2000
diff --git a/drivers/staging/vme_user/vme_fake.c b/drivers/staging/vme_user/vme_fake.c
index 8abaa3165..ac0871fc1 100644
--- a/drivers/staging/vme_user/vme_fake.c
+++ b/drivers/staging/vme_user/vme_fake.c
@@ -1114,8 +1114,8 @@ static int __init fake_init(void)
 		master_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
 			VME_A64;
 		master_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
-			VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
-			VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
+			VME_2E_VME | VME_2E_SST | VME_2E_SSTB | VME_2E_SST160 |
+			VME_2E_SST267 | VME_2E_SST320 | VME_SUPER | VME_USER |
 			VME_PROG | VME_DATA;
 		master_image->width_attr = VME_D16 | VME_D32;
 		memset(&master_image->bus_resource, 0,
@@ -1141,8 +1141,8 @@ static int __init fake_init(void)
 			VME_A64 | VME_CRCSR | VME_USER1 | VME_USER2 |
 			VME_USER3 | VME_USER4;
 		slave_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
-			VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
-			VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
+			VME_2E_VME | VME_2E_SST | VME_2E_SSTB | VME_2E_SST160 |
+			VME_2E_SST267 | VME_2E_SST320 | VME_SUPER | VME_USER |
 			VME_PROG | VME_DATA;
 		list_add_tail(&slave_image->list,
 			      &fake_bridge->slave_resources);
diff --git a/drivers/staging/vme_user/vme_tsi148.c b/drivers/staging/vme_user/vme_tsi148.c
index 4cf348664..9d466f529 100644
--- a/drivers/staging/vme_user/vme_tsi148.c
+++ b/drivers/staging/vme_user/vme_tsi148.c
@@ -551,14 +551,14 @@ static int tsi148_slave_set(struct vme_slave_resource *image, int enabled,

 	/* Setup 2eSST speeds */
 	temp_ctl &= ~TSI148_LCSR_ITAT_2eSSTM_M;
-	switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
-	case VME_2eSST160:
+	switch (cycle & (VME_2E_SST160 | VME_2E_SST267 | VME_2E_SST320)) {
+	case VME_2E_SST160:
 		temp_ctl |= TSI148_LCSR_ITAT_2eSSTM_160;
 		break;
-	case VME_2eSST267:
+	case VME_2E_SST267:
 		temp_ctl |= TSI148_LCSR_ITAT_2eSSTM_267;
 		break;
-	case VME_2eSST320:
+	case VME_2E_SST320:
 		temp_ctl |= TSI148_LCSR_ITAT_2eSSTM_320;
 		break;
 	}
@@ -569,11 +569,11 @@ static int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
 		temp_ctl |= TSI148_LCSR_ITAT_BLT;
 	if (cycle & VME_MBLT)
 		temp_ctl |= TSI148_LCSR_ITAT_MBLT;
-	if (cycle & VME_2eVME)
+	if (cycle & VME_2E_VME)
 		temp_ctl |= TSI148_LCSR_ITAT_2eVME;
-	if (cycle & VME_2eSST)
+	if (cycle & VME_2E_SST)
 		temp_ctl |= TSI148_LCSR_ITAT_2eSST;
-	if (cycle & VME_2eSSTB)
+	if (cycle & VME_2E_SSTB)
 		temp_ctl |= TSI148_LCSR_ITAT_2eSSTB;

 	/* Setup address space */
@@ -673,22 +673,22 @@ static int tsi148_slave_get(struct vme_slave_resource *image, int *enabled,
 	*size = (unsigned long long)((vme_bound - *vme_base) + granularity);

 	if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_160)
-		*cycle |= VME_2eSST160;
+		*cycle |= VME_2E_SST160;
 	if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_267)
-		*cycle |= VME_2eSST267;
+		*cycle |= VME_2E_SST267;
 	if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_320)
-		*cycle |= VME_2eSST320;
+		*cycle |= VME_2E_SST320;

 	if (ctl & TSI148_LCSR_ITAT_BLT)
 		*cycle |= VME_BLT;
 	if (ctl & TSI148_LCSR_ITAT_MBLT)
 		*cycle |= VME_MBLT;
 	if (ctl & TSI148_LCSR_ITAT_2eVME)
-		*cycle |= VME_2eVME;
+		*cycle |= VME_2E_VME;
 	if (ctl & TSI148_LCSR_ITAT_2eSST)
-		*cycle |= VME_2eSST;
+		*cycle |= VME_2E_SST;
 	if (ctl & TSI148_LCSR_ITAT_2eSSTB)
-		*cycle |= VME_2eSSTB;
+		*cycle |= VME_2E_SSTB;

 	if (ctl & TSI148_LCSR_ITAT_SUPR)
 		*cycle |= VME_SUPER;
@@ -894,14 +894,14 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,

 	/* Setup 2eSST speeds */
 	temp_ctl &= ~TSI148_LCSR_OTAT_2eSSTM_M;
-	switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
-	case VME_2eSST160:
+	switch (cycle & (VME_2E_SST160 | VME_2E_SST267 | VME_2E_SST320)) {
+	case VME_2E_SST160:
 		temp_ctl |= TSI148_LCSR_OTAT_2eSSTM_160;
 		break;
-	case VME_2eSST267:
+	case VME_2E_SST267:
 		temp_ctl |= TSI148_LCSR_OTAT_2eSSTM_267;
 		break;
-	case VME_2eSST320:
+	case VME_2E_SST320:
 		temp_ctl |= TSI148_LCSR_OTAT_2eSSTM_320;
 		break;
 	}
@@ -915,15 +915,15 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
 		temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
 		temp_ctl |= TSI148_LCSR_OTAT_TM_MBLT;
 	}
-	if (cycle & VME_2eVME) {
+	if (cycle & VME_2E_VME) {
 		temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
 		temp_ctl |= TSI148_LCSR_OTAT_TM_2eVME;
 	}
-	if (cycle & VME_2eSST) {
+	if (cycle & VME_2E_SST) {
 		temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
 		temp_ctl |= TSI148_LCSR_OTAT_TM_2eSST;
 	}
-	if (cycle & VME_2eSSTB) {
+	if (cycle & VME_2E_SSTB) {
 		dev_warn(tsi148_bridge->parent, "Currently not setting Broadcast Select Registers\n");
 		temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
 		temp_ctl |= TSI148_LCSR_OTAT_TM_2eSSTB;
@@ -1099,11 +1099,11 @@ static int __tsi148_master_get(struct vme_master_resource *image, int *enabled,

 	/* Setup 2eSST speeds */
 	if ((ctl & TSI148_LCSR_OTAT_2eSSTM_M) == TSI148_LCSR_OTAT_2eSSTM_160)
-		*cycle |= VME_2eSST160;
+		*cycle |= VME_2E_SST160;
 	if ((ctl & TSI148_LCSR_OTAT_2eSSTM_M) == TSI148_LCSR_OTAT_2eSSTM_267)
-		*cycle |= VME_2eSST267;
+		*cycle |= VME_2E_SST267;
 	if ((ctl & TSI148_LCSR_OTAT_2eSSTM_M) == TSI148_LCSR_OTAT_2eSSTM_320)
-		*cycle |= VME_2eSST320;
+		*cycle |= VME_2E_SST320;

 	/* Setup cycle types */
 	if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_SCT)
@@ -1113,11 +1113,11 @@ static int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
 	if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_MBLT)
 		*cycle |= VME_MBLT;
 	if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_2eVME)
-		*cycle |= VME_2eVME;
+		*cycle |= VME_2E_VME;
 	if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_2eSST)
-		*cycle |= VME_2eSST;
+		*cycle |= VME_2E_SST;
 	if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_2eSSTB)
-		*cycle |= VME_2eSSTB;
+		*cycle |= VME_2E_SSTB;

 	if (ctl & TSI148_LCSR_OTAT_SUP)
 		*cycle |= VME_SUPER;
@@ -1404,14 +1404,14 @@ static int tsi148_dma_set_vme_src_attributes(struct device *dev, __be32 *attr,
 	val = be32_to_cpu(*attr);

 	/* Setup 2eSST speeds */
-	switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
-	case VME_2eSST160:
+	switch (cycle & (VME_2E_SST160 | VME_2E_SST267 | VME_2E_SST320)) {
+	case VME_2E_SST160:
 		val |= TSI148_LCSR_DSAT_2eSSTM_160;
 		break;
-	case VME_2eSST267:
+	case VME_2E_SST267:
 		val |= TSI148_LCSR_DSAT_2eSSTM_267;
 		break;
-	case VME_2eSST320:
+	case VME_2E_SST320:
 		val |= TSI148_LCSR_DSAT_2eSSTM_320;
 		break;
 	}
@@ -1426,13 +1426,13 @@ static int tsi148_dma_set_vme_src_attributes(struct device *dev, __be32 *attr,
 	if (cycle & VME_MBLT)
 		val |= TSI148_LCSR_DSAT_TM_MBLT;

-	if (cycle & VME_2eVME)
+	if (cycle & VME_2E_VME)
 		val |= TSI148_LCSR_DSAT_TM_2eVME;

-	if (cycle & VME_2eSST)
+	if (cycle & VME_2E_SST)
 		val |= TSI148_LCSR_DSAT_TM_2eSST;

-	if (cycle & VME_2eSSTB) {
+	if (cycle & VME_2E_SSTB) {
 		dev_err(dev, "Currently not setting Broadcast Select Registers\n");
 		val |= TSI148_LCSR_DSAT_TM_2eSSTB;
 	}
@@ -1502,14 +1502,14 @@ static int tsi148_dma_set_vme_dest_attributes(struct device *dev, __be32 *attr,
 	val = be32_to_cpu(*attr);

 	/* Setup 2eSST speeds */
-	switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
-	case VME_2eSST160:
+	switch (cycle & (VME_2E_SST160 | VME_2E_SST267 | VME_2E_SST320)) {
+	case VME_2E_SST160:
 		val |= TSI148_LCSR_DDAT_2eSSTM_160;
 		break;
-	case VME_2eSST267:
+	case VME_2E_SST267:
 		val |= TSI148_LCSR_DDAT_2eSSTM_267;
 		break;
-	case VME_2eSST320:
+	case VME_2E_SST320:
 		val |= TSI148_LCSR_DDAT_2eSSTM_320;
 		break;
 	}
@@ -1524,13 +1524,13 @@ static int tsi148_dma_set_vme_dest_attributes(struct device *dev, __be32 *attr,
 	if (cycle & VME_MBLT)
 		val |= TSI148_LCSR_DDAT_TM_MBLT;

-	if (cycle & VME_2eVME)
+	if (cycle & VME_2E_VME)
 		val |= TSI148_LCSR_DDAT_TM_2eVME;

-	if (cycle & VME_2eSST)
+	if (cycle & VME_2E_SST)
 		val |= TSI148_LCSR_DDAT_TM_2eSST;

-	if (cycle & VME_2eSSTB) {
+	if (cycle & VME_2E_SSTB) {
 		dev_err(dev, "Currently not setting Broadcast Select Registers\n");
 		val |= TSI148_LCSR_DDAT_TM_2eSSTB;
 	}
@@ -2361,8 +2361,8 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			VME_A64 | VME_CRCSR | VME_USER1 | VME_USER2 |
 			VME_USER3 | VME_USER4;
 		master_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
-			VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
-			VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
+			VME_2E_VME | VME_2E_SST | VME_2E_SSTB | VME_2E_SST160 |
+			VME_2E_SST267 | VME_2E_SST320 | VME_SUPER | VME_USER |
 			VME_PROG | VME_DATA;
 		master_image->width_attr = VME_D16 | VME_D32;
 		memset(&master_image->bus_resource, 0,
@@ -2386,8 +2386,8 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		slave_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
 			VME_A64;
 		slave_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
-			VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
-			VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
+			VME_2E_VME | VME_2E_SST | VME_2E_SSTB | VME_2E_SST160 |
+			VME_2E_SST267 | VME_2E_SST320 | VME_SUPER | VME_USER |
 			VME_PROG | VME_DATA;
 		list_add_tail(&slave_image->list,
 			      &tsi148_bridge->slave_resources);
---
 drivers/staging/vme_user/vme.h        | 12 ++--
 drivers/staging/vme_user/vme_fake.c   |  8 +--
 drivers/staging/vme_user/vme_tsi148.c | 88 +++++++++++++--------------
 3 files changed, 54 insertions(+), 54 deletions(-)

diff --git a/drivers/staging/vme_user/vme.h b/drivers/staging/vme_user/vme.h
index b6413605e..03b7b11c1 100644
--- a/drivers/staging/vme_user/vme.h
+++ b/drivers/staging/vme_user/vme.h
@@ -33,13 +33,13 @@ enum vme_resource_type {
 #define VME_SCT		0x1
 #define VME_BLT		0x2
 #define VME_MBLT	0x4
-#define VME_2eVME	0x8
-#define VME_2eSST	0x10
-#define VME_2eSSTB	0x20
+#define VME_2E_VME	0x8
+#define VME_2E_SST	0x10
+#define VME_2E_SSTB	0x20
 
-#define VME_2eSST160	0x100
-#define VME_2eSST267	0x200
-#define VME_2eSST320	0x400
+#define VME_2E_SST160	0x100
+#define VME_2E_SST267	0x200
+#define VME_2E_SST320	0x400
 
 #define	VME_SUPER	0x1000
 #define	VME_USER	0x2000
diff --git a/drivers/staging/vme_user/vme_fake.c b/drivers/staging/vme_user/vme_fake.c
index 8abaa3165..ac0871fc1 100644
--- a/drivers/staging/vme_user/vme_fake.c
+++ b/drivers/staging/vme_user/vme_fake.c
@@ -1114,8 +1114,8 @@ static int __init fake_init(void)
 		master_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
 			VME_A64;
 		master_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
-			VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
-			VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
+			VME_2E_VME | VME_2E_SST | VME_2E_SSTB | VME_2E_SST160 |
+			VME_2E_SST267 | VME_2E_SST320 | VME_SUPER | VME_USER |
 			VME_PROG | VME_DATA;
 		master_image->width_attr = VME_D16 | VME_D32;
 		memset(&master_image->bus_resource, 0,
@@ -1141,8 +1141,8 @@ static int __init fake_init(void)
 			VME_A64 | VME_CRCSR | VME_USER1 | VME_USER2 |
 			VME_USER3 | VME_USER4;
 		slave_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
-			VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
-			VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
+			VME_2E_VME | VME_2E_SST | VME_2E_SSTB | VME_2E_SST160 |
+			VME_2E_SST267 | VME_2E_SST320 | VME_SUPER | VME_USER |
 			VME_PROG | VME_DATA;
 		list_add_tail(&slave_image->list,
 			      &fake_bridge->slave_resources);
diff --git a/drivers/staging/vme_user/vme_tsi148.c b/drivers/staging/vme_user/vme_tsi148.c
index 4cf348664..9d466f529 100644
--- a/drivers/staging/vme_user/vme_tsi148.c
+++ b/drivers/staging/vme_user/vme_tsi148.c
@@ -551,14 +551,14 @@ static int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
 
 	/* Setup 2eSST speeds */
 	temp_ctl &= ~TSI148_LCSR_ITAT_2eSSTM_M;
-	switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
-	case VME_2eSST160:
+	switch (cycle & (VME_2E_SST160 | VME_2E_SST267 | VME_2E_SST320)) {
+	case VME_2E_SST160:
 		temp_ctl |= TSI148_LCSR_ITAT_2eSSTM_160;
 		break;
-	case VME_2eSST267:
+	case VME_2E_SST267:
 		temp_ctl |= TSI148_LCSR_ITAT_2eSSTM_267;
 		break;
-	case VME_2eSST320:
+	case VME_2E_SST320:
 		temp_ctl |= TSI148_LCSR_ITAT_2eSSTM_320;
 		break;
 	}
@@ -569,11 +569,11 @@ static int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
 		temp_ctl |= TSI148_LCSR_ITAT_BLT;
 	if (cycle & VME_MBLT)
 		temp_ctl |= TSI148_LCSR_ITAT_MBLT;
-	if (cycle & VME_2eVME)
+	if (cycle & VME_2E_VME)
 		temp_ctl |= TSI148_LCSR_ITAT_2eVME;
-	if (cycle & VME_2eSST)
+	if (cycle & VME_2E_SST)
 		temp_ctl |= TSI148_LCSR_ITAT_2eSST;
-	if (cycle & VME_2eSSTB)
+	if (cycle & VME_2E_SSTB)
 		temp_ctl |= TSI148_LCSR_ITAT_2eSSTB;
 
 	/* Setup address space */
@@ -673,22 +673,22 @@ static int tsi148_slave_get(struct vme_slave_resource *image, int *enabled,
 	*size = (unsigned long long)((vme_bound - *vme_base) + granularity);
 
 	if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_160)
-		*cycle |= VME_2eSST160;
+		*cycle |= VME_2E_SST160;
 	if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_267)
-		*cycle |= VME_2eSST267;
+		*cycle |= VME_2E_SST267;
 	if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_320)
-		*cycle |= VME_2eSST320;
+		*cycle |= VME_2E_SST320;
 
 	if (ctl & TSI148_LCSR_ITAT_BLT)
 		*cycle |= VME_BLT;
 	if (ctl & TSI148_LCSR_ITAT_MBLT)
 		*cycle |= VME_MBLT;
 	if (ctl & TSI148_LCSR_ITAT_2eVME)
-		*cycle |= VME_2eVME;
+		*cycle |= VME_2E_VME;
 	if (ctl & TSI148_LCSR_ITAT_2eSST)
-		*cycle |= VME_2eSST;
+		*cycle |= VME_2E_SST;
 	if (ctl & TSI148_LCSR_ITAT_2eSSTB)
-		*cycle |= VME_2eSSTB;
+		*cycle |= VME_2E_SSTB;
 
 	if (ctl & TSI148_LCSR_ITAT_SUPR)
 		*cycle |= VME_SUPER;
@@ -894,14 +894,14 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
 
 	/* Setup 2eSST speeds */
 	temp_ctl &= ~TSI148_LCSR_OTAT_2eSSTM_M;
-	switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
-	case VME_2eSST160:
+	switch (cycle & (VME_2E_SST160 | VME_2E_SST267 | VME_2E_SST320)) {
+	case VME_2E_SST160:
 		temp_ctl |= TSI148_LCSR_OTAT_2eSSTM_160;
 		break;
-	case VME_2eSST267:
+	case VME_2E_SST267:
 		temp_ctl |= TSI148_LCSR_OTAT_2eSSTM_267;
 		break;
-	case VME_2eSST320:
+	case VME_2E_SST320:
 		temp_ctl |= TSI148_LCSR_OTAT_2eSSTM_320;
 		break;
 	}
@@ -915,15 +915,15 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
 		temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
 		temp_ctl |= TSI148_LCSR_OTAT_TM_MBLT;
 	}
-	if (cycle & VME_2eVME) {
+	if (cycle & VME_2E_VME) {
 		temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
 		temp_ctl |= TSI148_LCSR_OTAT_TM_2eVME;
 	}
-	if (cycle & VME_2eSST) {
+	if (cycle & VME_2E_SST) {
 		temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
 		temp_ctl |= TSI148_LCSR_OTAT_TM_2eSST;
 	}
-	if (cycle & VME_2eSSTB) {
+	if (cycle & VME_2E_SSTB) {
 		dev_warn(tsi148_bridge->parent, "Currently not setting Broadcast Select Registers\n");
 		temp_ctl &= ~TSI148_LCSR_OTAT_TM_M;
 		temp_ctl |= TSI148_LCSR_OTAT_TM_2eSSTB;
@@ -1099,11 +1099,11 @@ static int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
 
 	/* Setup 2eSST speeds */
 	if ((ctl & TSI148_LCSR_OTAT_2eSSTM_M) == TSI148_LCSR_OTAT_2eSSTM_160)
-		*cycle |= VME_2eSST160;
+		*cycle |= VME_2E_SST160;
 	if ((ctl & TSI148_LCSR_OTAT_2eSSTM_M) == TSI148_LCSR_OTAT_2eSSTM_267)
-		*cycle |= VME_2eSST267;
+		*cycle |= VME_2E_SST267;
 	if ((ctl & TSI148_LCSR_OTAT_2eSSTM_M) == TSI148_LCSR_OTAT_2eSSTM_320)
-		*cycle |= VME_2eSST320;
+		*cycle |= VME_2E_SST320;
 
 	/* Setup cycle types */
 	if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_SCT)
@@ -1113,11 +1113,11 @@ static int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
 	if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_MBLT)
 		*cycle |= VME_MBLT;
 	if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_2eVME)
-		*cycle |= VME_2eVME;
+		*cycle |= VME_2E_VME;
 	if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_2eSST)
-		*cycle |= VME_2eSST;
+		*cycle |= VME_2E_SST;
 	if ((ctl & TSI148_LCSR_OTAT_TM_M) == TSI148_LCSR_OTAT_TM_2eSSTB)
-		*cycle |= VME_2eSSTB;
+		*cycle |= VME_2E_SSTB;
 
 	if (ctl & TSI148_LCSR_OTAT_SUP)
 		*cycle |= VME_SUPER;
@@ -1404,14 +1404,14 @@ static int tsi148_dma_set_vme_src_attributes(struct device *dev, __be32 *attr,
 	val = be32_to_cpu(*attr);
 
 	/* Setup 2eSST speeds */
-	switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
-	case VME_2eSST160:
+	switch (cycle & (VME_2E_SST160 | VME_2E_SST267 | VME_2E_SST320)) {
+	case VME_2E_SST160:
 		val |= TSI148_LCSR_DSAT_2eSSTM_160;
 		break;
-	case VME_2eSST267:
+	case VME_2E_SST267:
 		val |= TSI148_LCSR_DSAT_2eSSTM_267;
 		break;
-	case VME_2eSST320:
+	case VME_2E_SST320:
 		val |= TSI148_LCSR_DSAT_2eSSTM_320;
 		break;
 	}
@@ -1426,13 +1426,13 @@ static int tsi148_dma_set_vme_src_attributes(struct device *dev, __be32 *attr,
 	if (cycle & VME_MBLT)
 		val |= TSI148_LCSR_DSAT_TM_MBLT;
 
-	if (cycle & VME_2eVME)
+	if (cycle & VME_2E_VME)
 		val |= TSI148_LCSR_DSAT_TM_2eVME;
 
-	if (cycle & VME_2eSST)
+	if (cycle & VME_2E_SST)
 		val |= TSI148_LCSR_DSAT_TM_2eSST;
 
-	if (cycle & VME_2eSSTB) {
+	if (cycle & VME_2E_SSTB) {
 		dev_err(dev, "Currently not setting Broadcast Select Registers\n");
 		val |= TSI148_LCSR_DSAT_TM_2eSSTB;
 	}
@@ -1502,14 +1502,14 @@ static int tsi148_dma_set_vme_dest_attributes(struct device *dev, __be32 *attr,
 	val = be32_to_cpu(*attr);
 
 	/* Setup 2eSST speeds */
-	switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
-	case VME_2eSST160:
+	switch (cycle & (VME_2E_SST160 | VME_2E_SST267 | VME_2E_SST320)) {
+	case VME_2E_SST160:
 		val |= TSI148_LCSR_DDAT_2eSSTM_160;
 		break;
-	case VME_2eSST267:
+	case VME_2E_SST267:
 		val |= TSI148_LCSR_DDAT_2eSSTM_267;
 		break;
-	case VME_2eSST320:
+	case VME_2E_SST320:
 		val |= TSI148_LCSR_DDAT_2eSSTM_320;
 		break;
 	}
@@ -1524,13 +1524,13 @@ static int tsi148_dma_set_vme_dest_attributes(struct device *dev, __be32 *attr,
 	if (cycle & VME_MBLT)
 		val |= TSI148_LCSR_DDAT_TM_MBLT;
 
-	if (cycle & VME_2eVME)
+	if (cycle & VME_2E_VME)
 		val |= TSI148_LCSR_DDAT_TM_2eVME;
 
-	if (cycle & VME_2eSST)
+	if (cycle & VME_2E_SST)
 		val |= TSI148_LCSR_DDAT_TM_2eSST;
 
-	if (cycle & VME_2eSSTB) {
+	if (cycle & VME_2E_SSTB) {
 		dev_err(dev, "Currently not setting Broadcast Select Registers\n");
 		val |= TSI148_LCSR_DDAT_TM_2eSSTB;
 	}
@@ -2361,8 +2361,8 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			VME_A64 | VME_CRCSR | VME_USER1 | VME_USER2 |
 			VME_USER3 | VME_USER4;
 		master_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
-			VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
-			VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
+			VME_2E_VME | VME_2E_SST | VME_2E_SSTB | VME_2E_SST160 |
+			VME_2E_SST267 | VME_2E_SST320 | VME_SUPER | VME_USER |
 			VME_PROG | VME_DATA;
 		master_image->width_attr = VME_D16 | VME_D32;
 		memset(&master_image->bus_resource, 0,
@@ -2386,8 +2386,8 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		slave_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
 			VME_A64;
 		slave_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
-			VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
-			VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
+			VME_2E_VME | VME_2E_SST | VME_2E_SSTB | VME_2E_SST160 |
+			VME_2E_SST267 | VME_2E_SST320 | VME_SUPER | VME_USER |
 			VME_PROG | VME_DATA;
 		list_add_tail(&slave_image->list,
 			      &tsi148_bridge->slave_resources);
-- 
2.53.0


^ permalink raw reply related

* [PATCH] staging: rtl8723bs: fix spelling mistake in rtw_recv.c
From: Tomasz Unger @ 2026-05-27 18:31 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel, Tomasz Unger
In-Reply-To: <20260527-staging-fix-1-v1-1-66ad880bcf76.ref@yahoo.pl>

Fix typo 'temporily' -> 'temporarily' in comments.

Found by codespell.

Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
---
 drivers/staging/rtl8723bs/core/rtw_recv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 86c5e2c4e7dd..0ffa69c38bca 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -815,7 +815,7 @@ static signed int ap2sta_data_frame(struct adapter *adapter, union recv_frame *p
 		}
 
 		if (GetFrameSubType(ptr) & BIT(6)) {
-			/* No data, will not indicate to upper layer, temporily count it here */
+			/* No data, will not indicate to upper layer, temporarily count it here */
 			count_rx_stats(adapter, precv_frame, *psta);
 			ret = RTW_RX_HANDLED;
 			goto exit;
@@ -895,7 +895,7 @@ static signed int sta2ap_data_frame(struct adapter *adapter, union recv_frame *p
 			process_wmmps_data(adapter, precv_frame);
 
 		if (GetFrameSubType(ptr) & BIT(6)) {
-			/* No data, will not indicate to upper layer, temporily count it here */
+			/* No data, will not indicate to upper layer, temporarily count it here */
 			count_rx_stats(adapter, precv_frame, *psta);
 			ret = RTW_RX_HANDLED;
 			goto exit;

---
base-commit: 7cb1c5b32a2bfde961fff8d5204526b609bcb30a
change-id: 20260527-staging-fix-1-aa6540361258

Best regards,
--  
Tomasz Unger <tomasz.unger@yahoo.pl>


^ permalink raw reply related

* Re: [PATCH v4] staging: media: Remove deprecated Atmel ISC drivers
From: Eugen Hristev @ 2026-05-27 16:31 UTC (permalink / raw)
  To: Ashwin Gundarapu, gregkh; +Cc: linux-kernel, linux-staging, linux-media
In-Reply-To: <19e68911259.638e56bd13233.647726868191191070@zohomail.in>

On 5/27/26 11:33, Ashwin Gundarapu wrote:
> The Atmel ISC and XISC drivers were deprecated and scheduled
> for removal by the beginning of 2026. The replacement drivers
> (VIDEO_MICROCHIP_ISC and VIDEO_MICROCHIP_XISC) are available
> in the main media subsystem.
> 
> Remove the Kconfig entries, Makefile rules, MAINTAINERS entries,
> and the STAGING_MEDIA_DEPRECATED menuconfig since it is no longer
> needed. The source files remain on disk but are no longer compiled
> since the build infrastructure is removed.
> 
> Signed-off-by: Ashwin Gundarapu <linuxuser509@zohomail.in>
> ---

This is very strange . It comes *right after* I already sent a patch for
this.
Also, your patch is incomplete. "Source files remain on disk" ??


> v3: Updated MAINTAINERS to remove staging/atmel references.
> v2: Removed Kconfig and Makefile to fix Media CI build issues.
> ---
>  MAINTAINERS                                   |  2 -
>  drivers/staging/media/Kconfig                 | 18 +------
>  drivers/staging/media/Makefile                |  1 -
>  .../staging/media/deprecated/atmel/Kconfig    | 47 -------------------
>  .../staging/media/deprecated/atmel/Makefile   |  8 ----
>  5 files changed, 1 insertion(+), 75 deletions(-)
>  delete mode 100644 drivers/staging/media/deprecated/atmel/Kconfig
>  delete mode 100644 drivers/staging/media/deprecated/atmel/Makefile
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 27a073f53cea..4290eae8838e 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -17364,8 +17364,6 @@ F:	Documentation/devicetree/bindings/media/atmel,isc.yaml
>  F:	Documentation/devicetree/bindings/media/microchip,xisc.yaml
>  F:	drivers/media/platform/microchip/microchip-isc*
>  F:	drivers/media/platform/microchip/microchip-sama*-isc*
> -F:	drivers/staging/media/deprecated/atmel/atmel-isc*
> -F:	drivers/staging/media/deprecated/atmel/atmel-sama*-isc*
>  F:	include/linux/atmel-isc-media.h
> 
>  MICROCHIP ISI DRIVER
> diff --git a/drivers/staging/media/Kconfig b/drivers/staging/media/Kconfig
> index 1aa31bddf970..52b4aab944f6 100644
> --- a/drivers/staging/media/Kconfig
> +++ b/drivers/staging/media/Kconfig
> @@ -38,20 +38,4 @@ source "drivers/staging/media/sunxi/Kconfig"
> 
>  source "drivers/staging/media/tegra-video/Kconfig"
> 
> -menuconfig STAGING_MEDIA_DEPRECATED
> -	bool "Media staging drivers (DEPRECATED)"
> -	default n
> -	help
> -	  This option enables deprecated media drivers that are
> -	  scheduled for future removal from the kernel.
> -
> -	  If you wish to work on these drivers to prevent their removal,
> -	  then contact the linux-media@vger.kernel.org mailing list.
> -
> -	  If in doubt, say N here.
> -
> -if STAGING_MEDIA_DEPRECATED
> -source "drivers/staging/media/deprecated/atmel/Kconfig"
> -endif
> -
> -endif
> +endif # STAGING_MEDIA
> diff --git a/drivers/staging/media/Makefile b/drivers/staging/media/Makefile
> index 6f78b0edde1e..6fd7179733d8 100644
> --- a/drivers/staging/media/Makefile
> +++ b/drivers/staging/media/Makefile
> @@ -1,5 +1,4 @@
>  # SPDX-License-Identifier: GPL-2.0
> -obj-$(CONFIG_VIDEO_ATMEL_ISC_BASE)	+= deprecated/atmel/
>  obj-$(CONFIG_INTEL_ATOMISP)     += atomisp/
>  obj-$(CONFIG_VIDEO_IMX_MEDIA)	+= imx/
>  obj-$(CONFIG_VIDEO_MAX96712)	+= max96712/
> diff --git a/drivers/staging/media/deprecated/atmel/Kconfig b/drivers/staging/media/deprecated/atmel/Kconfig
> deleted file mode 100644
> index 418841ea5a0d..000000000000
> --- a/drivers/staging/media/deprecated/atmel/Kconfig
> +++ /dev/null
> @@ -1,47 +0,0 @@
> -# SPDX-License-Identifier: GPL-2.0-only
> -
> -comment "Atmel media platform drivers"
> -
> -config VIDEO_ATMEL_ISC
> -	tristate "ATMEL Image Sensor Controller (ISC) support (DEPRECATED)"
> -	depends on V4L_PLATFORM_DRIVERS
> -	depends on VIDEO_DEV && COMMON_CLK
> -	depends on ARCH_AT91 || COMPILE_TEST
> -	depends on !VIDEO_MICROCHIP_ISC_BASE || COMPILE_TEST
> -	select MEDIA_CONTROLLER
> -	select VIDEO_V4L2_SUBDEV_API
> -	select VIDEOBUF2_DMA_CONTIG
> -	select REGMAP_MMIO
> -	select V4L2_FWNODE
> -	select VIDEO_ATMEL_ISC_BASE
> -	help
> -	   This module makes the ATMEL Image Sensor Controller available
> -	   as a v4l2 device.
> -
> -	   This driver is deprecated and is scheduled for removal by
> -	   the beginning of 2026. See the TODO file for more information.
> -
> -config VIDEO_ATMEL_XISC
> -	tristate "ATMEL eXtended Image Sensor Controller (XISC) support (DEPRECATED)"
> -	depends on V4L_PLATFORM_DRIVERS
> -	depends on VIDEO_DEV && COMMON_CLK
> -	depends on ARCH_AT91 || COMPILE_TEST
> -	depends on !VIDEO_MICROCHIP_ISC_BASE || COMPILE_TEST
> -	select VIDEOBUF2_DMA_CONTIG
> -	select REGMAP_MMIO
> -	select V4L2_FWNODE
> -	select VIDEO_ATMEL_ISC_BASE
> -	select MEDIA_CONTROLLER
> -	select VIDEO_V4L2_SUBDEV_API
> -	help
> -	   This module makes the ATMEL eXtended Image Sensor Controller
> -	   available as a v4l2 device.
> -
> -	   This driver is deprecated and is scheduled for removal by
> -	   the beginning of 2026. See the TODO file for more information.
> -
> -config VIDEO_ATMEL_ISC_BASE
> -	tristate
> -	default n
> -	help
> -	  ATMEL ISC and XISC common code base.
> diff --git a/drivers/staging/media/deprecated/atmel/Makefile b/drivers/staging/media/deprecated/atmel/Makefile
> deleted file mode 100644
> index 34eaeeac5bba..000000000000
> --- a/drivers/staging/media/deprecated/atmel/Makefile
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -# SPDX-License-Identifier: GPL-2.0-only
> -atmel-isc-objs = atmel-sama5d2-isc.o
> -atmel-xisc-objs = atmel-sama7g5-isc.o
> -atmel-isc-common-objs = atmel-isc-base.o atmel-isc-clk.o
> -
> -obj-$(CONFIG_VIDEO_ATMEL_ISC_BASE) += atmel-isc-common.o
> -obj-$(CONFIG_VIDEO_ATMEL_ISC) += atmel-isc.o
> -obj-$(CONFIG_VIDEO_ATMEL_XISC) += atmel-xisc.o
> --
> 2.43.0
> 
> 
> 


^ permalink raw reply

* Re: [PATCH 10/16] media: sun6i-csi: Add support for MC-centric format enumeration
From: arash golgol @ 2026-05-27 11:53 UTC (permalink / raw)
  To: Paul Kocialkowski
  Cc: linux-media, linux-arm-kernel, linux-sunxi, linux-kernel,
	linux-staging, Mauro Carvalho Chehab, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Greg Kroah-Hartman,
	Laurent Pinchart, Nicolas Dufresne
In-Reply-To: <ahakVq7Fv78ODicG@shepard>

Hi Paul,

On Wed, May 27, 2026 at 11:29 AM Paul Kocialkowski <paulk@sys-base.io> wrote:
>
> Hi Arash,
>
> On Wed 27 May 26, 09:20, arash golgol wrote:
> > On Mon, May 18, 2026 at 2:00 PM Paul Kocialkowski <paulk@sys-base.io> wrote:
> > >
> > > Use the dedicated helper to check possible pixelformats against the
> > > provided mbus code in order to support MC-centric format enumeration.
> > >
> > > Note that multiple pixelformats may be returned for a given mbus code.
> > >
> > > Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
> > > ---
> > >  .../sunxi/sun6i-csi/sun6i_csi_capture.c       | 38 +++++++++++++++++--
> > >  1 file changed, 34 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c
> > > index a836fa7f081a..409c28621093 100644
> > > --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c
> > > +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c
> > > @@ -773,14 +773,43 @@ static int sun6i_csi_capture_querycap(struct file *file, void *priv,
> > >  static int sun6i_csi_capture_enum_fmt(struct file *file, void *priv,
> > >                                       struct v4l2_fmtdesc *fmtdesc)
> > >  {
> > > +       const struct sun6i_csi_capture_format *capture_format;
> > > +       const struct sun6i_csi_bridge_format *bridge_format;
> > > +       u32 mbus_code = fmtdesc->mbus_code;
> > >         u32 index = fmtdesc->index;
> > > +       unsigned int index_valid = 0;
> > > +       unsigned int i;
> > > +
> > > +       /* Video-node-centric enumeration. */
> > > +       if (!mbus_code) {
> > > +               if (index >= ARRAY_SIZE(sun6i_csi_capture_formats))
> > > +                       return -EINVAL;
> > > +
> > > +               fmtdesc->pixelformat =
> > > +                       sun6i_csi_capture_formats[index].pixelformat;
> > > +               return 0;
> > > +       }
> > >
> > > -       if (index >= ARRAY_SIZE(sun6i_csi_capture_formats))
> > > +       bridge_format = sun6i_csi_bridge_format_find(mbus_code);
> > > +       if (!bridge_format)
> > >                 return -EINVAL;
> > >
> > > -       fmtdesc->pixelformat = sun6i_csi_capture_formats[index].pixelformat;
> > > +       for (i = 0; i < ARRAY_SIZE(sun6i_csi_capture_formats); i++) {
> > > +               capture_format = &sun6i_csi_capture_formats[i];
> > >
> > > -       return 0;
> > > +               if (!sun6i_csi_capture_format_check(capture_format,
> > > +                                                   bridge_format))
> > > +                       continue;
> > > +
> > > +               if (index_valid == index) {
> > > +                       fmtdesc->pixelformat = capture_format->pixelformat;
> > > +                       return 0;
> > > +               }
> > > +
> > > +               index_valid++;
> > > +       }
> > > +
> > > +       return -EINVAL;
> > >  }
> > >
> > >  static int sun6i_csi_capture_enum_framesize(struct file *file, void *fh,
> > > @@ -1076,7 +1105,8 @@ int sun6i_csi_capture_setup(struct sun6i_csi_device *csi_dev)
> > >
> > >         strscpy(video_dev->name, SUN6I_CSI_CAPTURE_NAME,
> > >                 sizeof(video_dev->name));
> > > -       video_dev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
> > > +       video_dev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
> > > +                                V4L2_CAP_IO_MC;
> > >         video_dev->vfl_dir = VFL_DIR_RX;
> > >         video_dev->release = video_device_release_empty;
> > >         video_dev->fops = &sun6i_csi_capture_fops;
> > > --
> > > 2.54.0
> > >
> >
> > Tested on a LicheePi Zero Dock (V3s) with the following pipeline:
> >
> > ov7670 -> sun6i-csi-bridge -> sun6i-csi-capture
> >
> > I verified that mbus-code-based format enumeration works correctly
> > from userspace and that the reported capture formats change according
> > to the selected media bus format.
> >
> > I could also successfully start streaming with several of the
> > enumerated capture formats (e.g. YUYV and BA81)
>
> Excellent, thank-you very much for testing this!
>

Happy to help.

> > However, I could not fully validate actual format conversion behavior
> > (e.g. MEDIA_BUS_FMT_YUYV8_2X8 to NV12) because my OV7670 setup
> > currently has non-functional test patterns except for 'shifting-1'
> > mode.
>
> That's fine. I don't think I have tested it recently either.
>
> > Tested-by: Arash Golgol <arash.golgol@gmail.com>
> >
> > PS:
> >
> > While testing this patch I also noticed that
> > VIDIOC_SUBDEV_ENUM_MBUS_CODE reports duplicate entries for:
> >  - MEDIA_BUS_FMT_UYVY8_2X8
> >  - MEDIA_BUS_FMT_UYVY8_1X16
> > on sun6i-csi-bridge.
>
> I just had a look and you are definitely right, the entries are clearly
> duplicates and at the same time all the relevant formats are included, so they
> are not taking the place of another format that was forgotten.
>
> You're welcome to submit a patch to remove these entries if you'd like,
> or I could do it otherwise.
>

Thanks, I'll send a small patch to remove the duplicate mbus format entries.

> By the way would you be interested in testing the H.264 encoder support for
> V3/V3s once I send a first version for it? I had written initial support for
> it a while ago (did not send it to the list) and now that my work on the V4L2
> stateless uAPI has reached a point of usability I will probably try to update
> my rework of the cedrus driver to use it.
>

Yes, I would definitely be interested in testing the H.264 encoder
support on V3s once you post it. I previously did some experiments
with Cedrus on V3s (bootlin, cedrus/h264-encoding branch).

Looking forward to it!

-- 
Regards,
Arash Golgol

^ permalink raw reply

* Re: [PATCH v3] staging: media: imx: fix parenthesis ending checks
From: Hans Verkuil @ 2026-05-27  9:12 UTC (permalink / raw)
  To: Mark Adamenko, linux-staging
  Cc: slongerbeam, p.zabel, gregkh, imx, linux-media, linux-kernel
In-Reply-To: <20260310002643.27465-1-marusik.adamenko@gmail.com>

Hi Mark,

On 3/10/26 1:26 AM, Mark Adamenko wrote:
> Remove 4 checks for ending with a parenthesis by removing unnecessary
> line breaks, and forward declare a variable for a function call that
> would otherwise remain over 80 columns.

Sorry, but I'm rejecting this patch: it just swaps one 'problem' 
(parenthesis ending check) with another problem: long lines.

In the end the current version is just more readable, so I'm just 
dropping this patch.

Rejected-by: Hans Verkuil <hverkuil+cisco@kernel.org>

Regards,

	Hans

> 
> Signed-off-by: Mark Adamenko <marusik.adamenko@gmail.com>
> ---
> v3: fix commit message
> ---
> ---
>   drivers/staging/media/imx/imx-ic-prpencvf.c | 16 ++++++----------
>   1 file changed, 6 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/media/imx/imx-ic-prpencvf.c b/drivers/staging/media/imx/imx-ic-prpencvf.c
> index 77360bfe081a..2339b59af7b0 100644
> --- a/drivers/staging/media/imx/imx-ic-prpencvf.c
> +++ b/drivers/staging/media/imx/imx-ic-prpencvf.c
> @@ -315,8 +315,7 @@ static void prp_setup_vb2_buf(struct prp_priv *priv, dma_addr_t *phys)
>   		buf = imx_media_capture_device_next_buf(vdev);
>   		if (buf) {
>   			priv->active_vb2_buf[i] = buf;
> -			phys[i] = vb2_dma_contig_plane_dma_addr(
> -				&buf->vbuf.vb2_buf, 0);
> +			phys[i] = vb2_dma_contig_plane_dma_addr(&buf->vbuf.vb2_buf, 0);
>   		} else {
>   			priv->active_vb2_buf[i] = NULL;
>   			phys[i] = priv->underrun_buf.phys;
> @@ -704,11 +703,9 @@ static int prp_start(struct prp_priv *priv)
>   	}
>   
>   	if (ipu_rot_mode_is_irt(priv->rot_mode))
> -		priv->eof_irq = ipu_idmac_channel_irq(
> -			ic_priv->ipu, priv->rot_out_ch, IPU_IRQ_EOF);
> +		priv->eof_irq = ipu_idmac_channel_irq(ic_priv->ipu, priv->rot_out_ch, IPU_IRQ_EOF);
>   	else
> -		priv->eof_irq = ipu_idmac_channel_irq(
> -			ic_priv->ipu, priv->out_ch, IPU_IRQ_EOF);
> +		priv->eof_irq = ipu_idmac_channel_irq(ic_priv->ipu, priv->out_ch, IPU_IRQ_EOF);
>   
>   	ret = devm_request_irq(ic_priv->ipu_dev, priv->eof_irq,
>   			       prp_eof_interrupt, 0,
> @@ -750,7 +747,7 @@ static int prp_start(struct prp_priv *priv)
>   static void prp_stop(struct prp_priv *priv)
>   {
>   	struct imx_ic_priv *ic_priv = priv->ic_priv;
> -	unsigned long flags;
> +	unsigned long flags, timeout_in_jiffies;
>   	int ret;
>   
>   	/* mark next EOF interrupt as the last before stream off */
> @@ -761,9 +758,8 @@ static void prp_stop(struct prp_priv *priv)
>   	/*
>   	 * and then wait for interrupt handler to mark completion.
>   	 */
> -	ret = wait_for_completion_timeout(
> -		&priv->last_eof_comp,
> -		msecs_to_jiffies(IMX_MEDIA_EOF_TIMEOUT));
> +	timeout_in_jiffies = msecs_to_jiffies(IMX_MEDIA_EOF_TIMEOUT);
> +	ret = wait_for_completion_timeout(&priv->last_eof_comp, timeout_in_jiffies);
>   	if (ret == 0)
>   		v4l2_warn(&ic_priv->sd, "wait last EOF timeout\n");
>   


^ permalink raw reply

* [PATCH v4] staging: media: Remove deprecated Atmel ISC drivers
From: Ashwin Gundarapu @ 2026-05-27  8:33 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, linux-staging, linux-media

The Atmel ISC and XISC drivers were deprecated and scheduled
for removal by the beginning of 2026. The replacement drivers
(VIDEO_MICROCHIP_ISC and VIDEO_MICROCHIP_XISC) are available
in the main media subsystem.

Remove the Kconfig entries, Makefile rules, MAINTAINERS entries,
and the STAGING_MEDIA_DEPRECATED menuconfig since it is no longer
needed. The source files remain on disk but are no longer compiled
since the build infrastructure is removed.

Signed-off-by: Ashwin Gundarapu <linuxuser509@zohomail.in>
---
v3: Updated MAINTAINERS to remove staging/atmel references.
v2: Removed Kconfig and Makefile to fix Media CI build issues.
---
 MAINTAINERS                                   |  2 -
 drivers/staging/media/Kconfig                 | 18 +------
 drivers/staging/media/Makefile                |  1 -
 .../staging/media/deprecated/atmel/Kconfig    | 47 -------------------
 .../staging/media/deprecated/atmel/Makefile   |  8 ----
 5 files changed, 1 insertion(+), 75 deletions(-)
 delete mode 100644 drivers/staging/media/deprecated/atmel/Kconfig
 delete mode 100644 drivers/staging/media/deprecated/atmel/Makefile

diff --git a/MAINTAINERS b/MAINTAINERS
index 27a073f53cea..4290eae8838e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -17364,8 +17364,6 @@ F:	Documentation/devicetree/bindings/media/atmel,isc.yaml
 F:	Documentation/devicetree/bindings/media/microchip,xisc.yaml
 F:	drivers/media/platform/microchip/microchip-isc*
 F:	drivers/media/platform/microchip/microchip-sama*-isc*
-F:	drivers/staging/media/deprecated/atmel/atmel-isc*
-F:	drivers/staging/media/deprecated/atmel/atmel-sama*-isc*
 F:	include/linux/atmel-isc-media.h

 MICROCHIP ISI DRIVER
diff --git a/drivers/staging/media/Kconfig b/drivers/staging/media/Kconfig
index 1aa31bddf970..52b4aab944f6 100644
--- a/drivers/staging/media/Kconfig
+++ b/drivers/staging/media/Kconfig
@@ -38,20 +38,4 @@ source "drivers/staging/media/sunxi/Kconfig"

 source "drivers/staging/media/tegra-video/Kconfig"

-menuconfig STAGING_MEDIA_DEPRECATED
-	bool "Media staging drivers (DEPRECATED)"
-	default n
-	help
-	  This option enables deprecated media drivers that are
-	  scheduled for future removal from the kernel.
-
-	  If you wish to work on these drivers to prevent their removal,
-	  then contact the linux-media@vger.kernel.org mailing list.
-
-	  If in doubt, say N here.
-
-if STAGING_MEDIA_DEPRECATED
-source "drivers/staging/media/deprecated/atmel/Kconfig"
-endif
-
-endif
+endif # STAGING_MEDIA
diff --git a/drivers/staging/media/Makefile b/drivers/staging/media/Makefile
index 6f78b0edde1e..6fd7179733d8 100644
--- a/drivers/staging/media/Makefile
+++ b/drivers/staging/media/Makefile
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_VIDEO_ATMEL_ISC_BASE)	+= deprecated/atmel/
 obj-$(CONFIG_INTEL_ATOMISP)     += atomisp/
 obj-$(CONFIG_VIDEO_IMX_MEDIA)	+= imx/
 obj-$(CONFIG_VIDEO_MAX96712)	+= max96712/
diff --git a/drivers/staging/media/deprecated/atmel/Kconfig b/drivers/staging/media/deprecated/atmel/Kconfig
deleted file mode 100644
index 418841ea5a0d..000000000000
--- a/drivers/staging/media/deprecated/atmel/Kconfig
+++ /dev/null
@@ -1,47 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-
-comment "Atmel media platform drivers"
-
-config VIDEO_ATMEL_ISC
-	tristate "ATMEL Image Sensor Controller (ISC) support (DEPRECATED)"
-	depends on V4L_PLATFORM_DRIVERS
-	depends on VIDEO_DEV && COMMON_CLK
-	depends on ARCH_AT91 || COMPILE_TEST
-	depends on !VIDEO_MICROCHIP_ISC_BASE || COMPILE_TEST
-	select MEDIA_CONTROLLER
-	select VIDEO_V4L2_SUBDEV_API
-	select VIDEOBUF2_DMA_CONTIG
-	select REGMAP_MMIO
-	select V4L2_FWNODE
-	select VIDEO_ATMEL_ISC_BASE
-	help
-	   This module makes the ATMEL Image Sensor Controller available
-	   as a v4l2 device.
-
-	   This driver is deprecated and is scheduled for removal by
-	   the beginning of 2026. See the TODO file for more information.
-
-config VIDEO_ATMEL_XISC
-	tristate "ATMEL eXtended Image Sensor Controller (XISC) support (DEPRECATED)"
-	depends on V4L_PLATFORM_DRIVERS
-	depends on VIDEO_DEV && COMMON_CLK
-	depends on ARCH_AT91 || COMPILE_TEST
-	depends on !VIDEO_MICROCHIP_ISC_BASE || COMPILE_TEST
-	select VIDEOBUF2_DMA_CONTIG
-	select REGMAP_MMIO
-	select V4L2_FWNODE
-	select VIDEO_ATMEL_ISC_BASE
-	select MEDIA_CONTROLLER
-	select VIDEO_V4L2_SUBDEV_API
-	help
-	   This module makes the ATMEL eXtended Image Sensor Controller
-	   available as a v4l2 device.
-
-	   This driver is deprecated and is scheduled for removal by
-	   the beginning of 2026. See the TODO file for more information.
-
-config VIDEO_ATMEL_ISC_BASE
-	tristate
-	default n
-	help
-	  ATMEL ISC and XISC common code base.
diff --git a/drivers/staging/media/deprecated/atmel/Makefile b/drivers/staging/media/deprecated/atmel/Makefile
deleted file mode 100644
index 34eaeeac5bba..000000000000
--- a/drivers/staging/media/deprecated/atmel/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-atmel-isc-objs = atmel-sama5d2-isc.o
-atmel-xisc-objs = atmel-sama7g5-isc.o
-atmel-isc-common-objs = atmel-isc-base.o atmel-isc-clk.o
-
-obj-$(CONFIG_VIDEO_ATMEL_ISC_BASE) += atmel-isc-common.o
-obj-$(CONFIG_VIDEO_ATMEL_ISC) += atmel-isc.o
-obj-$(CONFIG_VIDEO_ATMEL_XISC) += atmel-xisc.o
--
2.43.0



^ permalink raw reply related

* Re: [PATCH] MAINTAINERS: Remove bouncing Intel media maintainers
From: Sakari Ailus @ 2026-05-27  8:10 UTC (permalink / raw)
  To: Dave Hansen
  Cc: linux-kernel, Yong Zhi, Dan Scally, Mauro Carvalho Chehab,
	Greg Kroah-Hartman, Lixu Zhang, linux-media, linux-staging
In-Reply-To: <20260526214131.51118-1-dave.hansen@linux.intel.com>

Hi Dave,

On Tue, May 26, 2026 at 02:41:31PM -0700, Dave Hansen wrote:
> Tianshu Qiu and Bingbu Cao are maintainers and reviewers of a bunch of
> media drivers (7 and 9 respectively). Both of their emails are
> bouncing.
> 
> Remove the bouncing entries and update driver status in cases where
> there are no M:'s left.

I can pick at least some of these. I'll send v2.

-- 
Kind regards,

Sakari Ailus

^ permalink raw reply

* Re: [PATCH v3] media: atomisp: remove redundant prefix from dev_dbg calls
From: Andy Shevchenko @ 2026-05-27  8:05 UTC (permalink / raw)
  To: Jeongin Yeo
  Cc: hansg, mchehab, gregkh, sakari.ailus, andy, matt, linux-media,
	linux-staging, linux-kernel
In-Reply-To: <20260527073705.1544479-1-jeongin.yeo@luaberry.com>

On Wed, May 27, 2026 at 9:37 AM Jeongin Yeo <jeongin.yeo@luaberry.com> wrote:
>
> Remove the hardcoded function name and line number prefix from
> dev_dbg() output strings within ia_css_binary_find(). dev_dbg()
> can already emit the function name and line number via dynamic_debug's
> 'f' and 'l' flags, so embedding it in the format string is redundant.
>
> This resolves the EMBEDDED_FUNCTION_NAME checkpatch warnings without
> introducing __func__ to format strings.
>
> No functional changes.

LGTM,
Reviewed-by: Andy Shevchenko <andy@kernel.org>

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply

* Re: [PATCH 10/16] media: sun6i-csi: Add support for MC-centric format enumeration
From: Paul Kocialkowski @ 2026-05-27  7:59 UTC (permalink / raw)
  To: arash golgol
  Cc: linux-media, linux-arm-kernel, linux-sunxi, linux-kernel,
	linux-staging, Mauro Carvalho Chehab, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Greg Kroah-Hartman,
	Laurent Pinchart, Nicolas Dufresne
In-Reply-To: <CAMxPZkiKBFsPA5x6KpBajGqO5xqxD5AOd26j3uwqnQko1VzknQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 5575 bytes --]

Hi Arash,

On Wed 27 May 26, 09:20, arash golgol wrote:
> On Mon, May 18, 2026 at 2:00 PM Paul Kocialkowski <paulk@sys-base.io> wrote:
> >
> > Use the dedicated helper to check possible pixelformats against the
> > provided mbus code in order to support MC-centric format enumeration.
> >
> > Note that multiple pixelformats may be returned for a given mbus code.
> >
> > Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
> > ---
> >  .../sunxi/sun6i-csi/sun6i_csi_capture.c       | 38 +++++++++++++++++--
> >  1 file changed, 34 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c
> > index a836fa7f081a..409c28621093 100644
> > --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c
> > +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c
> > @@ -773,14 +773,43 @@ static int sun6i_csi_capture_querycap(struct file *file, void *priv,
> >  static int sun6i_csi_capture_enum_fmt(struct file *file, void *priv,
> >                                       struct v4l2_fmtdesc *fmtdesc)
> >  {
> > +       const struct sun6i_csi_capture_format *capture_format;
> > +       const struct sun6i_csi_bridge_format *bridge_format;
> > +       u32 mbus_code = fmtdesc->mbus_code;
> >         u32 index = fmtdesc->index;
> > +       unsigned int index_valid = 0;
> > +       unsigned int i;
> > +
> > +       /* Video-node-centric enumeration. */
> > +       if (!mbus_code) {
> > +               if (index >= ARRAY_SIZE(sun6i_csi_capture_formats))
> > +                       return -EINVAL;
> > +
> > +               fmtdesc->pixelformat =
> > +                       sun6i_csi_capture_formats[index].pixelformat;
> > +               return 0;
> > +       }
> >
> > -       if (index >= ARRAY_SIZE(sun6i_csi_capture_formats))
> > +       bridge_format = sun6i_csi_bridge_format_find(mbus_code);
> > +       if (!bridge_format)
> >                 return -EINVAL;
> >
> > -       fmtdesc->pixelformat = sun6i_csi_capture_formats[index].pixelformat;
> > +       for (i = 0; i < ARRAY_SIZE(sun6i_csi_capture_formats); i++) {
> > +               capture_format = &sun6i_csi_capture_formats[i];
> >
> > -       return 0;
> > +               if (!sun6i_csi_capture_format_check(capture_format,
> > +                                                   bridge_format))
> > +                       continue;
> > +
> > +               if (index_valid == index) {
> > +                       fmtdesc->pixelformat = capture_format->pixelformat;
> > +                       return 0;
> > +               }
> > +
> > +               index_valid++;
> > +       }
> > +
> > +       return -EINVAL;
> >  }
> >
> >  static int sun6i_csi_capture_enum_framesize(struct file *file, void *fh,
> > @@ -1076,7 +1105,8 @@ int sun6i_csi_capture_setup(struct sun6i_csi_device *csi_dev)
> >
> >         strscpy(video_dev->name, SUN6I_CSI_CAPTURE_NAME,
> >                 sizeof(video_dev->name));
> > -       video_dev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
> > +       video_dev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
> > +                                V4L2_CAP_IO_MC;
> >         video_dev->vfl_dir = VFL_DIR_RX;
> >         video_dev->release = video_device_release_empty;
> >         video_dev->fops = &sun6i_csi_capture_fops;
> > --
> > 2.54.0
> >
> 
> Tested on a LicheePi Zero Dock (V3s) with the following pipeline:
> 
> ov7670 -> sun6i-csi-bridge -> sun6i-csi-capture
> 
> I verified that mbus-code-based format enumeration works correctly
> from userspace and that the reported capture formats change according
> to the selected media bus format.
> 
> I could also successfully start streaming with several of the
> enumerated capture formats (e.g. YUYV and BA81)

Excellent, thank-you very much for testing this!

> However, I could not fully validate actual format conversion behavior
> (e.g. MEDIA_BUS_FMT_YUYV8_2X8 to NV12) because my OV7670 setup
> currently has non-functional test patterns except for 'shifting-1'
> mode.

That's fine. I don't think I have tested it recently either.

> Tested-by: Arash Golgol <arash.golgol@gmail.com>
> 
> PS:
> 
> While testing this patch I also noticed that
> VIDIOC_SUBDEV_ENUM_MBUS_CODE reports duplicate entries for:
>  - MEDIA_BUS_FMT_UYVY8_2X8
>  - MEDIA_BUS_FMT_UYVY8_1X16
> on sun6i-csi-bridge.

I just had a look and you are definitely right, the entries are clearly
duplicates and at the same time all the relevant formats are included, so they
are not taking the place of another format that was forgotten.

You're welcome to submit a patch to remove these entries if you'd like,
or I could do it otherwise.

By the way would you be interested in testing the H.264 encoder support for
V3/V3s once I send a first version for it? I had written initial support for
it a while ago (did not send it to the list) and now that my work on the V4L2
stateless uAPI has reached a point of usability I will probably try to update
my rework of the cedrus driver to use it.

All the best,

Paul

> This appears to come from duplicate format entries being exposed by
> the bridge driver.
> 
> -- 
> Regards,
> Arash Golgol

-- 
Paul Kocialkowski,

Independent contractor - sys-base - https://www.sys-base.io/
Free software developer - https://www.paulk.fr/

Expert in multimedia, graphics and embedded hardware support with Linux.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* [PATCH v3] media: atomisp: remove redundant prefix from dev_dbg calls
From: Jeongin Yeo @ 2026-05-27  7:37 UTC (permalink / raw)
  To: hansg, mchehab
  Cc: gregkh, sakari.ailus, andy.shevchenko, andy, matt, linux-media,
	linux-staging, linux-kernel, Jeongin Yeo

Remove the hardcoded function name and line number prefix from
dev_dbg() output strings within ia_css_binary_find(). dev_dbg()
can already emit the function name and line number via dynamic_debug's
'f' and 'l' flags, so embedding it in the format string is redundant.

This resolves the EMBEDDED_FUNCTION_NAME checkpatch warnings without
introducing __func__ to format strings.

No functional changes.

Signed-off-by: Jeongin Yeo <jeongin.yeo@luaberry.com>
---
Changes in v3:
- Remove the __LINE__ argument and "[%d]" prefix from dev_dbg() calls.
  Like __func__, line numbers are provided by dynamic_debug via the 'l' flag.
- Link to v2: https://lore.kernel.org/r/20260526200222.330280-1-jeongin.yeo@luaberry.com

Changes in v2:
- Remove the function name strings entirely instead of converting
  them to __func__, per feedback from Greg KH. dev_dbg() can already
  emit function names via dynamic_debug's 'f' flag.
- Link to v1: https://lore.kernel.org/r/20260526104750.1284935-1-jeongin.yeo@luaberry.com

 .../atomisp/pci/runtime/binary/src/binary.c   | 133 ++++++++----------
 1 file changed, 58 insertions(+), 75 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c b/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c
index e9016d7775dc3..ef766a02b460b 100644
--- a/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c
+++ b/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c
@@ -925,7 +925,7 @@ int ia_css_binary_find(struct ia_css_binary_descr *descr, struct ia_css_binary *
 	/* MW: used after an error check, may accept NULL, but doubtful */
 	assert(binary);
 
-	dev_dbg(atomisp_dev, "ia_css_binary_find() enter: descr=%p, (mode=%d), binary=%p\n",
+	dev_dbg(atomisp_dev, "enter: descr=%p, (mode=%d), binary=%p\n",
 		descr, descr->mode, binary);
 
 	mode = descr->mode;
@@ -991,8 +991,7 @@ int ia_css_binary_find(struct ia_css_binary_descr *descr, struct ia_css_binary *
 		struct ia_css_binary_info *candidate = &xcandidate->sp;
 		/* printf("sh_css_binary_find: evaluating candidate:
 		 * %d\n",candidate->id); */
-		dev_dbg(atomisp_dev,
-			"ia_css_binary_find() candidate = %p, mode = %d ID = %d\n",
+		dev_dbg(atomisp_dev, "candidate = %p, mode = %d ID = %d\n",
 			candidate, candidate->pipeline.mode, candidate->id);
 
 		/*
@@ -1002,16 +1001,13 @@ int ia_css_binary_find(struct ia_css_binary_descr *descr, struct ia_css_binary *
 		*/
 		if (!candidate->enable.continuous &&
 		    continuous && (mode != IA_CSS_BINARY_MODE_COPY)) {
-			dev_dbg(atomisp_dev,
-				"ia_css_binary_find() [%d] continue: !%d && %d && (%d != %d)\n",
-				__LINE__, candidate->enable.continuous,
-				continuous, mode, IA_CSS_BINARY_MODE_COPY);
+			dev_dbg(atomisp_dev, "continue: !%d && %d && (%d != %d)\n",
+				candidate->enable.continuous, continuous,
+				mode, IA_CSS_BINARY_MODE_COPY);
 			continue;
 		}
 		if (striped && candidate->iterator.num_stripes == 1) {
-			dev_dbg(atomisp_dev,
-				"ia_css_binary_find() [%d] continue: binary is not striped\n",
-				__LINE__);
+			dev_dbg(atomisp_dev, "continue: binary is not striped\n");
 			continue;
 		}
 
@@ -1019,38 +1015,38 @@ int ia_css_binary_find(struct ia_css_binary_descr *descr, struct ia_css_binary *
 		    (mode != IA_CSS_BINARY_MODE_COPY) &&
 		    (mode != IA_CSS_BINARY_MODE_CAPTURE_PP) &&
 		    (mode != IA_CSS_BINARY_MODE_VF_PP)) {
-			dev_dbg(atomisp_dev, "ia_css_binary_find() [%d] continue: (%d != %d)\n",
-				__LINE__, candidate->pipeline.isp_pipe_version, isp_pipe_version);
+			dev_dbg(atomisp_dev, "continue: (%d != %d)\n",
+				candidate->pipeline.isp_pipe_version, isp_pipe_version);
 			continue;
 		}
 		if (!candidate->enable.reduced_pipe && enable_reduced_pipe) {
-			dev_dbg(atomisp_dev, "ia_css_binary_find() [%d] continue: !%d && %d\n",
-				__LINE__, candidate->enable.reduced_pipe, enable_reduced_pipe);
+			dev_dbg(atomisp_dev, "continue: !%d && %d\n",
+				candidate->enable.reduced_pipe, enable_reduced_pipe);
 			continue;
 		}
 		if (!candidate->enable.dvs_6axis && enable_dvs_6axis) {
-			dev_dbg(atomisp_dev, "ia_css_binary_find() [%d] continue: !%d && %d\n",
-				__LINE__, candidate->enable.dvs_6axis, enable_dvs_6axis);
+			dev_dbg(atomisp_dev, "continue: !%d && %d\n",
+				candidate->enable.dvs_6axis, enable_dvs_6axis);
 			continue;
 		}
 		if (candidate->enable.high_speed && !enable_high_speed) {
-			dev_dbg(atomisp_dev, "ia_css_binary_find() [%d] continue: %d && !%d\n",
-				__LINE__, candidate->enable.high_speed, enable_high_speed);
+			dev_dbg(atomisp_dev, "continue: %d && !%d\n",
+				candidate->enable.high_speed, enable_high_speed);
 			continue;
 		}
 		if (!candidate->enable.xnr && need_xnr) {
-			dev_dbg(atomisp_dev, "ia_css_binary_find() [%d] continue: %d && !%d\n",
-				__LINE__, candidate->enable.xnr, need_xnr);
+			dev_dbg(atomisp_dev, "continue: %d && !%d\n",
+				candidate->enable.xnr, need_xnr);
 			continue;
 		}
 		if (!(candidate->enable.ds & 2) && enable_yuv_ds) {
-			dev_dbg(atomisp_dev, "ia_css_binary_find() [%d] continue: !%d && %d\n",
-				__LINE__, ((candidate->enable.ds & 2) != 0), enable_yuv_ds);
+			dev_dbg(atomisp_dev, "continue: !%d && %d\n",
+				((candidate->enable.ds & 2) != 0), enable_yuv_ds);
 			continue;
 		}
 		if ((candidate->enable.ds & 2) && !enable_yuv_ds) {
-			dev_dbg(atomisp_dev, "ia_css_binary_find() [%d] continue: %d && !%d\n",
-				__LINE__, ((candidate->enable.ds & 2) != 0), enable_yuv_ds);
+			dev_dbg(atomisp_dev, "continue: %d && !%d\n",
+				((candidate->enable.ds & 2) != 0), enable_yuv_ds);
 			continue;
 		}
 
@@ -1064,85 +1060,77 @@ int ia_css_binary_find(struct ia_css_binary_descr *descr, struct ia_css_binary *
 				       candidate->vf_dec.is_variable ||
 				       /* or more than one output pin. */
 				       xcandidate->num_output_pins > 1)) {
-			dev_dbg(atomisp_dev,
-				"ia_css_binary_find() [%d] continue: (%p != NULL) && !(%d || %d || (%d >%d))\n",
-				__LINE__, req_vf_info, candidate->enable.vf_veceven,
+			dev_dbg(atomisp_dev, "continue: (%p != NULL) && !(%d || %d || (%d >%d))\n",
+				req_vf_info, candidate->enable.vf_veceven,
 				candidate->vf_dec.is_variable, xcandidate->num_output_pins, 1);
 			continue;
 		}
 		if (!candidate->enable.dvs_envelope && need_dvs) {
-			dev_dbg(atomisp_dev, "ia_css_binary_find() [%d] continue: !%d && %d\n",
-				__LINE__, candidate->enable.dvs_envelope, (int)need_dvs);
+			dev_dbg(atomisp_dev, "continue: !%d && %d\n",
+				candidate->enable.dvs_envelope, (int)need_dvs);
 			continue;
 		}
 		/* internal_res check considers input, output, and dvs envelope sizes */
 		ia_css_binary_internal_res(req_in_info, req_bds_out_info,
 					   req_bin_out_info, &dvs_env, candidate, &internal_res);
 		if (internal_res.width > candidate->internal.max_width) {
-			dev_dbg(atomisp_dev, "ia_css_binary_find() [%d] continue: (%d > %d)\n",
-				__LINE__, internal_res.width, candidate->internal.max_width);
+			dev_dbg(atomisp_dev, "continue: (%d > %d)\n",
+				internal_res.width, candidate->internal.max_width);
 			continue;
 		}
 		if (internal_res.height > candidate->internal.max_height) {
-			dev_dbg(atomisp_dev, "ia_css_binary_find() [%d] continue: (%d > %d)\n",
-				__LINE__, internal_res.height, candidate->internal.max_height);
+			dev_dbg(atomisp_dev, "continue: (%d > %d)\n",
+				internal_res.height, candidate->internal.max_height);
 			continue;
 		}
 		if (!candidate->enable.ds && need_ds && !(xcandidate->num_output_pins > 1)) {
-			dev_dbg(atomisp_dev, "ia_css_binary_find() [%d] continue: !%d && %d\n",
-				__LINE__, candidate->enable.ds, (int)need_ds);
+			dev_dbg(atomisp_dev, "continue: !%d && %d\n",
+				candidate->enable.ds, (int)need_ds);
 			continue;
 		}
 		if (!candidate->enable.uds && !candidate->enable.dvs_6axis && need_dz) {
-			dev_dbg(atomisp_dev,
-				"ia_css_binary_find() [%d] continue: !%d && !%d && %d\n",
-				__LINE__, candidate->enable.uds, candidate->enable.dvs_6axis,
+			dev_dbg(atomisp_dev, "continue: !%d && !%d && %d\n",
+				candidate->enable.uds, candidate->enable.dvs_6axis,
 				(int)need_dz);
 			continue;
 		}
 		if (online && candidate->input.source == IA_CSS_BINARY_INPUT_MEMORY) {
-			dev_dbg(atomisp_dev,
-				"ia_css_binary_find() [%d] continue: %d && (%d == %d)\n",
-				__LINE__, online, candidate->input.source,
+			dev_dbg(atomisp_dev, "continue: %d && (%d == %d)\n",
+				online, candidate->input.source,
 				IA_CSS_BINARY_INPUT_MEMORY);
 			continue;
 		}
 		if (!online && candidate->input.source == IA_CSS_BINARY_INPUT_SENSOR) {
-			dev_dbg(atomisp_dev,
-				"ia_css_binary_find() [%d] continue: !%d && (%d == %d)\n",
-				__LINE__, online, candidate->input.source,
+			dev_dbg(atomisp_dev, "continue: !%d && (%d == %d)\n",
+				online, candidate->input.source,
 				IA_CSS_BINARY_INPUT_SENSOR);
 			continue;
 		}
 		if (req_bin_out_info->res.width < candidate->output.min_width ||
 		    req_bin_out_info->res.width > candidate->output.max_width) {
-			dev_dbg(atomisp_dev,
-				"ia_css_binary_find() [%d] continue: (%d > %d) || (%d < %d)\n",
-				__LINE__, req_bin_out_info->padded_width,
-				candidate->output.min_width, req_bin_out_info->padded_width,
-				candidate->output.max_width);
+			dev_dbg(atomisp_dev, "continue: (%d > %d) || (%d < %d)\n",
+				req_bin_out_info->padded_width, candidate->output.min_width,
+				req_bin_out_info->padded_width, candidate->output.max_width);
 			continue;
 		}
 		if (xcandidate->num_output_pins > 1 &&
 		    /* in case we have a second output pin, */
 		    req_vf_info) { /* and we need vf output. */
 			if (req_vf_info->res.width > candidate->output.max_width) {
-				dev_dbg(atomisp_dev,
-					"ia_css_binary_find() [%d] continue: (%d < %d)\n",
-					__LINE__, req_vf_info->res.width,
-					candidate->output.max_width);
+				dev_dbg(atomisp_dev, "continue: (%d < %d)\n",
+					req_vf_info->res.width, candidate->output.max_width);
 				continue;
 			}
 		}
 		if (req_in_info->padded_width > candidate->input.max_width) {
-			dev_dbg(atomisp_dev, "ia_css_binary_find() [%d] continue: (%d > %d)\n",
-				__LINE__, req_in_info->padded_width, candidate->input.max_width);
+			dev_dbg(atomisp_dev, "continue: (%d > %d)\n",
+				req_in_info->padded_width, candidate->input.max_width);
 			continue;
 		}
 		if (!binary_supports_output_format(xcandidate, req_bin_out_info->format)) {
-			dev_dbg(atomisp_dev, "ia_css_binary_find() [%d] continue: !%d\n",
-				__LINE__, binary_supports_output_format(xcandidate,
-									req_bin_out_info->format));
+			dev_dbg(atomisp_dev, "continue: !%d\n",
+				binary_supports_output_format(xcandidate,
+							      req_bin_out_info->format));
 			continue;
 		}
 		if (xcandidate->num_output_pins > 1 &&
@@ -1151,9 +1139,8 @@ int ia_css_binary_find(struct ia_css_binary_descr *descr, struct ia_css_binary *
 		    /* check if the required vf format
 		    is supported. */
 		    !binary_supports_output_format(xcandidate, req_vf_info->format)) {
-			dev_dbg(atomisp_dev,
-				"ia_css_binary_find() [%d] continue: (%d > %d) && (%p != NULL) && !%d\n",
-				__LINE__, xcandidate->num_output_pins, 1, req_vf_info,
+			dev_dbg(atomisp_dev, "continue: (%d > %d) && (%p != NULL) && !%d\n",
+				xcandidate->num_output_pins, 1, req_vf_info,
 				binary_supports_output_format(xcandidate, req_vf_info->format));
 			continue;
 		}
@@ -1162,9 +1149,8 @@ int ia_css_binary_find(struct ia_css_binary_descr *descr, struct ia_css_binary *
 		if (xcandidate->num_output_pins == 1 &&
 		    req_vf_info && candidate->enable.vf_veceven &&
 		    !binary_supports_vf_format(xcandidate, req_vf_info->format)) {
-			dev_dbg(atomisp_dev,
-				"ia_css_binary_find() [%d] continue: (%d == %d) && (%p != NULL) && %d && !%d\n",
-				__LINE__, xcandidate->num_output_pins, 1,
+			dev_dbg(atomisp_dev, "continue: (%d == %d) && (%p != NULL) && %d && !%d\n",
+				xcandidate->num_output_pins, 1,
 				req_vf_info, candidate->enable.vf_veceven,
 				binary_supports_vf_format(xcandidate, req_vf_info->format));
 			continue;
@@ -1174,31 +1160,28 @@ int ia_css_binary_find(struct ia_css_binary_descr *descr, struct ia_css_binary *
 		if (xcandidate->num_output_pins == 1 &&
 		    req_vf_info && candidate->enable.vf_veceven) { /* and we need vf output. */
 			if (req_vf_info->res.width > candidate->output.max_width) {
-				dev_dbg(atomisp_dev,
-					"ia_css_binary_find() [%d] continue: (%d < %d)\n",
-					__LINE__, req_vf_info->res.width,
-					candidate->output.max_width);
+				dev_dbg(atomisp_dev, "continue: (%d < %d)\n",
+					req_vf_info->res.width, candidate->output.max_width);
 				continue;
 			}
 		}
 
 		if (!supports_bds_factor(candidate->bds.supported_bds_factors,
 					 descr->required_bds_factor)) {
-			dev_dbg(atomisp_dev, "ia_css_binary_find() [%d] continue: 0x%x & 0x%x)\n",
-				__LINE__, candidate->bds.supported_bds_factors,
-				descr->required_bds_factor);
+			dev_dbg(atomisp_dev, "continue: 0x%x & 0x%x)\n",
+				candidate->bds.supported_bds_factors, descr->required_bds_factor);
 			continue;
 		}
 
 		if (!candidate->enable.dpc && need_dpc) {
-			dev_dbg(atomisp_dev, "ia_css_binary_find() [%d] continue: 0x%x & 0x%x)\n",
-				__LINE__, candidate->enable.dpc, descr->enable_dpc);
+			dev_dbg(atomisp_dev, "continue: 0x%x & 0x%x)\n",
+				candidate->enable.dpc, descr->enable_dpc);
 			continue;
 		}
 
 		if (candidate->uds.use_bci && enable_capture_pp_bli) {
-			dev_dbg(atomisp_dev, "ia_css_binary_find() [%d] continue: 0x%x & 0x%x)\n",
-				__LINE__, candidate->uds.use_bci, descr->enable_capture_pp_bli);
+			dev_dbg(atomisp_dev, "continue: 0x%x & 0x%x)\n",
+				candidate->uds.use_bci, descr->enable_capture_pp_bli);
 			continue;
 		}
 
-- 
2.43.0


^ permalink raw reply related

* Re: [PATCH v2] media: atomisp: remove function name from dev_dbg calls
From: Jeongin Yeo @ 2026-05-27  7:26 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: hansg, mchehab, Greg KH, sakari.ailus, andy, matt, linux-media,
	linux-staging, linux-kernel
In-Reply-To: <CAHp75Ve5Kntx5+mpr2hZCcFWda7GDUgME_G6c=1kRJJsYGt7eA@mail.gmail.com>

On Wed, May 27, 2026, at 2:26 PM, Andy Shevchenko wrote:
> __LINE__ is also provided.

You're right, __LINE__ is also redundant in dev_dbg().
I will send v3 shortly that removes both the function name and the line number.

Thanks for the review.

-- 
Best regards,
Jeongin Yeo

^ permalink raw reply

* Re: [PATCH 10/16] media: sun6i-csi: Add support for MC-centric format enumeration
From: arash golgol @ 2026-05-27  5:50 UTC (permalink / raw)
  To: Paul Kocialkowski
  Cc: linux-media, linux-arm-kernel, linux-sunxi, linux-kernel,
	linux-staging, Mauro Carvalho Chehab, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Greg Kroah-Hartman,
	Laurent Pinchart, Nicolas Dufresne
In-Reply-To: <20260518102451.417971-11-paulk@sys-base.io>

Hi Paul,

On Mon, May 18, 2026 at 2:00 PM Paul Kocialkowski <paulk@sys-base.io> wrote:
>
> Use the dedicated helper to check possible pixelformats against the
> provided mbus code in order to support MC-centric format enumeration.
>
> Note that multiple pixelformats may be returned for a given mbus code.
>
> Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
> ---
>  .../sunxi/sun6i-csi/sun6i_csi_capture.c       | 38 +++++++++++++++++--
>  1 file changed, 34 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c
> index a836fa7f081a..409c28621093 100644
> --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c
> +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c
> @@ -773,14 +773,43 @@ static int sun6i_csi_capture_querycap(struct file *file, void *priv,
>  static int sun6i_csi_capture_enum_fmt(struct file *file, void *priv,
>                                       struct v4l2_fmtdesc *fmtdesc)
>  {
> +       const struct sun6i_csi_capture_format *capture_format;
> +       const struct sun6i_csi_bridge_format *bridge_format;
> +       u32 mbus_code = fmtdesc->mbus_code;
>         u32 index = fmtdesc->index;
> +       unsigned int index_valid = 0;
> +       unsigned int i;
> +
> +       /* Video-node-centric enumeration. */
> +       if (!mbus_code) {
> +               if (index >= ARRAY_SIZE(sun6i_csi_capture_formats))
> +                       return -EINVAL;
> +
> +               fmtdesc->pixelformat =
> +                       sun6i_csi_capture_formats[index].pixelformat;
> +               return 0;
> +       }
>
> -       if (index >= ARRAY_SIZE(sun6i_csi_capture_formats))
> +       bridge_format = sun6i_csi_bridge_format_find(mbus_code);
> +       if (!bridge_format)
>                 return -EINVAL;
>
> -       fmtdesc->pixelformat = sun6i_csi_capture_formats[index].pixelformat;
> +       for (i = 0; i < ARRAY_SIZE(sun6i_csi_capture_formats); i++) {
> +               capture_format = &sun6i_csi_capture_formats[i];
>
> -       return 0;
> +               if (!sun6i_csi_capture_format_check(capture_format,
> +                                                   bridge_format))
> +                       continue;
> +
> +               if (index_valid == index) {
> +                       fmtdesc->pixelformat = capture_format->pixelformat;
> +                       return 0;
> +               }
> +
> +               index_valid++;
> +       }
> +
> +       return -EINVAL;
>  }
>
>  static int sun6i_csi_capture_enum_framesize(struct file *file, void *fh,
> @@ -1076,7 +1105,8 @@ int sun6i_csi_capture_setup(struct sun6i_csi_device *csi_dev)
>
>         strscpy(video_dev->name, SUN6I_CSI_CAPTURE_NAME,
>                 sizeof(video_dev->name));
> -       video_dev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
> +       video_dev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
> +                                V4L2_CAP_IO_MC;
>         video_dev->vfl_dir = VFL_DIR_RX;
>         video_dev->release = video_device_release_empty;
>         video_dev->fops = &sun6i_csi_capture_fops;
> --
> 2.54.0
>

Tested on a LicheePi Zero Dock (V3s) with the following pipeline:

ov7670 -> sun6i-csi-bridge -> sun6i-csi-capture

I verified that mbus-code-based format enumeration works correctly
from userspace and that the reported capture formats change according
to the selected media bus format.

I could also successfully start streaming with several of the
enumerated capture formats (e.g. YUYV and BA81)

However, I could not fully validate actual format conversion behavior
(e.g. MEDIA_BUS_FMT_YUYV8_2X8 to NV12) because my OV7670 setup
currently has non-functional test patterns except for 'shifting-1'
mode.

Tested-by: Arash Golgol <arash.golgol@gmail.com>

PS:

While testing this patch I also noticed that
VIDIOC_SUBDEV_ENUM_MBUS_CODE reports duplicate entries for:
 - MEDIA_BUS_FMT_UYVY8_2X8
 - MEDIA_BUS_FMT_UYVY8_1X16
on sun6i-csi-bridge.

This appears to come from duplicate format entries being exposed by
the bridge driver.

-- 
Regards,
Arash Golgol

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox