mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] radeon_agp_init fixes
@ 2010-01-30 20:51 John Kacur
  2010-01-30 20:51 ` [PATCH] radeon_agp: Fix warning, format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’ John Kacur
  2010-01-30 20:51 ` [PATCH] radeon_agp: Move the check of the aper_size after drm_acp_acquire and drm_agp_info John Kacur
  0 siblings, 2 replies; 5+ messages in thread
From: John Kacur @ 2010-01-30 20:51 UTC (permalink / raw)
  To: linux-kernel
  Cc: Linus Torvalds, Johannes Hirte, Kevin Winchester, Dave Airlie,
	dri-devel, Alex Deucher, Jerome Glisse, Ingo Molnar,
	FUJITA Tomonori, John Kacur

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 350 bytes --]

radeon_agp_init fixes

John Kacur (2):

  radeon_agp: Fix warning, format ‘%d’ expects type ‘int’, but argument
    4 has type ‘size_t’

  radeon_agp: Move the check of the aper_size after drm_acp_acquire and
    drm_agp_info

 drivers/gpu/drm/radeon/radeon_agp.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)


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

* [PATCH] radeon_agp: Fix warning, format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’
  2010-01-30 20:51 [PATCH] radeon_agp_init fixes John Kacur
@ 2010-01-30 20:51 ` John Kacur
  2010-01-31 19:02   ` Dan Nicholson
  2010-01-30 20:51 ` [PATCH] radeon_agp: Move the check of the aper_size after drm_acp_acquire and drm_agp_info John Kacur
  1 sibling, 1 reply; 5+ messages in thread
From: John Kacur @ 2010-01-30 20:51 UTC (permalink / raw)
  To: linux-kernel
  Cc: Linus Torvalds, Johannes Hirte, Kevin Winchester, Dave Airlie,
	dri-devel, Alex Deucher, Jerome Glisse, Ingo Molnar,
	FUJITA Tomonori, John Kacur

Fix warning by using %zu instead of %d for size_t

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 drivers/gpu/drm/radeon/radeon_agp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_agp.c b/drivers/gpu/drm/radeon/radeon_agp.c
index c9ad7f5..1c4e523 100644
--- a/drivers/gpu/drm/radeon/radeon_agp.c
+++ b/drivers/gpu/drm/radeon/radeon_agp.c
@@ -134,7 +134,7 @@ int radeon_agp_init(struct radeon_device *rdev)
 	int ret;
 
 	if (rdev->ddev->agp->agp_info.aper_size < 32) {
-		dev_warn(rdev->dev, "AGP aperture to small (%dM) "
+		dev_warn(rdev->dev, "AGP aperture to small (%zuM) "
 			"need at least 32M, disabling AGP\n",
 			rdev->ddev->agp->agp_info.aper_size);
 		return -EINVAL;
-- 
1.6.0.6


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

* [PATCH] radeon_agp: Move the check of the aper_size after drm_acp_acquire and drm_agp_info
  2010-01-30 20:51 [PATCH] radeon_agp_init fixes John Kacur
  2010-01-30 20:51 ` [PATCH] radeon_agp: Fix warning, format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’ John Kacur
@ 2010-01-30 20:51 ` John Kacur
  1 sibling, 0 replies; 5+ messages in thread
From: John Kacur @ 2010-01-30 20:51 UTC (permalink / raw)
  To: linux-kernel
  Cc: Linus Torvalds, Johannes Hirte, Kevin Winchester, Dave Airlie,
	dri-devel, Alex Deucher, Jerome Glisse, Ingo Molnar,
	FUJITA Tomonori, John Kacur

First call drm_agp_acquire to check if agp has been acquired.
Second call drm_agp_info to fill in the info data struct, including aper_size.
Finally do the check to see if the aper_size makes sense.

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 drivers/gpu/drm/radeon/radeon_agp.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_agp.c b/drivers/gpu/drm/radeon/radeon_agp.c
index 1c4e523..ad168ee 100644
--- a/drivers/gpu/drm/radeon/radeon_agp.c
+++ b/drivers/gpu/drm/radeon/radeon_agp.c
@@ -133,13 +133,6 @@ int radeon_agp_init(struct radeon_device *rdev)
 	bool is_v3;
 	int ret;
 
-	if (rdev->ddev->agp->agp_info.aper_size < 32) {
-		dev_warn(rdev->dev, "AGP aperture to small (%zuM) "
-			"need at least 32M, disabling AGP\n",
-			rdev->ddev->agp->agp_info.aper_size);
-		return -EINVAL;
-	}
-
 	/* Acquire AGP. */
 	if (!rdev->ddev->agp->acquired) {
 		ret = drm_agp_acquire(rdev->ddev);
@@ -154,6 +147,14 @@ int radeon_agp_init(struct radeon_device *rdev)
 		DRM_ERROR("Unable to get AGP info: %d\n", ret);
 		return ret;
 	}
+
+	if (rdev->ddev->agp->agp_info.aper_size < 32) {
+		dev_warn(rdev->dev, "AGP aperture to small (%zuM) "
+			"need at least 32M, disabling AGP\n",
+			rdev->ddev->agp->agp_info.aper_size);
+		return -EINVAL;
+	}
+
 	mode.mode = info.mode;
 	agp_status = (RREG32(RADEON_AGP_STATUS) | RADEON_AGPv3_MODE) & mode.mode;
 	is_v3 = !!(agp_status & RADEON_AGPv3_MODE);
-- 
1.6.0.6


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

* Re: [PATCH] radeon_agp: Fix warning, format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’
  2010-01-30 20:51 ` [PATCH] radeon_agp: Fix warning, format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’ John Kacur
@ 2010-01-31 19:02   ` Dan Nicholson
  2010-01-31 19:29     ` John Kacur
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Nicholson @ 2010-01-31 19:02 UTC (permalink / raw)
  To: John Kacur
  Cc: linux-kernel, Dave Airlie, FUJITA Tomonori, Jerome Glisse,
	Johannes Hirte, dri-devel, Alex Deucher, Kevin Winchester,
	Linus Torvalds, Ingo Molnar

On Sat, Jan 30, 2010 at 12:51 PM, John Kacur <jkacur@redhat.com> wrote:
> Fix warning by using %zu instead of %d for size_t
>
> Signed-off-by: John Kacur <jkacur@redhat.com>
> ---
>  drivers/gpu/drm/radeon/radeon_agp.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_agp.c b/drivers/gpu/drm/radeon/radeon_agp.c
> index c9ad7f5..1c4e523 100644
> --- a/drivers/gpu/drm/radeon/radeon_agp.c
> +++ b/drivers/gpu/drm/radeon/radeon_agp.c
> @@ -134,7 +134,7 @@ int radeon_agp_init(struct radeon_device *rdev)
>        int ret;
>
>        if (rdev->ddev->agp->agp_info.aper_size < 32) {
> -               dev_warn(rdev->dev, "AGP aperture to small (%dM) "
> +               dev_warn(rdev->dev, "AGP aperture to small (%zuM) "

As long as you're fixing this line, you might want to correct the
grammar s/to/too/.

--
Dan

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

* Re: [PATCH] radeon_agp: Fix warning, format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’
  2010-01-31 19:02   ` Dan Nicholson
@ 2010-01-31 19:29     ` John Kacur
  0 siblings, 0 replies; 5+ messages in thread
From: John Kacur @ 2010-01-31 19:29 UTC (permalink / raw)
  To: Dan Nicholson
  Cc: linux-kernel, Dave Airlie, FUJITA Tomonori, Jerome Glisse,
	Johannes Hirte, dri-devel, Alex Deucher, Kevin Winchester,
	Linus Torvalds, Ingo Molnar

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1191 bytes --]



On Sun, 31 Jan 2010, Dan Nicholson wrote:

> On Sat, Jan 30, 2010 at 12:51 PM, John Kacur <jkacur@redhat.com> wrote:
> > Fix warning by using %zu instead of %d for size_t
> >
> > Signed-off-by: John Kacur <jkacur@redhat.com>
> > ---
> >  drivers/gpu/drm/radeon/radeon_agp.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/radeon/radeon_agp.c b/drivers/gpu/drm/radeon/radeon_agp.c
> > index c9ad7f5..1c4e523 100644
> > --- a/drivers/gpu/drm/radeon/radeon_agp.c
> > +++ b/drivers/gpu/drm/radeon/radeon_agp.c
> > @@ -134,7 +134,7 @@ int radeon_agp_init(struct radeon_device *rdev)
> >        int ret;
> >
> >        if (rdev->ddev->agp->agp_info.aper_size < 32) {
> > -               dev_warn(rdev->dev, "AGP aperture to small (%dM) "
> > +               dev_warn(rdev->dev, "AGP aperture to small (%zuM) "
> 
> As long as you're fixing this line, you might want to correct the
> grammar s/to/too/.

Thanks, I saw that too, after I sent. Unfortunately, I have to respin both 
patches, because there is a merge conflict after fixing the 
grammar/spelling mistake.

Both patches coming up, in a separate mail.

John

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

end of thread, other threads:[~2010-01-31 19:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-30 20:51 [PATCH] radeon_agp_init fixes John Kacur
2010-01-30 20:51 ` [PATCH] radeon_agp: Fix warning, format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’ John Kacur
2010-01-31 19:02   ` Dan Nicholson
2010-01-31 19:29     ` John Kacur
2010-01-30 20:51 ` [PATCH] radeon_agp: Move the check of the aper_size after drm_acp_acquire and drm_agp_info John Kacur

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

all inboxes | Powered by JetHome®