linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH] fbdev: Make pixel_to_pat() failure mode more friendly
Date: Sun, 29 Jul 2012 21:16:25 +0000	[thread overview]
Message-ID: <5015A829.1090503@gmx.de> (raw)
In-Reply-To: <1343117953.3715.23.camel@pasglop>

On 07/24/2012 08:19 AM, Benjamin Herrenschmidt wrote:
> If we accidentally pass an incorrect bpp value to pixel_to_pat(),
> it panics. This is pretty useless, as we generally have the various
> console locks held at that point, so nothing will be displayed,
> and there is no reason to make this a fatal event.
> 
> Let's WARN instead.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Applied.


Thanks,

Florian Tobias Schandinat

> ---
> 
> diff --git a/drivers/video/fb_draw.h b/drivers/video/fb_draw.h
> index 04c01fa..624ee11 100644
> --- a/drivers/video/fb_draw.h
> +++ b/drivers/video/fb_draw.h
> @@ -3,6 +3,7 @@
>  
>  #include <asm/types.h>
>  #include <linux/fb.h>
> +#include <linux/bug.h>
>  
>      /*
>       *  Compose two values, using a bitmask as decision value
> @@ -41,7 +42,8 @@ pixel_to_pat( u32 bpp, u32 pixel)
>  	case 32:
>  		return 0x0000000100000001ul*pixel;
>  	default:
> -		panic("pixel_to_pat(): unsupported pixelformat\n");
> +		WARN(1, "pixel_to_pat(): unsupported pixelformat %d\n", bpp);
> +		return 0;
>      }
>  }
>  #else
> @@ -66,7 +68,8 @@ pixel_to_pat( u32 bpp, u32 pixel)
>  	case 32:
>  		return 0x00000001ul*pixel;
>  	default:
> -		panic("pixel_to_pat(): unsupported pixelformat\n");
> +		WARN(1, "pixel_to_pat(): unsupported pixelformat %d\n", bpp);
> +		return 0;
>      }
>  }
>  #endif
> 
> 
> 


      reply	other threads:[~2012-07-29 21:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-24  8:19 [PATCH] fbdev: Make pixel_to_pat() failure mode more friendly Benjamin Herrenschmidt
2012-07-29 21:16 ` Florian Tobias Schandinat [this message]

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=5015A829.1090503@gmx.de \
    --to=florianschandinat@gmx.de \
    --cc=linux-fbdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).