Linux s390 Architecture development
 help / color / mirror / Atom feed
* [PATCH] partitions: fix build error in ibm partition detection code
@ 2010-08-12  8:31 Heiko Carstens
  2010-08-12  8:53 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Heiko Carstens @ 2010-08-12  8:31 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds, Alexey Dobriyan; +Cc: linux-kernel, linux-s390

Subject: [PATCH] partitions: fix build error in ibm partition detection code

From: Heiko Carstens <heiko.carstens@de.ibm.com>

9c867fbe "partitions: fix sometimes unreadable partition strings" coverted
one line within the ibm partition code incorrectly. Fix this to get rid of
a build error.

fs/partitions/ibm.c: In function 'ibm_partition':
[...]
fs/partitions/ibm.c:185: error: too many arguments to function 'strlcat'

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
 fs/partitions/ibm.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/partitions/ibm.c b/fs/partitions/ibm.c
index d1b8a5c..55610aa 100644
--- a/fs/partitions/ibm.c
+++ b/fs/partitions/ibm.c
@@ -182,7 +182,8 @@ int ibm_partition(struct parsed_partitions *state)
 				offset = (info->label_block + 1);
 			} else {
 				/* unlabeled disk */
-				strlcat(tmp, sizeof(tmp), "(nonl)", PAGE_SIZE);
+				snprintf(tmp, sizeof(tmp), "(nonl)");
+				strlcat(state->pp_buf, tmp, PAGE_SIZE);
 				size = i_size >> 9;
 				offset = (info->label_block + 1);
 			}

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

* Re: [PATCH] partitions: fix build error in ibm partition detection code
  2010-08-12  8:31 [PATCH] partitions: fix build error in ibm partition detection code Heiko Carstens
@ 2010-08-12  8:53 ` Andreas Schwab
  2010-08-12 10:44   ` Heiko Carstens
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2010-08-12  8:53 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: Andrew Morton, Linus Torvalds, Alexey Dobriyan, linux-kernel,
	linux-s390

Heiko Carstens <heiko.carstens@de.ibm.com> writes:

> -				strlcat(tmp, sizeof(tmp), "(nonl)", PAGE_SIZE);
> +				snprintf(tmp, sizeof(tmp), "(nonl)");
> +				strlcat(state->pp_buf, tmp, PAGE_SIZE);

What's the point of tmp and snprintf if it just creates a copy of a
constant string?

				strlcat(state->pp_buf, "(nonl)", PAGE_SIZE);

Andreas.

-- 
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."

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

* Re: [PATCH] partitions: fix build error in ibm partition detection code
  2010-08-12  8:53 ` Andreas Schwab
@ 2010-08-12 10:44   ` Heiko Carstens
  0 siblings, 0 replies; 3+ messages in thread
From: Heiko Carstens @ 2010-08-12 10:44 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Andrew Morton, Linus Torvalds, Alexey Dobriyan, linux-kernel,
	linux-s390

On Thu, Aug 12, 2010 at 10:53:38AM +0200, Andreas Schwab wrote:
> Heiko Carstens <heiko.carstens@de.ibm.com> writes:
> 
> > -				strlcat(tmp, sizeof(tmp), "(nonl)", PAGE_SIZE);
> > +				snprintf(tmp, sizeof(tmp), "(nonl)");
> > +				strlcat(state->pp_buf, tmp, PAGE_SIZE);
> 
> What's the point of tmp and snprintf if it just creates a copy of a
> constant string?
> 
> 				strlcat(state->pp_buf, "(nonl)", PAGE_SIZE);

There's no point, just followed the pattern in the original patch without
thinking. Thanks! Updated patch:

Subject: [PATCH] partitions: fix build error in ibm partition detection code

From: Heiko Carstens <heiko.carstens@de.ibm.com>

9c867fbe "partitions: fix sometimes unreadable partition strings" coverted
one line within the ibm partition code incorrectly. Fix this to get rid of
a build error.

fs/partitions/ibm.c: In function 'ibm_partition':
[...]
fs/partitions/ibm.c:185: error: too many arguments to function 'strlcat'

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
 fs/partitions/ibm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/partitions/ibm.c
+++ b/fs/partitions/ibm.c
@@ -182,7 +182,7 @@ int ibm_partition(struct parsed_partitio
 				offset = (info->label_block + 1);
 			} else {
 				/* unlabeled disk */
-				strlcat(tmp, sizeof(tmp), "(nonl)", PAGE_SIZE);
+				strlcat(state->pp_buf, "(nonl)", PAGE_SIZE);
 				size = i_size >> 9;
 				offset = (info->label_block + 1);
 			}

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

end of thread, other threads:[~2010-08-12 10:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-12  8:31 [PATCH] partitions: fix build error in ibm partition detection code Heiko Carstens
2010-08-12  8:53 ` Andreas Schwab
2010-08-12 10:44   ` Heiko Carstens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox