All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] writeback: fix -Wformat compilation warnings
@ 2019-11-14 17:17 Qian Cai
  2019-11-14 19:21 ` Tejun Heo
  0 siblings, 1 reply; 7+ messages in thread
From: Qian Cai @ 2019-11-14 17:17 UTC (permalink / raw)
  To: tj
  Cc: jack, gregkh, cgroups, heiko.carstens, gor, borntraeger,
	linux-s390, axboe, linux-kernel, Qian Cai

The commit f05499a06fb4 ("writeback: use ino_t for inodes in
tracepoints") introduced a lot of GCC compilation warnings on s390,

In file included from ./include/trace/define_trace.h:102,
                 from ./include/trace/events/writeback.h:904,
                 from fs/fs-writeback.c:82:
./include/trace/events/writeback.h: In function
'trace_raw_output_writeback_page_template':
./include/trace/events/writeback.h:76:12: warning: format '%lu' expects
argument of type 'long unsigned int', but argument 4 has type 'ino_t'
{aka 'unsigned int'} [-Wformat=]
  TP_printk("bdi %s: ino=%lu index=%lu",
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/trace/trace_events.h:360:22: note: in definition of macro
'DECLARE_EVENT_CLASS'
  trace_seq_printf(s, print);     \
                      ^~~~~
./include/trace/events/writeback.h:76:2: note: in expansion of macro
'TP_printk'
  TP_printk("bdi %s: ino=%lu index=%lu",
  ^~~~~~~~~

Fix them by adding necessary casts where ino_t could be either "unsigned
int" or "unsigned long".

Fixes: f05499a06fb4 ("writeback: use ino_t for inodes in tracepoints")
Signed-off-by: Qian Cai <cai@lca.pw>
---
 include/trace/events/writeback.h | 48 ++++++++++++++++++++--------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h
index b4f0ffe1817e..ef50be4e5e6c 100644
--- a/include/trace/events/writeback.h
+++ b/include/trace/events/writeback.h
@@ -75,7 +75,7 @@
 
 	TP_printk("bdi %s: ino=%lu index=%lu",
 		__entry->name,
-		__entry->ino,
+		(unsigned long)__entry->ino,
 		__entry->index
 	)
 );
@@ -120,7 +120,7 @@
 
 	TP_printk("bdi %s: ino=%lu state=%s flags=%s",
 		__entry->name,
-		__entry->ino,
+		(unsigned long)__entry->ino,
 		show_inode_state(__entry->state),
 		show_inode_state(__entry->flags)
 	)
@@ -201,8 +201,8 @@ static inline ino_t __trace_wbc_assign_cgroup(struct writeback_control *wbc)
 
 	TP_printk("bdi %s: ino=%lu cgroup_ino=%lu history=0x%x",
 		__entry->name,
-		__entry->ino,
-		__entry->cgroup_ino,
+		(unsigned long)__entry->ino,
+		(unsigned long)__entry->cgroup_ino,
 		__entry->history
 	)
 );
@@ -230,9 +230,9 @@ static inline ino_t __trace_wbc_assign_cgroup(struct writeback_control *wbc)
 
 	TP_printk("bdi %s: ino=%lu old_cgroup_ino=%lu new_cgroup_ino=%lu",
 		__entry->name,
-		__entry->ino,
-		__entry->old_cgroup_ino,
-		__entry->new_cgroup_ino
+		(unsigned long)__entry->ino,
+		(unsigned long)__entry->old_cgroup_ino,
+		(unsigned long)__entry->new_cgroup_ino
 	)
 );
 
@@ -266,10 +266,10 @@ static inline ino_t __trace_wbc_assign_cgroup(struct writeback_control *wbc)
 	TP_printk("bdi %s[%llu]: ino=%lu memcg_id=%u cgroup_ino=%lu page_cgroup_ino=%lu",
 		__entry->name,
 		__entry->bdi_id,
-		__entry->ino,
+		(unsigned long)__entry->ino,
 		__entry->memcg_id,
-		__entry->cgroup_ino,
-		__entry->page_cgroup_ino
+		(unsigned long)__entry->cgroup_ino,
+		(unsigned long)__entry->page_cgroup_ino
 	)
 );
 
@@ -296,7 +296,7 @@ static inline ino_t __trace_wbc_assign_cgroup(struct writeback_control *wbc)
 
 	TP_printk("bdi %s: cgroup_ino=%lu frn_bdi_id=%u frn_memcg_id=%u",
 		__entry->name,
-		__entry->cgroup_ino,
+		(unsigned long)__entry->cgroup_ino,
 		__entry->frn_bdi_id,
 		__entry->frn_memcg_id
 	)
@@ -326,9 +326,9 @@ static inline ino_t __trace_wbc_assign_cgroup(struct writeback_control *wbc)
 
 	TP_printk("bdi %s: ino=%lu sync_mode=%d cgroup_ino=%lu",
 		__entry->name,
-		__entry->ino,
+		(unsigned long)__entry->ino,
 		__entry->sync_mode,
-		__entry->cgroup_ino
+		(unsigned long)__entry->cgroup_ino
 	)
 );
 
@@ -383,7 +383,7 @@ static inline ino_t __trace_wbc_assign_cgroup(struct writeback_control *wbc)
 		  __entry->range_cyclic,
 		  __entry->for_background,
 		  __print_symbolic(__entry->reason, WB_WORK_REASON),
-		  __entry->cgroup_ino
+		  (unsigned long)__entry->cgroup_ino
 	)
 );
 #define DEFINE_WRITEBACK_WORK_EVENT(name) \
@@ -421,7 +421,7 @@ static inline ino_t __trace_wbc_assign_cgroup(struct writeback_control *wbc)
 	),
 	TP_printk("bdi %s: cgroup_ino=%lu",
 		  __entry->name,
-		  __entry->cgroup_ino
+		  (unsigned long)__entry->cgroup_ino
 	)
 );
 #define DEFINE_WRITEBACK_EVENT(name) \
@@ -489,7 +489,7 @@ static inline ino_t __trace_wbc_assign_cgroup(struct writeback_control *wbc)
 		__entry->range_cyclic,
 		__entry->range_start,
 		__entry->range_end,
-		__entry->cgroup_ino
+		(unsigned long)__entry->cgroup_ino
 	)
 )
 
@@ -528,7 +528,7 @@ static inline ino_t __trace_wbc_assign_cgroup(struct writeback_control *wbc)
 		__entry->age,	/* older_than_this in relative milliseconds */
 		__entry->moved,
 		__print_symbolic(__entry->reason, WB_WORK_REASON),
-		__entry->cgroup_ino
+		(unsigned long)__entry->cgroup_ino
 	)
 );
 
@@ -622,7 +622,7 @@ static inline ino_t __trace_wbc_assign_cgroup(struct writeback_control *wbc)
 		  __entry->dirty_ratelimit,	/* base ratelimit */
 		  __entry->task_ratelimit, /* ratelimit with position control */
 		  __entry->balanced_dirty_ratelimit, /* the balanced ratelimit */
-		  __entry->cgroup_ino
+		  (unsigned long)__entry->cgroup_ino
 	)
 );
 
@@ -707,7 +707,7 @@ static inline ino_t __trace_wbc_assign_cgroup(struct writeback_control *wbc)
 		  __entry->pause,	/* ms */
 		  __entry->period,	/* ms */
 		  __entry->think,	/* ms */
-		  __entry->cgroup_ino
+		  (unsigned long)__entry->cgroup_ino
 	  )
 );
 
@@ -735,11 +735,11 @@ static inline ino_t __trace_wbc_assign_cgroup(struct writeback_control *wbc)
 
 	TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu cgroup_ino=%lu",
 		  __entry->name,
-		  __entry->ino,
+		  (unsigned long)__entry->ino,
 		  show_inode_state(__entry->state),
 		  __entry->dirtied_when,
 		  (jiffies - __entry->dirtied_when) / HZ,
-		  __entry->cgroup_ino
+		  (unsigned long)__entry->cgroup_ino
 	)
 );
 
@@ -813,14 +813,14 @@ static inline ino_t __trace_wbc_assign_cgroup(struct writeback_control *wbc)
 	TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu "
 		  "index=%lu to_write=%ld wrote=%lu cgroup_ino=%lu",
 		  __entry->name,
-		  __entry->ino,
+		  (unsigned long)__entry->ino,
 		  show_inode_state(__entry->state),
 		  __entry->dirtied_when,
 		  (jiffies - __entry->dirtied_when) / HZ,
 		  __entry->writeback_index,
 		  __entry->nr_to_write,
 		  __entry->wrote,
-		  __entry->cgroup_ino
+		  (unsigned long)__entry->cgroup_ino
 	)
 );
 
@@ -861,7 +861,7 @@ static inline ino_t __trace_wbc_assign_cgroup(struct writeback_control *wbc)
 
 	TP_printk("dev %d,%d ino %lu dirtied %lu state %s mode 0%o",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
-		  __entry->ino, __entry->dirtied_when,
+		  (unsigned long)__entry->ino, __entry->dirtied_when,
 		  show_inode_state(__entry->state), __entry->mode)
 );
 
-- 
1.8.3.1


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

* Re: [PATCH -next] writeback: fix -Wformat compilation warnings
  2019-11-14 17:17 [PATCH -next] writeback: fix -Wformat compilation warnings Qian Cai
@ 2019-11-14 19:21 ` Tejun Heo
  2019-11-15  0:26   ` Qian Cai
  0 siblings, 1 reply; 7+ messages in thread
From: Tejun Heo @ 2019-11-14 19:21 UTC (permalink / raw)
  To: Qian Cai
  Cc: jack, gregkh, cgroups, heiko.carstens, gor, borntraeger,
	linux-s390, axboe, linux-kernel

On Thu, Nov 14, 2019 at 12:17:41PM -0500, Qian Cai wrote:
> The commit f05499a06fb4 ("writeback: use ino_t for inodes in
> tracepoints") introduced a lot of GCC compilation warnings on s390,
> 
> In file included from ./include/trace/define_trace.h:102,
>                  from ./include/trace/events/writeback.h:904,
>                  from fs/fs-writeback.c:82:
> ./include/trace/events/writeback.h: In function
> 'trace_raw_output_writeback_page_template':
> ./include/trace/events/writeback.h:76:12: warning: format '%lu' expects
> argument of type 'long unsigned int', but argument 4 has type 'ino_t'
> {aka 'unsigned int'} [-Wformat=]
>   TP_printk("bdi %s: ino=%lu index=%lu",
>             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> ./include/trace/trace_events.h:360:22: note: in definition of macro
> 'DECLARE_EVENT_CLASS'
>   trace_seq_printf(s, print);     \
>                       ^~~~~
> ./include/trace/events/writeback.h:76:2: note: in expansion of macro
> 'TP_printk'
>   TP_printk("bdi %s: ino=%lu index=%lu",
>   ^~~~~~~~~
> 
> Fix them by adding necessary casts where ino_t could be either "unsigned
> int" or "unsigned long".
> 
> Fixes: f05499a06fb4 ("writeback: use ino_t for inodes in tracepoints")
> Signed-off-by: Qian Cai <cai@lca.pw>

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

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

* Re: [PATCH -next] writeback: fix -Wformat compilation warnings
  2019-11-14 19:21 ` Tejun Heo
@ 2019-11-15  0:26   ` Qian Cai
  2019-11-15 14:55     ` Tejun Heo
  0 siblings, 1 reply; 7+ messages in thread
From: Qian Cai @ 2019-11-15  0:26 UTC (permalink / raw)
  To: Tejun Heo
  Cc: jack, gregkh, cgroups, heiko.carstens, gor, borntraeger,
	linux-s390, axboe, linux-kernel



> On Nov 14, 2019, at 2:21 PM, Tejun Heo <tj@kernel.org> wrote:
> 
> Acked-by: Tejun Heo <tj@kernel.org>

Tejun, suppose you will take this patch via your tree together with the series or should I Cc Andrew who normally handle this file?

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

* Re: [PATCH -next] writeback: fix -Wformat compilation warnings
  2019-11-15  0:26   ` Qian Cai
@ 2019-11-15 14:55     ` Tejun Heo
  2019-11-20 19:56       ` Qian Cai
  0 siblings, 1 reply; 7+ messages in thread
From: Tejun Heo @ 2019-11-15 14:55 UTC (permalink / raw)
  To: Qian Cai
  Cc: jack, gregkh, cgroups, heiko.carstens, gor, borntraeger,
	linux-s390, axboe, linux-kernel

On Thu, Nov 14, 2019 at 07:26:21PM -0500, Qian Cai wrote:
> 
> 
> > On Nov 14, 2019, at 2:21 PM, Tejun Heo <tj@kernel.org> wrote:
> > 
> > Acked-by: Tejun Heo <tj@kernel.org>
> 
> Tejun, suppose you will take this patch via your tree together with the series or should I Cc Andrew who normally handle this file?

Patches in this area usually goes through Jens's block tree.

Thanks.

-- 
tejun

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

* Re: [PATCH -next] writeback: fix -Wformat compilation warnings
  2019-11-15 14:55     ` Tejun Heo
@ 2019-11-20 19:56       ` Qian Cai
  2019-11-20 23:17         ` Jens Axboe
  0 siblings, 1 reply; 7+ messages in thread
From: Qian Cai @ 2019-11-20 19:56 UTC (permalink / raw)
  To: Tejun Heo, Andrew Morton
  Cc: jack, gregkh, cgroups, heiko.carstens, gor, borntraeger,
	linux-s390, axboe, linux-kernel

On Fri, 2019-11-15 at 06:55 -0800, Tejun Heo wrote:
> On Thu, Nov 14, 2019 at 07:26:21PM -0500, Qian Cai wrote:
> > 
> > 
> > > On Nov 14, 2019, at 2:21 PM, Tejun Heo <tj@kernel.org> wrote:
> > > 
> > > Acked-by: Tejun Heo <tj@kernel.org>
> > 
> > Tejun, suppose you will take this patch via your tree together with the series or should I Cc Andrew who normally handle this file?
> 
> Patches in this area usually goes through Jens's block tree.

I remember that last time Jens had no interests in picking up trivial patches
like this one. See the commit d1a445d3b86c ("include/trace/events/writeback.h:
fix -Wstringop-truncation warnings").

Andrew, care to pick up this again?

https://lore.kernel.org/lkml/1573751861-10303-1-git-send-email-cai@lca.pw/

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

* Re: [PATCH -next] writeback: fix -Wformat compilation warnings
  2019-11-20 19:56       ` Qian Cai
@ 2019-11-20 23:17         ` Jens Axboe
  2019-11-25 15:51           ` Tejun Heo
  0 siblings, 1 reply; 7+ messages in thread
From: Jens Axboe @ 2019-11-20 23:17 UTC (permalink / raw)
  To: Qian Cai, Tejun Heo, Andrew Morton
  Cc: jack, gregkh, cgroups, heiko.carstens, gor, borntraeger,
	linux-s390, linux-kernel

On 11/20/19 12:56 PM, Qian Cai wrote:
> On Fri, 2019-11-15 at 06:55 -0800, Tejun Heo wrote:
>> On Thu, Nov 14, 2019 at 07:26:21PM -0500, Qian Cai wrote:
>>>
>>>
>>>> On Nov 14, 2019, at 2:21 PM, Tejun Heo <tj@kernel.org> wrote:
>>>>
>>>> Acked-by: Tejun Heo <tj@kernel.org>
>>>
>>> Tejun, suppose you will take this patch via your tree together with the series or should I Cc Andrew who normally handle this file?
>>
>> Patches in this area usually goes through Jens's block tree.
> 
> I remember that last time Jens had no interests in picking up trivial patches
> like this one. See the commit d1a445d3b86c ("include/trace/events/writeback.h:
> fix -Wstringop-truncation warnings").
> 
> Andrew, care to pick up this again?
> 
> https://lore.kernel.org/lkml/1573751861-10303-1-git-send-email-cai@lca.pw/

I'm fine with picking it up, this one isn't trivial and it's fixing
warnings. But I didn't (and don't) carry f05499a06fb4 in my tree,
so it'd be more logical to funnel this one through the tree that
has the offending commit.

-- 
Jens Axboe


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

* Re: [PATCH -next] writeback: fix -Wformat compilation warnings
  2019-11-20 23:17         ` Jens Axboe
@ 2019-11-25 15:51           ` Tejun Heo
  0 siblings, 0 replies; 7+ messages in thread
From: Tejun Heo @ 2019-11-25 15:51 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Qian Cai, Andrew Morton, jack, gregkh, cgroups, heiko.carstens,
	gor, borntraeger, linux-s390, linux-kernel

On Wed, Nov 20, 2019 at 04:17:51PM -0700, Jens Axboe wrote:
> On 11/20/19 12:56 PM, Qian Cai wrote:
> > On Fri, 2019-11-15 at 06:55 -0800, Tejun Heo wrote:
> >> On Thu, Nov 14, 2019 at 07:26:21PM -0500, Qian Cai wrote:
> >>>
> >>>
> >>>> On Nov 14, 2019, at 2:21 PM, Tejun Heo <tj@kernel.org> wrote:
> >>>>
> >>>> Acked-by: Tejun Heo <tj@kernel.org>
> >>>
> >>> Tejun, suppose you will take this patch via your tree together with the series or should I Cc Andrew who normally handle this file?
> >>
> >> Patches in this area usually goes through Jens's block tree.
> > 
> > I remember that last time Jens had no interests in picking up trivial patches
> > like this one. See the commit d1a445d3b86c ("include/trace/events/writeback.h:
> > fix -Wstringop-truncation warnings").
> > 
> > Andrew, care to pick up this again?
> > 
> > https://lore.kernel.org/lkml/1573751861-10303-1-git-send-email-cai@lca.pw/
> 
> I'm fine with picking it up, this one isn't trivial and it's fixing
> warnings. But I didn't (and don't) carry f05499a06fb4 in my tree,
> so it'd be more logical to funnel this one through the tree that
> has the offending commit.

Yeah, I was being dumb.  This was from the commit which got applied to
cgroup tree as part of the cgroup id unification.  Applied to
cgroup/for-5.5.

Thanks.

-- 
tejun

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

end of thread, other threads:[~2019-11-25 15:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-14 17:17 [PATCH -next] writeback: fix -Wformat compilation warnings Qian Cai
2019-11-14 19:21 ` Tejun Heo
2019-11-15  0:26   ` Qian Cai
2019-11-15 14:55     ` Tejun Heo
2019-11-20 19:56       ` Qian Cai
2019-11-20 23:17         ` Jens Axboe
2019-11-25 15:51           ` Tejun Heo

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.