All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] mm: fix set but not used warning
@ 2019-02-18 13:57 ` YueHaibing
  0 siblings, 0 replies; 6+ messages in thread
From: YueHaibing @ 2019-02-18 13:57 UTC (permalink / raw)
  To: Andrew Morton, Toshi Kani, Will Deacon, Chintan Pandya, Thomas Gleixner
  Cc: YueHaibing, linux-kernel, kernel-janitors

Fixes gcc '-Wunused-but-set-variable' warning:

lib/ioremap.c: In function 'ioremap_page_range':
lib/ioremap.c:203:16: warning:
 variable 'start' set but not used [-Wunused-but-set-variable]

flush_cache_vmap may no need param, so add __maybe_unused fix this warning.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 lib/ioremap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ioremap.c b/lib/ioremap.c
index 063213685563..d1c7a488e731 100644
--- a/lib/ioremap.c
+++ b/lib/ioremap.c
@@ -200,7 +200,7 @@ int ioremap_page_range(unsigned long addr,
 		       unsigned long end, phys_addr_t phys_addr, pgprot_t prot)
 {
 	pgd_t *pgd;
-	unsigned long start;
+	unsigned long __maybe_unused start;
 	unsigned long next;
 	int err;




^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH -next] mm: fix set but not used warning
@ 2019-02-18 13:57 ` YueHaibing
  0 siblings, 0 replies; 6+ messages in thread
From: YueHaibing @ 2019-02-18 13:57 UTC (permalink / raw)
  To: Andrew Morton, Toshi Kani, Will Deacon, Chintan Pandya, Thomas Gleixner
  Cc: YueHaibing, linux-kernel, kernel-janitors

Fixes gcc '-Wunused-but-set-variable' warning:

lib/ioremap.c: In function 'ioremap_page_range':
lib/ioremap.c:203:16: warning:
 variable 'start' set but not used [-Wunused-but-set-variable]

flush_cache_vmap may no need param, so add __maybe_unused fix this warning.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 lib/ioremap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ioremap.c b/lib/ioremap.c
index 063213685563..d1c7a488e731 100644
--- a/lib/ioremap.c
+++ b/lib/ioremap.c
@@ -200,7 +200,7 @@ int ioremap_page_range(unsigned long addr,
 		       unsigned long end, phys_addr_t phys_addr, pgprot_t prot)
 {
 	pgd_t *pgd;
-	unsigned long start;
+	unsigned long __maybe_unused start;
 	unsigned long next;
 	int err;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH -next] mm: fix set but not used warning
  2019-02-18 13:57 ` YueHaibing
@ 2019-02-19 18:28   ` Kani, Toshi
  -1 siblings, 0 replies; 6+ messages in thread
From: Kani, Toshi @ 2019-02-19 18:28 UTC (permalink / raw)
  To: yuehaibing, cpandya, tglx, akpm, will.deacon
  Cc: linux-kernel, kernel-janitors

On Mon, 2019-02-18 at 13:57 +0000, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> lib/ioremap.c: In function 'ioremap_page_range':
> lib/ioremap.c:203:16: warning:
>  variable 'start' set but not used [-Wunused-but-set-variable]
> 
> flush_cache_vmap may no need param, so add __maybe_unused fix this warning.

I think flush_cache_vmap should have a proper prototype with
__maybe_unused for its args.  But, there are so many arch-specific
definitions at glace, and I am not sure how manageable such change is,
though...

Thanks,
-Toshi

> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  lib/ioremap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/ioremap.c b/lib/ioremap.c
> index 063213685563..d1c7a488e731 100644
> --- a/lib/ioremap.c
> +++ b/lib/ioremap.c
> @@ -200,7 +200,7 @@ int ioremap_page_range(unsigned long addr,
>  		       unsigned long end, phys_addr_t phys_addr, pgprot_t prot)
>  {
>  	pgd_t *pgd;
> -	unsigned long start;
> +	unsigned long __maybe_unused start;
>  	unsigned long next;
>  	int err;
> 
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH -next] mm: fix set but not used warning
@ 2019-02-19 18:28   ` Kani, Toshi
  0 siblings, 0 replies; 6+ messages in thread
From: Kani, Toshi @ 2019-02-19 18:28 UTC (permalink / raw)
  To: yuehaibing, cpandya, tglx, akpm, will.deacon
  Cc: linux-kernel, kernel-janitors

T24gTW9uLCAyMDE5LTAyLTE4IGF0IDEzOjU3ICswMDAwLCBZdWVIYWliaW5nIHdyb3RlOg0KPiBG
aXhlcyBnY2MgJy1XdW51c2VkLWJ1dC1zZXQtdmFyaWFibGUnIHdhcm5pbmc6DQo+IA0KPiBsaWIv
aW9yZW1hcC5jOiBJbiBmdW5jdGlvbiAnaW9yZW1hcF9wYWdlX3JhbmdlJzoNCj4gbGliL2lvcmVt
YXAuYzoyMDM6MTY6IHdhcm5pbmc6DQo+ICB2YXJpYWJsZSAnc3RhcnQnIHNldCBidXQgbm90IHVz
ZWQgWy1XdW51c2VkLWJ1dC1zZXQtdmFyaWFibGVdDQo+IA0KPiBmbHVzaF9jYWNoZV92bWFwIG1h
eSBubyBuZWVkIHBhcmFtLCBzbyBhZGQgX19tYXliZV91bnVzZWQgZml4IHRoaXMgd2FybmluZy4N
Cg0KSSB0aGluayBmbHVzaF9jYWNoZV92bWFwIHNob3VsZCBoYXZlIGEgcHJvcGVyIHByb3RvdHlw
ZSB3aXRoDQpfX21heWJlX3VudXNlZCBmb3IgaXRzIGFyZ3MuICBCdXQsIHRoZXJlIGFyZSBzbyBt
YW55IGFyY2gtc3BlY2lmaWMNCmRlZmluaXRpb25zIGF0IGdsYWNlLCBhbmQgSSBhbSBub3Qgc3Vy
ZSBob3cgbWFuYWdlYWJsZSBzdWNoIGNoYW5nZSBpcywNCnRob3VnaC4uLg0KDQpUaGFua3MsDQot
VG9zaGkNCg0KPiANCj4gU2lnbmVkLW9mZi1ieTogWXVlSGFpYmluZyA8eXVlaGFpYmluZ0BodWF3
ZWkuY29tPg0KPiAtLS0NCj4gIGxpYi9pb3JlbWFwLmMgfCAyICstDQo+ICAxIGZpbGUgY2hhbmdl
ZCwgMSBpbnNlcnRpb24oKyksIDEgZGVsZXRpb24oLSkNCj4gDQo+IGRpZmYgLS1naXQgYS9saWIv
aW9yZW1hcC5jIGIvbGliL2lvcmVtYXAuYw0KPiBpbmRleCAwNjMyMTM2ODU1NjMuLmQxYzdhNDg4
ZTczMSAxMDA2NDQNCj4gLS0tIGEvbGliL2lvcmVtYXAuYw0KPiArKysgYi9saWIvaW9yZW1hcC5j
DQo+IEBAIC0yMDAsNyArMjAwLDcgQEAgaW50IGlvcmVtYXBfcGFnZV9yYW5nZSh1bnNpZ25lZCBs
b25nIGFkZHIsDQo+ICAJCSAgICAgICB1bnNpZ25lZCBsb25nIGVuZCwgcGh5c19hZGRyX3QgcGh5
c19hZGRyLCBwZ3Byb3RfdCBwcm90KQ0KPiAgew0KPiAgCXBnZF90ICpwZ2Q7DQo+IC0JdW5zaWdu
ZWQgbG9uZyBzdGFydDsNCj4gKwl1bnNpZ25lZCBsb25nIF9fbWF5YmVfdW51c2VkIHN0YXJ0Ow0K
PiAgCXVuc2lnbmVkIGxvbmcgbmV4dDsNCj4gIAlpbnQgZXJyOw0KPiANCj4gDQo+IA0K

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH -next] mm: fix set but not used warning
  2019-02-19 18:28   ` Kani, Toshi
@ 2019-02-20 21:43     ` Andrew Morton
  -1 siblings, 0 replies; 6+ messages in thread
From: Andrew Morton @ 2019-02-20 21:43 UTC (permalink / raw)
  To: Kani, Toshi
  Cc: yuehaibing, cpandya, tglx, will.deacon, linux-kernel, kernel-janitors

On Tue, 19 Feb 2019 18:28:30 +0000 "Kani, Toshi" <toshi.kani@hpe.com> wrote:

> On Mon, 2019-02-18 at 13:57 +0000, YueHaibing wrote:
> > Fixes gcc '-Wunused-but-set-variable' warning:
> > 
> > lib/ioremap.c: In function 'ioremap_page_range':
> > lib/ioremap.c:203:16: warning:
> >  variable 'start' set but not used [-Wunused-but-set-variable]
> > 
> > flush_cache_vmap may no need param, so add __maybe_unused fix this warning.
> 
> I think flush_cache_vmap should have a proper prototype with
> __maybe_unused for its args.  But, there are so many arch-specific
> definitions at glace, and I am not sure how manageable such change is,
> though...

This is one of the reasons why things like flush_cache_vmap() should
be implemented as static inline C functions, not as macros.  

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH -next] mm: fix set but not used warning
@ 2019-02-20 21:43     ` Andrew Morton
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Morton @ 2019-02-20 21:43 UTC (permalink / raw)
  To: Kani, Toshi
  Cc: yuehaibing, cpandya, tglx, will.deacon, linux-kernel, kernel-janitors

On Tue, 19 Feb 2019 18:28:30 +0000 "Kani, Toshi" <toshi.kani@hpe.com> wrote:

> On Mon, 2019-02-18 at 13:57 +0000, YueHaibing wrote:
> > Fixes gcc '-Wunused-but-set-variable' warning:
> > 
> > lib/ioremap.c: In function 'ioremap_page_range':
> > lib/ioremap.c:203:16: warning:
> >  variable 'start' set but not used [-Wunused-but-set-variable]
> > 
> > flush_cache_vmap may no need param, so add __maybe_unused fix this warning.
> 
> I think flush_cache_vmap should have a proper prototype with
> __maybe_unused for its args.  But, there are so many arch-specific
> definitions at glace, and I am not sure how manageable such change is,
> though...

This is one of the reasons why things like flush_cache_vmap() should
be implemented as static inline C functions, not as macros.  

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-02-20 21:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-18 13:57 [PATCH -next] mm: fix set but not used warning YueHaibing
2019-02-18 13:57 ` YueHaibing
2019-02-19 18:28 ` Kani, Toshi
2019-02-19 18:28   ` Kani, Toshi
2019-02-20 21:43   ` Andrew Morton
2019-02-20 21:43     ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.