All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Cody P Schafer <cody@linux.vnet.ibm.com>
Cc: Michael Ellerman <michael@ellerman.id.au>,
	David.Laight@aculab.com,
	Linux PPC <linuxppc-dev@lists.ozlabs.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Anton Blanchard <anton@samba.org>
Subject: Re: [PATCH v2 6/6] powerpc/perf/hv-24x7: catalog version number is be64, not be32
Date: Mon, 28 Apr 2014 14:47:58 +1000	[thread overview]
Message-ID: <1398660478.30694.10.camel@pasglop> (raw)
In-Reply-To: <1397581855-4585-7-git-send-email-cody@linux.vnet.ibm.com>

On Tue, 2014-04-15 at 10:10 -0700, Cody P Schafer wrote:
> The catalog version number was changed from a be32 (with proceeding
> 32bits of padding) to a be64, update the code to treat it as a be64
> 
> Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
> --

Have you tested this ?

It doesn't build for me:

arch/powerpc/perf/hv-24x7.c: In function 'catalog_read':
arch/powerpc/perf/hv-24x7.c:223:3: error: format '%d' expects argument of type 'int', but argument 2 has type 'uint64_t' [-Werror=format]
cc1: all warnings being treated as errors

I'll fix that up in my tree.

Cheers,
Ben.

>  arch/powerpc/perf/hv-24x7.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
> index 95a67f8..9d4badc 100644
> --- a/arch/powerpc/perf/hv-24x7.c
> +++ b/arch/powerpc/perf/hv-24x7.c
> @@ -171,7 +171,7 @@ static unsigned long h_get_24x7_catalog_page_(unsigned long phys_4096,
>  }
>  
>  static unsigned long h_get_24x7_catalog_page(char page[],
> -					     u32 version, u32 index)
> +					     u64 version, u32 index)
>  {
>  	return h_get_24x7_catalog_page_(virt_to_phys(page),
>  					version, index);
> @@ -185,7 +185,7 @@ static ssize_t catalog_read(struct file *filp, struct kobject *kobj,
>  	ssize_t ret = 0;
>  	size_t catalog_len = 0, catalog_page_len = 0, page_count = 0;
>  	loff_t page_offset = 0;
> -	uint32_t catalog_version_num = 0;
> +	uint64_t catalog_version_num = 0;
>  	void *page = kmem_cache_alloc(hv_page_cache, GFP_USER);
>  	struct hv_24x7_catalog_page_0 *page_0 = page;
>  	if (!page)
> @@ -197,7 +197,7 @@ static ssize_t catalog_read(struct file *filp, struct kobject *kobj,
>  		goto e_free;
>  	}
>  
> -	catalog_version_num = be32_to_cpu(page_0->version);
> +	catalog_version_num = be64_to_cpu(page_0->version);
>  	catalog_page_len = be32_to_cpu(page_0->length);
>  	catalog_len = catalog_page_len * 4096;
>  
> @@ -255,7 +255,7 @@ e_free:								\
>  static DEVICE_ATTR_RO(_name)
>  
>  PAGE_0_ATTR(catalog_version, "%lld\n",
> -		(unsigned long long)be32_to_cpu(page_0->version));
> +		(unsigned long long)be64_to_cpu(page_0->version));
>  PAGE_0_ATTR(catalog_len, "%lld\n",
>  		(unsigned long long)be32_to_cpu(page_0->length) * 4096);
>  static BIN_ATTR_RO(catalog, 0/* real length varies */);

WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Cody P Schafer <cody@linux.vnet.ibm.com>
Cc: Michael Ellerman <michael@ellerman.id.au>,
	Linux PPC <linuxppc-dev@lists.ozlabs.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Anton Blanchard <anton@samba.org>,
	David.Laight@aculab.com
Subject: Re: [PATCH v2 6/6] powerpc/perf/hv-24x7: catalog version number is be64, not be32
Date: Mon, 28 Apr 2014 14:47:58 +1000	[thread overview]
Message-ID: <1398660478.30694.10.camel@pasglop> (raw)
In-Reply-To: <1397581855-4585-7-git-send-email-cody@linux.vnet.ibm.com>

On Tue, 2014-04-15 at 10:10 -0700, Cody P Schafer wrote:
> The catalog version number was changed from a be32 (with proceeding
> 32bits of padding) to a be64, update the code to treat it as a be64
> 
> Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
> --

Have you tested this ?

It doesn't build for me:

arch/powerpc/perf/hv-24x7.c: In function 'catalog_read':
arch/powerpc/perf/hv-24x7.c:223:3: error: format '%d' expects argument of type 'int', but argument 2 has type 'uint64_t' [-Werror=format]
cc1: all warnings being treated as errors

I'll fix that up in my tree.

Cheers,
Ben.

>  arch/powerpc/perf/hv-24x7.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
> index 95a67f8..9d4badc 100644
> --- a/arch/powerpc/perf/hv-24x7.c
> +++ b/arch/powerpc/perf/hv-24x7.c
> @@ -171,7 +171,7 @@ static unsigned long h_get_24x7_catalog_page_(unsigned long phys_4096,
>  }
>  
>  static unsigned long h_get_24x7_catalog_page(char page[],
> -					     u32 version, u32 index)
> +					     u64 version, u32 index)
>  {
>  	return h_get_24x7_catalog_page_(virt_to_phys(page),
>  					version, index);
> @@ -185,7 +185,7 @@ static ssize_t catalog_read(struct file *filp, struct kobject *kobj,
>  	ssize_t ret = 0;
>  	size_t catalog_len = 0, catalog_page_len = 0, page_count = 0;
>  	loff_t page_offset = 0;
> -	uint32_t catalog_version_num = 0;
> +	uint64_t catalog_version_num = 0;
>  	void *page = kmem_cache_alloc(hv_page_cache, GFP_USER);
>  	struct hv_24x7_catalog_page_0 *page_0 = page;
>  	if (!page)
> @@ -197,7 +197,7 @@ static ssize_t catalog_read(struct file *filp, struct kobject *kobj,
>  		goto e_free;
>  	}
>  
> -	catalog_version_num = be32_to_cpu(page_0->version);
> +	catalog_version_num = be64_to_cpu(page_0->version);
>  	catalog_page_len = be32_to_cpu(page_0->length);
>  	catalog_len = catalog_page_len * 4096;
>  
> @@ -255,7 +255,7 @@ e_free:								\
>  static DEVICE_ATTR_RO(_name)
>  
>  PAGE_0_ATTR(catalog_version, "%lld\n",
> -		(unsigned long long)be32_to_cpu(page_0->version));
> +		(unsigned long long)be64_to_cpu(page_0->version));
>  PAGE_0_ATTR(catalog_len, "%lld\n",
>  		(unsigned long long)be32_to_cpu(page_0->length) * 4096);
>  static BIN_ATTR_RO(catalog, 0/* real length varies */);



  reply	other threads:[~2014-04-28  4:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-15 17:10 [PATCH v2 0/6] powerpc/perf/hv_{gpci,24x7}: fixes Cody P Schafer
2014-04-15 17:10 ` Cody P Schafer
2014-04-15 17:10 ` [PATCH v2 1/6] powerpc/perf/hv_24x7: probe errors changed to pr_debug(), padding fixed Cody P Schafer
2014-04-15 17:10   ` Cody P Schafer
2014-04-15 17:10 ` [PATCH v2 2/6] powerpc/perf/hv_gpci: probe failures use pr_debug(), and padding reduced Cody P Schafer
2014-04-15 17:10   ` Cody P Schafer
2014-04-15 17:10 ` [PATCH v2 3/6] powerpc/perf/hv-gpci: make device attr static Cody P Schafer
2014-04-15 17:10   ` Cody P Schafer
2014-04-15 17:10 ` [PATCH v2 4/6] powerpc/perf/hv-24x7: use (unsigned long) not (u32) values when calling plpar_hcall_norets() Cody P Schafer
2014-04-15 17:10   ` Cody P Schafer
2014-04-15 17:10 ` [PATCH v2 5/6] powerpc/perf/hv-24x7: remove [static 4096], sparse chokes on it Cody P Schafer
2014-04-15 17:10   ` Cody P Schafer
2014-04-15 17:10 ` [PATCH v2 6/6] powerpc/perf/hv-24x7: catalog version number is be64, not be32 Cody P Schafer
2014-04-15 17:10   ` Cody P Schafer
2014-04-28  4:47   ` Benjamin Herrenschmidt [this message]
2014-04-28  4:47     ` Benjamin Herrenschmidt
2014-04-28  4:59     ` Cody P Schafer
2014-04-28  4:59       ` Cody P Schafer
2014-04-29  3:12       ` Michael Ellerman
2014-04-29  3:12         ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1398660478.30694.10.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=David.Laight@aculab.com \
    --cc=anton@samba.org \
    --cc=cody@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=michael@ellerman.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.