Skip to contentSkip to conversation

media: staging/intel-ipu3: mark PM function as __maybe_unused

PATCH In review Arnd Bergmann 2 participants 2 messages Mar 4, 2019 – Mar 5, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: staging/intel-ipu3: mark PM function as __maybe_unused

The imgu_rpm_dummy_cb() looks like an API misuse that is explained in the comment above it. Aside from that, it also causes a warning when power management support is disabled:

drivers/staging/media/ipu3/ipu3.c:794:12: error: 'imgu_rpm_dummy_cb' defined but not used [-Werror=unused-function]

The warning is at least easy to fix by marking the function as __maybe_unused.

Fixes 7fc7af649ca7 ("media: staging/intel-ipu3: Add imgu top level pci device driver")
---
 drivers/staging/media/ipu3/ipu3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/ipu3/ipu3.c +1 -1
index d575ac78c8f0..d00d26264c37 100644
@@ -791,7 +791,7 @@ static int __maybe_unused imgu_resume(struct device *dev)
  * PCI rpm framework checks the existence of driver rpm callbacks.
  * Place a dummy callback here to avoid rpm going into error state.
  */
-static int imgu_rpm_dummy_cb(struct device *dev)
+static __maybe_unused int imgu_rpm_dummy_cb(struct device *dev)
 {
 	return 0;
 }
Signature · 1 line
2.20.0
Reviewed-by on v1 1/1
#1 lore raw

Hi, Bergmann,

Thanks for your patch.

__________________________
BRs,
Cao, Bingbu

Quoted 47 lines

-----Original Message-----
From: Arnd Bergmann [mailto:[email protected]]
Sent: Tuesday, March 5, 2019 4:29 AM
To: Sakari Ailus <[email protected]>; Mauro Carvalho Chehab <[email protected]>; Greg Kroah-Hartman <[email protected]>
Cc: Arnd Bergmann <[email protected]>; Zhi, Yong <[email protected]>; Tomasz Figa <[email protected]>; Qiu, Tian Shu <[email protected]>; Cao, Bingbu <[email protected]>; linux- [email protected]; [email protected]; linux- [email protected]
Subject: [PATCH] media: staging/intel-ipu3: mark PM function as __maybe_unused

The imgu_rpm_dummy_cb() looks like an API misuse that is explained in the comment above it. Aside from that, it also causes a warning when power management support is disabled:

drivers/staging/media/ipu3/ipu3.c:794:12: error: 'imgu_rpm_dummy_cb' defined but not used [-Werror=unused-function]

The warning is at least easy to fix by marking the function as __maybe_unused.

Fixes 7fc7af649ca7 ("media: staging/intel-ipu3: Add imgu top level pci

device driver")

---
 drivers/staging/media/ipu3/ipu3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/ipu3/ipu3.c +1 -1
index d575ac78c8f0..d00d26264c37 100644
@@ -791,7 +791,7 @@ static int __maybe_unused imgu_resume(struct device
 *dev)
  * PCI rpm framework checks the existence of driver rpm callbacks.
  * Place a dummy callback here to avoid rpm going into error state.
  */
-static int imgu_rpm_dummy_cb(struct device *dev)
+static __maybe_unused int imgu_rpm_dummy_cb(struct device *dev)
 {
 	return 0;

}
--
2.20.0