diff mbox series

[2/2] accel/ivpu: avoid duplciate assignment

Message ID 20230126163804.3648051-2-arnd@kernel.org (mailing list archive)
State New, archived
Headers show
Series [1/2] accep/ivpu: PM: remove broken ivpu_dbg() statements | expand

Commit Message

Arnd Bergmann Jan. 26, 2023, 4:37 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

With extra warnings enabled, gcc warns about two assignments
of the same .mmap callback:

In file included from drivers/accel/ivpu/ivpu_drv.c:10:
include/drm/drm_accel.h:31:27: error: initialized field overwritten [-Werror=override-init]
   31 |         .mmap           = drm_gem_mmap
      |                           ^~~~~~~~~~~~
drivers/accel/ivpu/ivpu_drv.c:360:9: note: in expansion of macro 'DRM_ACCEL_FOPS'
  360 |         DRM_ACCEL_FOPS,
      |         ^~~~~~~~~~~~~~

Remove the unused local assignment.

Fixes: 20709aa9435b ("accel: Add .mmap to DRM_ACCEL_FOPS")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/accel/ivpu/ivpu_drv.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Jeffrey Hugo Jan. 26, 2023, 5:10 p.m. UTC | #1
duplciate -> duplicate

On 1/26/2023 9:37 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> With extra warnings enabled, gcc warns about two assignments
> of the same .mmap callback:
> 
> In file included from drivers/accel/ivpu/ivpu_drv.c:10:
> include/drm/drm_accel.h:31:27: error: initialized field overwritten [-Werror=override-init]
>     31 |         .mmap           = drm_gem_mmap
>        |                           ^~~~~~~~~~~~
> drivers/accel/ivpu/ivpu_drv.c:360:9: note: in expansion of macro 'DRM_ACCEL_FOPS'
>    360 |         DRM_ACCEL_FOPS,
>        |         ^~~~~~~~~~~~~~
> 
> Remove the unused local assignment.
> 
> Fixes: 20709aa9435b ("accel: Add .mmap to DRM_ACCEL_FOPS")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Yep, two things in flight at the same time.  Thanks for getting to the 
cleanup before I did.

Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Jacek Lawrynowicz Jan. 31, 2023, 2 p.m. UTC | #2
Applied to drm-misc-next. Thanks.

On 26.01.2023 17:37, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> With extra warnings enabled, gcc warns about two assignments
> of the same .mmap callback:
> 
> In file included from drivers/accel/ivpu/ivpu_drv.c:10:
> include/drm/drm_accel.h:31:27: error: initialized field overwritten [-Werror=override-init]
>    31 |         .mmap           = drm_gem_mmap
>       |                           ^~~~~~~~~~~~
> drivers/accel/ivpu/ivpu_drv.c:360:9: note: in expansion of macro 'DRM_ACCEL_FOPS'
>   360 |         DRM_ACCEL_FOPS,
>       |         ^~~~~~~~~~~~~~
> 
> Remove the unused local assignment.
> 
> Fixes: 20709aa9435b ("accel: Add .mmap to DRM_ACCEL_FOPS")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/accel/ivpu/ivpu_drv.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/accel/ivpu/ivpu_drv.c b/drivers/accel/ivpu/ivpu_drv.c
> index 2bc2f1b90671..a29e8ee0dce6 100644
> --- a/drivers/accel/ivpu/ivpu_drv.c
> +++ b/drivers/accel/ivpu/ivpu_drv.c
> @@ -356,7 +356,6 @@ int ivpu_shutdown(struct ivpu_device *vdev)
>  
>  static const struct file_operations ivpu_fops = {
>  	.owner		= THIS_MODULE,
> -	.mmap           = drm_gem_mmap,
>  	DRM_ACCEL_FOPS,
>  };
>
Thomas Zimmermann Feb. 1, 2023, 10:37 a.m. UTC | #3
Am 31.01.23 um 15:00 schrieb Jacek Lawrynowicz:
> Applied to drm-misc-next. Thanks.

I have cherry-picked the patch into drm-misc-next-fixes.

> 
> On 26.01.2023 17:37, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> With extra warnings enabled, gcc warns about two assignments
>> of the same .mmap callback:
>>
>> In file included from drivers/accel/ivpu/ivpu_drv.c:10:
>> include/drm/drm_accel.h:31:27: error: initialized field overwritten [-Werror=override-init]
>>     31 |         .mmap           = drm_gem_mmap
>>        |                           ^~~~~~~~~~~~
>> drivers/accel/ivpu/ivpu_drv.c:360:9: note: in expansion of macro 'DRM_ACCEL_FOPS'
>>    360 |         DRM_ACCEL_FOPS,
>>        |         ^~~~~~~~~~~~~~
>>
>> Remove the unused local assignment.
>>
>> Fixes: 20709aa9435b ("accel: Add .mmap to DRM_ACCEL_FOPS")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> ---
>>   drivers/accel/ivpu/ivpu_drv.c | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/drivers/accel/ivpu/ivpu_drv.c b/drivers/accel/ivpu/ivpu_drv.c
>> index 2bc2f1b90671..a29e8ee0dce6 100644
>> --- a/drivers/accel/ivpu/ivpu_drv.c
>> +++ b/drivers/accel/ivpu/ivpu_drv.c
>> @@ -356,7 +356,6 @@ int ivpu_shutdown(struct ivpu_device *vdev)
>>   
>>   static const struct file_operations ivpu_fops = {
>>   	.owner		= THIS_MODULE,
>> -	.mmap           = drm_gem_mmap,
>>   	DRM_ACCEL_FOPS,
>>   };
>>
diff mbox series

Patch

diff --git a/drivers/accel/ivpu/ivpu_drv.c b/drivers/accel/ivpu/ivpu_drv.c
index 2bc2f1b90671..a29e8ee0dce6 100644
--- a/drivers/accel/ivpu/ivpu_drv.c
+++ b/drivers/accel/ivpu/ivpu_drv.c
@@ -356,7 +356,6 @@  int ivpu_shutdown(struct ivpu_device *vdev)
 
 static const struct file_operations ivpu_fops = {
 	.owner		= THIS_MODULE,
-	.mmap           = drm_gem_mmap,
 	DRM_ACCEL_FOPS,
 };