@@ -40,9 +40,7 @@ adfs_partition(struct parsed_partitions *state, char *name, char *data,
4040 (le32_to_cpu (dr -> disc_size ) >> 9 );
4141
4242 if (name ) {
43- strlcat (state -> pp_buf , " [" , PAGE_SIZE );
44- strlcat (state -> pp_buf , name , PAGE_SIZE );
45- strlcat (state -> pp_buf , "]" , PAGE_SIZE );
43+ seq_buf_printf (& state -> pp_buf , " [%s]" , name );
4644 }
4745 put_partition (state , slot , first_sector , nr_sects );
4846 return dr ;
@@ -78,14 +76,14 @@ static int riscix_partition(struct parsed_partitions *state,
7876 if (!rr )
7977 return -1 ;
8078
81- strlcat ( state -> pp_buf , " [RISCiX]" , PAGE_SIZE );
79+ seq_buf_puts ( & state -> pp_buf , " [RISCiX]" );
8280
8381
8482 if (rr -> magic == RISCIX_MAGIC ) {
8583 unsigned long size = nr_sects > 2 ? 2 : nr_sects ;
8684 int part ;
8785
88- strlcat ( state -> pp_buf , " <" , PAGE_SIZE );
86+ seq_buf_puts ( & state -> pp_buf , " <" );
8987
9088 put_partition (state , slot ++ , first_sect , size );
9189 for (part = 0 ; part < 8 ; part ++ ) {
@@ -94,13 +92,11 @@ static int riscix_partition(struct parsed_partitions *state,
9492 put_partition (state , slot ++ ,
9593 le32_to_cpu (rr -> part [part ].start ),
9694 le32_to_cpu (rr -> part [part ].length ));
97- strlcat (state -> pp_buf , "(" , PAGE_SIZE );
98- strlcat (state -> pp_buf , rr -> part [part ].name , PAGE_SIZE );
99- strlcat (state -> pp_buf , ")" , PAGE_SIZE );
95+ seq_buf_printf (& state -> pp_buf , "(%s)" , rr -> part [part ].name );
10096 }
10197 }
10298
103- strlcat ( state -> pp_buf , " >\n" , PAGE_SIZE );
99+ seq_buf_puts ( & state -> pp_buf , " >\n" );
104100 } else {
105101 put_partition (state , slot ++ , first_sect , nr_sects );
106102 }
@@ -130,15 +126,15 @@ static int linux_partition(struct parsed_partitions *state,
130126 struct linux_part * linuxp ;
131127 unsigned long size = nr_sects > 2 ? 2 : nr_sects ;
132128
133- strlcat ( state -> pp_buf , " [Linux]" , PAGE_SIZE );
129+ seq_buf_puts ( & state -> pp_buf , " [Linux]" );
134130
135131 put_partition (state , slot ++ , first_sect , size );
136132
137133 linuxp = read_part_sector (state , first_sect , & sect );
138134 if (!linuxp )
139135 return -1 ;
140136
141- strlcat ( state -> pp_buf , " <" , PAGE_SIZE );
137+ seq_buf_puts ( & state -> pp_buf , " <" );
142138 while (linuxp -> magic == cpu_to_le32 (LINUX_NATIVE_MAGIC ) ||
143139 linuxp -> magic == cpu_to_le32 (LINUX_SWAP_MAGIC )) {
144140 if (slot == state -> limit )
@@ -148,7 +144,7 @@ static int linux_partition(struct parsed_partitions *state,
148144 le32_to_cpu (linuxp -> nr_sects ));
149145 linuxp ++ ;
150146 }
151- strlcat ( state -> pp_buf , " >" , PAGE_SIZE );
147+ seq_buf_puts ( & state -> pp_buf , " >" );
152148
153149 put_dev_sector (sect );
154150 return slot ;
@@ -293,7 +289,7 @@ int adfspart_check_ADFS(struct parsed_partitions *state)
293289 break ;
294290 }
295291 }
296- strlcat ( state -> pp_buf , "\n" , PAGE_SIZE );
292+ seq_buf_puts ( & state -> pp_buf , "\n" );
297293 return 1 ;
298294}
299295#endif
@@ -366,7 +362,7 @@ int adfspart_check_ICS(struct parsed_partitions *state)
366362 return 0 ;
367363 }
368364
369- strlcat ( state -> pp_buf , " [ICS]" , PAGE_SIZE );
365+ seq_buf_puts ( & state -> pp_buf , " [ICS]" );
370366
371367 for (slot = 1 , p = (const struct ics_part * )data ; p -> size ; p ++ ) {
372368 u32 start = le32_to_cpu (p -> start );
@@ -400,7 +396,7 @@ int adfspart_check_ICS(struct parsed_partitions *state)
400396 }
401397
402398 put_dev_sector (sect );
403- strlcat ( state -> pp_buf , "\n" , PAGE_SIZE );
399+ seq_buf_puts ( & state -> pp_buf , "\n" );
404400 return 1 ;
405401}
406402#endif
@@ -460,7 +456,7 @@ int adfspart_check_POWERTEC(struct parsed_partitions *state)
460456 return 0 ;
461457 }
462458
463- strlcat ( state -> pp_buf , " [POWERTEC]" , PAGE_SIZE );
459+ seq_buf_puts ( & state -> pp_buf , " [POWERTEC]" );
464460
465461 for (i = 0 , p = (const struct ptec_part * )data ; i < 12 ; i ++ , p ++ ) {
466462 u32 start = le32_to_cpu (p -> start );
@@ -471,7 +467,7 @@ int adfspart_check_POWERTEC(struct parsed_partitions *state)
471467 }
472468
473469 put_dev_sector (sect );
474- strlcat ( state -> pp_buf , "\n" , PAGE_SIZE );
470+ seq_buf_puts ( & state -> pp_buf , "\n" );
475471 return 1 ;
476472}
477473#endif
@@ -542,7 +538,7 @@ int adfspart_check_EESOX(struct parsed_partitions *state)
542538
543539 size = get_capacity (state -> disk );
544540 put_partition (state , slot ++ , start , size - start );
545- strlcat ( state -> pp_buf , "\n" , PAGE_SIZE );
541+ seq_buf_puts ( & state -> pp_buf , "\n" );
546542 }
547543
548544 return i ? 1 : 0 ;
0 commit comments