All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <deathsimple@vodafone.de>
To: Klaus Schnass <devh@devilshawk.net>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/4] drm/radeon: fix and simplify pot argument checks v2
Date: Wed, 24 Oct 2012 17:31:12 +0200	[thread overview]
Message-ID: <508809C0.8030008@vodafone.de> (raw)
In-Reply-To: <3734404.KGNTnGMGHd@kschotri>

On 23.10.2012 18:45, Klaus Schnass wrote:
>> /**
>> + * radeon_check_pot_argument - check that argument is a power of two
>> + *
>> + * @arg: value to check
>> + *
>> + * Validates that a certain argument is a power of two (all asics).
>> + * Returns true if argument is valid.
>> + */
>> +static bool radeon_ckeck_pot_argument(int arg)
>> +{
>> +	return (arg & (arg - 1)) == 0;
>> +}
> comment says  "check_pot_argument" but is called c_K_eck_pot_argument
Good catch, that's indeed a typo.

>
>> +
>> +/**
>>   * radeon_check_arguments - validate module params
>>   *
>>   * @rdev: radeon_device pointer
>> @@ -845,52 +860,25 @@ static unsigned int radeon_vga_set_decode(void *cookie,
> bool state)
>> static void radeon_check_arguments(struct radeon_device *rdev)
>> {
>> 	/* vramlimit must be a power of two */
>> -	switch (radeon_vram_limit) {
>> -	case 0:
>> -	case 4:
>> -	case 8:
>> -	case 16:
>> -	case 32:
>> -	case 64:
>> -	case 128:
>> -	case 256:
>> -	case 512:
>> -	case 1024:
>> -	case 2048:
>> -	case 4096:
>> -		break;
>> -	default:
>> +	if (!radeon_ckeck_pot_argument(radeon_vram_limit)) {
> check_pot_argument is also true for radeon_vram_limit = 1 and 2 which was
> missing from the previous case statement, was that intentional?
Not really, but I don't see a reason why 1 and 2 MB limits shouldn't 
work (if your resolution is low enough).

Christian.

>
> Best regards,
> Klaus
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>

  reply	other threads:[~2012-10-24 15:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23 16:45 [PATCH 1/4] drm/radeon: fix and simplify pot argument checks v2 Klaus Schnass
2012-10-24 15:31 ` Christian König [this message]
2012-10-24 15:38   ` Alex Deucher
  -- strict thread matches above, loose matches on Subject: below --
2012-10-23 13:53 Christian König
2012-10-23 14:02 ` Michel Dänzer

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=508809C0.8030008@vodafone.de \
    --to=deathsimple@vodafone.de \
    --cc=devh@devilshawk.net \
    --cc=dri-devel@lists.freedesktop.org \
    /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.