[8/8] media: ov2740: remove NULL reg_write callback

Message ID 20260715175229.24672-9-linkmauve@linkmauve.fr (mailing list archive)
State New
Headers
Series nvmem: make reg_write() take a const void * |

Commit Message

Link Mauve July 15, 2026, 5:52 p.m. UTC
This field is already initialized to NULL, so there is no reason to
write it again.

This prevents it from appearing while grepping for reg_write in the
future.

Signed-off-by: Link Mauve <linkmauve@linkmauve.fr>
---
 drivers/media/i2c/ov2740.c | 1 -
 1 file changed, 1 deletion(-)
  

Comments

sashiko-bot@kernel.org July 15, 2026, 6:07 p.m. UTC | #1
> This field is already initialized to NULL, so there is no reason to
> write it again.
> 
> This prevents it from appearing while grepping for reg_write in the
> future.
> 
> Signed-off-by: Link Mauve <linkmauve@linkmauve.fr>

Sashiko has reviewed this patch and found no issues. It looks great!
  
Sakari Ailus July 20, 2026, 9:39 a.m. UTC | #2
Hi,

On Wed, Jul 15, 2026 at 07:52:24PM +0200, Link Mauve wrote:
> This field is already initialized to NULL, so there is no reason to
> write it again.
> 
> This prevents it from appearing while grepping for reg_write in the
> future.
> 
> Signed-off-by: Link Mauve <linkmauve@linkmauve.fr>

I believe we need a real name here.

> ---
>  drivers/media/i2c/ov2740.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/ov2740.c b/drivers/media/i2c/ov2740.c
> index fb590dfadda1..799eca4023da 100644
> --- a/drivers/media/i2c/ov2740.c
> +++ b/drivers/media/i2c/ov2740.c
> @@ -1271,7 +1271,6 @@ static int ov2740_register_nvmem(struct i2c_client *client,
>  	nvmem_config.compat = true;
>  	nvmem_config.base_dev = dev;
>  	nvmem_config.reg_read = ov2740_nvmem_read;
> -	nvmem_config.reg_write = NULL;
>  	nvmem_config.priv = nvm;
>  	nvmem_config.stride = 1;
>  	nvmem_config.word_size = 1;

I think it'd be nicer to do the initialisation in variable declaration --
all the information is available already there.
  
johannes.goede@oss.qualcomm.com July 20, 2026, 10:34 a.m. UTC | #3
Hi Sakari,

On 20-Jul-26 11:39, Sakari Ailus wrote:
> Hi,
> 
> On Wed, Jul 15, 2026 at 07:52:24PM +0200, Link Mauve wrote:
>> This field is already initialized to NULL, so there is no reason to
>> write it again.
>>
>> This prevents it from appearing while grepping for reg_write in the
>> future.
>>
>> Signed-off-by: Link Mauve <linkmauve@linkmauve.fr>
> 
> I believe we need a real name here.

We don't need a real name / official name here, just a "known identity",
IOW not "anonoymous1234" since Link has clearly is using Link Mauve as
their internet identity (given they went through the trouble of
registering it as a domain) I believe the S-o-b here is fine as is.

See: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d4563201f33a022fc0353033d9dfeb1606a88330
where the "real name" policy was weakened to "known identity".

Regards,

Hans



> 
>> ---
>>  drivers/media/i2c/ov2740.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/drivers/media/i2c/ov2740.c b/drivers/media/i2c/ov2740.c
>> index fb590dfadda1..799eca4023da 100644
>> --- a/drivers/media/i2c/ov2740.c
>> +++ b/drivers/media/i2c/ov2740.c
>> @@ -1271,7 +1271,6 @@ static int ov2740_register_nvmem(struct i2c_client *client,
>>  	nvmem_config.compat = true;
>>  	nvmem_config.base_dev = dev;
>>  	nvmem_config.reg_read = ov2740_nvmem_read;
>> -	nvmem_config.reg_write = NULL;
>>  	nvmem_config.priv = nvm;
>>  	nvmem_config.stride = 1;
>>  	nvmem_config.word_size = 1;
> 
> I think it'd be nicer to do the initialisation in variable declaration --
> all the information is available already there.
>
  
Sakari Ailus July 20, 2026, 11:05 a.m. UTC | #4
Hi Hans,

On Mon, Jul 20, 2026 at 12:34:10PM +0200, johannes.goede@oss.qualcomm.com wrote:
> Hi Sakari,
> 
> On 20-Jul-26 11:39, Sakari Ailus wrote:
> > Hi,
> > 
> > On Wed, Jul 15, 2026 at 07:52:24PM +0200, Link Mauve wrote:
> >> This field is already initialized to NULL, so there is no reason to
> >> write it again.
> >>
> >> This prevents it from appearing while grepping for reg_write in the
> >> future.
> >>
> >> Signed-off-by: Link Mauve <linkmauve@linkmauve.fr>
> > 
> > I believe we need a real name here.
> 
> We don't need a real name / official name here, just a "known identity",
> IOW not "anonoymous1234" since Link has clearly is using Link Mauve as
> their internet identity (given they went through the trouble of
> registering it as a domain) I believe the S-o-b here is fine as is.
> 
> See: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d4563201f33a022fc0353033d9dfeb1606a88330
> where the "real name" policy was weakened to "known identity".

Ack, thanks for pointing that out!
  

Patch

diff --git a/drivers/media/i2c/ov2740.c b/drivers/media/i2c/ov2740.c
index fb590dfadda1..799eca4023da 100644
--- a/drivers/media/i2c/ov2740.c
+++ b/drivers/media/i2c/ov2740.c
@@ -1271,7 +1271,6 @@  static int ov2740_register_nvmem(struct i2c_client *client,
 	nvmem_config.compat = true;
 	nvmem_config.base_dev = dev;
 	nvmem_config.reg_read = ov2740_nvmem_read;
-	nvmem_config.reg_write = NULL;
 	nvmem_config.priv = nvm;
 	nvmem_config.stride = 1;
 	nvmem_config.word_size = 1;