All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] video: fbmem: Use 'const char' in fb_get_options()
@ 2013-06-18 13:26 Fabio Estevam
  2013-06-18 13:26   ` Fabio Estevam
  2013-06-19  7:33 ` [PATCH 1/2] video: fbmem: Use 'const char' in fb_get_options() Ville Syrjälä
  0 siblings, 2 replies; 6+ messages in thread
From: Fabio Estevam @ 2013-06-18 13:26 UTC (permalink / raw)
  To: linux-fbdev

Commit d20d31748 (drm: Constify the pretty-print functions) causes the following
build warning:

drivers/gpu/drm/drm_fb_helper.c:127:3: warning: passing argument 1 of 'fb_get_options' discards 'const' qualifier from pointer target type [enabled by default]

Let's change the first argument of fb_get_options from 'char *' to 'const char *' 
so that we can get rid of this warning.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/video/fbmem.c | 2 +-
 include/linux/fb.h    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 098bfc6..d8d5779 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1881,7 +1881,7 @@ static int ofonly __read_mostly;
  *
  * NOTE: Needed to maintain backwards compatibility
  */
-int fb_get_options(char *name, char **option)
+int fb_get_options(const char *name, char **option)
 {
 	char *opt, *options = NULL;
 	int retval = 0;
diff --git a/include/linux/fb.h b/include/linux/fb.h
index d49c60f..ffac70a 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -624,7 +624,7 @@ extern void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u3
 extern void fb_set_suspend(struct fb_info *info, int state);
 extern int fb_get_color_depth(struct fb_var_screeninfo *var,
 			      struct fb_fix_screeninfo *fix);
-extern int fb_get_options(char *name, char **option);
+extern int fb_get_options(const char *name, char **option);
 extern int fb_new_modelist(struct fb_info *info);
 
 extern struct fb_info *registered_fb[FB_MAX];
-- 
1.8.1.2



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

* [PATCH 2/2] i915: i915_gem: Print a size_t with %z
  2013-06-18 13:26 [PATCH 1/2] video: fbmem: Use 'const char' in fb_get_options() Fabio Estevam
@ 2013-06-18 13:26   ` Fabio Estevam
  2013-06-19  7:33 ` [PATCH 1/2] video: fbmem: Use 'const char' in fb_get_options() Ville Syrjälä
  1 sibling, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2013-06-18 13:26 UTC (permalink / raw)
  To: plagnioj
  Cc: Fabio Estevam, linux-fbdev, Daniel Vetter, intel-gfx,
	Dave Airlie, festevam

Fix the following build warning:

drivers/gpu/drm/i915/i915_gem.c:3129:3: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'size_t' [-Wformat]

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Airlie <airlied@redhat.com>
Cc: <intel-gfx@lists.freedesktop.org>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 6e469e6..d497ca5 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3126,7 +3126,7 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj,
 	 * before evicting everything in a vain attempt to find space.
 	 */
 	if (obj->base.size > gtt_max) {
-		DRM_ERROR("Attempting to bind an object larger than the aperture: object=%zd > %s aperture=%ld\n",
+		DRM_ERROR("Attempting to bind an object larger than the aperture: object=%zd > %s aperture=%zd\n",
 			  obj->base.size,
 			  map_and_fenceable ? "mappable" : "total",
 			  gtt_max);
-- 
1.8.1.2



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

* [PATCH 2/2] i915: i915_gem: Print a size_t with %z
@ 2013-06-18 13:26   ` Fabio Estevam
  0 siblings, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2013-06-18 13:26 UTC (permalink / raw)
  To: plagnioj
  Cc: Fabio Estevam, linux-fbdev, Daniel Vetter, intel-gfx,
	Dave Airlie, festevam

Fix the following build warning:

drivers/gpu/drm/i915/i915_gem.c:3129:3: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'size_t' [-Wformat]

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Airlie <airlied@redhat.com>
Cc: <intel-gfx@lists.freedesktop.org>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 6e469e6..d497ca5 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3126,7 +3126,7 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj,
 	 * before evicting everything in a vain attempt to find space.
 	 */
 	if (obj->base.size > gtt_max) {
-		DRM_ERROR("Attempting to bind an object larger than the aperture: object=%zd > %s aperture=%ld\n",
+		DRM_ERROR("Attempting to bind an object larger than the aperture: object=%zd > %s aperture=%zd\n",
 			  obj->base.size,
 			  map_and_fenceable ? "mappable" : "total",
 			  gtt_max);
-- 
1.8.1.2

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

* Re: [PATCH 2/2] i915: i915_gem: Print a size_t with %z
  2013-06-18 13:26   ` Fabio Estevam
@ 2013-06-18 14:53     ` Geert Uytterhoeven
  -1 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2013-06-18 14:53 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Linux Fbdev development list, Jean-Christophe PLAGNIOL-VILLARD,
	Intel Graphics Development, Daniel Vetter, Dave Airlie,
	Fabio Estevam

On Tue, Jun 18, 2013 at 3:26 PM, Fabio Estevam
<fabio.estevam@freescale.com> wrote:
> drivers/gpu/drm/i915/i915_gem.c:3129:3: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'size_t' [-Wformat]

> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3126,7 +3126,7 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj,
>          * before evicting everything in a vain attempt to find space.
>          */
>         if (obj->base.size > gtt_max) {
> -               DRM_ERROR("Attempting to bind an object larger than the aperture: object=%zd > %s aperture=%ld\n",
> +               DRM_ERROR("Attempting to bind an object larger than the aperture: object=%zd > %s aperture=%zd\n",

size_t is unsigned, so you better change it to %zu.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 2/2] i915: i915_gem: Print a size_t with %z
@ 2013-06-18 14:53     ` Geert Uytterhoeven
  0 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2013-06-18 14:53 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Linux Fbdev development list, Jean-Christophe PLAGNIOL-VILLARD,
	Intel Graphics Development, Daniel Vetter, Dave Airlie,
	Fabio Estevam

On Tue, Jun 18, 2013 at 3:26 PM, Fabio Estevam
<fabio.estevam@freescale.com> wrote:
> drivers/gpu/drm/i915/i915_gem.c:3129:3: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'size_t' [-Wformat]

> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3126,7 +3126,7 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj,
>          * before evicting everything in a vain attempt to find space.
>          */
>         if (obj->base.size > gtt_max) {
> -               DRM_ERROR("Attempting to bind an object larger than the aperture: object=%zd > %s aperture=%ld\n",
> +               DRM_ERROR("Attempting to bind an object larger than the aperture: object=%zd > %s aperture=%zd\n",

size_t is unsigned, so you better change it to %zu.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 1/2] video: fbmem: Use 'const char' in fb_get_options()
  2013-06-18 13:26 [PATCH 1/2] video: fbmem: Use 'const char' in fb_get_options() Fabio Estevam
  2013-06-18 13:26   ` Fabio Estevam
@ 2013-06-19  7:33 ` Ville Syrjälä
  1 sibling, 0 replies; 6+ messages in thread
From: Ville Syrjälä @ 2013-06-19  7:33 UTC (permalink / raw)
  To: linux-fbdev

On Tue, Jun 18, 2013 at 10:26:27AM -0300, Fabio Estevam wrote:
> Commit d20d31748 (drm: Constify the pretty-print functions) causes the following
> build warning:
> 
> drivers/gpu/drm/drm_fb_helper.c:127:3: warning: passing argument 1 of 'fb_get_options' discards 'const' qualifier from pointer target type [enabled by default]
> 
> Let's change the first argument of fb_get_options from 'char *' to 'const char *' 
> so that we can get rid of this warning.

I already sent the same patch alongside the drm constify patches. It
just needs to trickle back into the drm tree via the fbdev folks.

> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Dave Airlie <airlied@redhat.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  drivers/video/fbmem.c | 2 +-
>  include/linux/fb.h    | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
> index 098bfc6..d8d5779 100644
> --- a/drivers/video/fbmem.c
> +++ b/drivers/video/fbmem.c
> @@ -1881,7 +1881,7 @@ static int ofonly __read_mostly;
>   *
>   * NOTE: Needed to maintain backwards compatibility
>   */
> -int fb_get_options(char *name, char **option)
> +int fb_get_options(const char *name, char **option)
>  {
>  	char *opt, *options = NULL;
>  	int retval = 0;
> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index d49c60f..ffac70a 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -624,7 +624,7 @@ extern void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u3
>  extern void fb_set_suspend(struct fb_info *info, int state);
>  extern int fb_get_color_depth(struct fb_var_screeninfo *var,
>  			      struct fb_fix_screeninfo *fix);
> -extern int fb_get_options(char *name, char **option);
> +extern int fb_get_options(const char *name, char **option);
>  extern int fb_new_modelist(struct fb_info *info);
>  
>  extern struct fb_info *registered_fb[FB_MAX];
> -- 
> 1.8.1.2
> 

-- 
Ville Syrjälä
Intel OTC

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

end of thread, other threads:[~2013-06-19  7:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-18 13:26 [PATCH 1/2] video: fbmem: Use 'const char' in fb_get_options() Fabio Estevam
2013-06-18 13:26 ` [PATCH 2/2] i915: i915_gem: Print a size_t with %z Fabio Estevam
2013-06-18 13:26   ` Fabio Estevam
2013-06-18 14:53   ` Geert Uytterhoeven
2013-06-18 14:53     ` Geert Uytterhoeven
2013-06-19  7:33 ` [PATCH 1/2] video: fbmem: Use 'const char' in fb_get_options() Ville Syrjälä

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.