diff mbox series

[v3,1/4] usb: gadget: f_mass_storage: fix warning of -Werror=unused-but-set-variable

Message ID 1652097288-19909-2-git-send-email-quic_linyyuan@quicinc.com
State New
Headers show
Series usb: gadget: update DECLARE_USB_FUNCTION(_INIT) macro | expand

Commit Message

Linyu Yuan May 9, 2022, 11:54 a.m. UTC
When add gcc W=1 compile flag, it report following error,
In function 'invalidate_sub':
error: variable 'rc' set but not used [-Werror=unused-but-set-variable],

Add a __maybe_unused property.

Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
---
v3: new add

 drivers/usb/gadget/function/f_mass_storage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c
index 3a77bca..a688538 100644
--- a/drivers/usb/gadget/function/f_mass_storage.c
+++ b/drivers/usb/gadget/function/f_mass_storage.c
@@ -926,7 +926,7 @@  static void invalidate_sub(struct fsg_lun *curlun)
 {
 	struct file	*filp = curlun->filp;
 	struct inode	*inode = file_inode(filp);
-	unsigned long	rc;
+	unsigned long	__maybe_unused rc;
 
 	rc = invalidate_mapping_pages(inode->i_mapping, 0, -1);
 	VLDBG(curlun, "invalidate_mapping_pages -> %ld\n", rc);