Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9791d763 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds
Browse files

[PATCH] fbdev modedb: make more pointer parameters const



fbdev modedb: make more input and output pointer parameters const

Signed-off-by: default avatarGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: James Simmons <jsimmons@infradead.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5c52cbeb
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -2071,7 +2071,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width,
	y_diff = info->var.yres - var.yres;
	y_diff = info->var.yres - var.yres;
	if (x_diff < 0 || x_diff > virt_fw ||
	if (x_diff < 0 || x_diff > virt_fw ||
	    y_diff < 0 || y_diff > virt_fh) {
	    y_diff < 0 || y_diff > virt_fh) {
		struct fb_videomode *mode;
		const struct fb_videomode *mode;


		DPRINTK("attempting resize %ix%i\n", var.xres, var.yres);
		DPRINTK("attempting resize %ix%i\n", var.xres, var.yres);
		mode = fb_find_best_mode(&var, &info->modelist);
		mode = fb_find_best_mode(&var, &info->modelist);
@@ -2975,7 +2975,7 @@ static void fbcon_new_modelist(struct fb_info *info)
	int i;
	int i;
	struct vc_data *vc;
	struct vc_data *vc;
	struct fb_var_screeninfo var;
	struct fb_var_screeninfo var;
	struct fb_videomode *mode;
	const struct fb_videomode *mode;


	for (i = first_fb_vc; i <= last_fb_vc; i++) {
	for (i = first_fb_vc; i <= last_fb_vc; i++) {
		if (registered_fb[con2fb_map[i]] != info)
		if (registered_fb[con2fb_map[i]] != info)
+1 −1
Original line number Original line Diff line number Diff line
@@ -48,7 +48,7 @@ struct display {
    struct fb_bitfield green;
    struct fb_bitfield green;
    struct fb_bitfield blue;
    struct fb_bitfield blue;
    struct fb_bitfield transp;
    struct fb_bitfield transp;
    struct fb_videomode *mode;
    const struct fb_videomode *mode;
};
};


struct fbcon_ops {
struct fbcon_ops {
+1 −1
Original line number Original line Diff line number Diff line
@@ -175,7 +175,7 @@ static ssize_t store_modes(struct device *device,


	acquire_console_sem();
	acquire_console_sem();
	list_splice(&fb_info->modelist, &old_list);
	list_splice(&fb_info->modelist, &old_list);
	fb_videomode_to_modelist((struct fb_videomode *)buf, i,
	fb_videomode_to_modelist((const struct fb_videomode *)buf, i,
				 &fb_info->modelist);
				 &fb_info->modelist);
	if (fb_new_modelist(fb_info)) {
	if (fb_new_modelist(fb_info)) {
		fb_destroy_modelist(&fb_info->modelist);
		fb_destroy_modelist(&fb_info->modelist);
+2 −2
Original line number Original line Diff line number Diff line
@@ -1049,7 +1049,7 @@ static int i810_check_params(struct fb_var_screeninfo *var,
		mode_valid = 1;
		mode_valid = 1;


	if (!mode_valid && info->monspecs.modedb_len) {
	if (!mode_valid && info->monspecs.modedb_len) {
		struct fb_videomode *mode;
		const struct fb_videomode *mode;


		mode = fb_find_best_mode(var, &info->modelist);
		mode = fb_find_best_mode(var, &info->modelist);
		if (mode) {
		if (mode) {
@@ -1924,7 +1924,7 @@ static void __devinit i810fb_find_init_mode(struct fb_info *info)
	fb_videomode_to_modelist(specs->modedb, specs->modedb_len,
	fb_videomode_to_modelist(specs->modedb, specs->modedb_len,
				 &info->modelist);
				 &info->modelist);
	if (specs->modedb != NULL) {
	if (specs->modedb != NULL) {
		struct fb_videomode *m;
		const struct fb_videomode *m;


		if (xres && yres) {
		if (xres && yres) {
			if ((m = fb_find_best_mode(&var, &info->modelist))) {
			if ((m = fb_find_best_mode(&var, &info->modelist))) {
+17 −16
Original line number Original line Diff line number Diff line
@@ -668,7 +668,7 @@ int fb_find_mode(struct fb_var_screeninfo *var,
 * @var: pointer to struct fb_var_screeninfo
 * @var: pointer to struct fb_var_screeninfo
 */
 */
void fb_var_to_videomode(struct fb_videomode *mode,
void fb_var_to_videomode(struct fb_videomode *mode,
			 struct fb_var_screeninfo *var)
			 const struct fb_var_screeninfo *var)
{
{
	u32 pixclock, hfreq, htotal, vtotal;
	u32 pixclock, hfreq, htotal, vtotal;


@@ -712,7 +712,7 @@ void fb_var_to_videomode(struct fb_videomode *mode,
 * @mode: pointer to struct fb_videomode
 * @mode: pointer to struct fb_videomode
 */
 */
void fb_videomode_to_var(struct fb_var_screeninfo *var,
void fb_videomode_to_var(struct fb_var_screeninfo *var,
			       struct fb_videomode *mode)
			 const struct fb_videomode *mode)
{
{
	var->xres = mode->xres;
	var->xres = mode->xres;
	var->yres = mode->yres;
	var->yres = mode->yres;
@@ -735,8 +735,8 @@ void fb_videomode_to_var(struct fb_var_screeninfo *var,
 * RETURNS:
 * RETURNS:
 * 1 if equal, 0 if not
 * 1 if equal, 0 if not
 */
 */
int fb_mode_is_equal(struct fb_videomode *mode1,
int fb_mode_is_equal(const struct fb_videomode *mode1,
		     struct fb_videomode *mode2)
		     const struct fb_videomode *mode2)
{
{
	return (mode1->xres         == mode2->xres &&
	return (mode1->xres         == mode2->xres &&
		mode1->yres         == mode2->yres &&
		mode1->yres         == mode2->yres &&
@@ -768,7 +768,7 @@ int fb_mode_is_equal(struct fb_videomode *mode1,
 * var->xres and var->yres.  If more than 1 videomode is found, will return
 * var->xres and var->yres.  If more than 1 videomode is found, will return
 * the videomode with the highest refresh rate
 * the videomode with the highest refresh rate
 */
 */
struct fb_videomode *fb_find_best_mode(struct fb_var_screeninfo *var,
const struct fb_videomode *fb_find_best_mode(const struct fb_var_screeninfo *var,
					     struct list_head *head)
					     struct list_head *head)
{
{
	struct list_head *pos;
	struct list_head *pos;
@@ -806,7 +806,7 @@ struct fb_videomode *fb_find_best_mode(struct fb_var_screeninfo *var,
 * If more than 1 videomode is found, will return the videomode with
 * If more than 1 videomode is found, will return the videomode with
 * the closest refresh rate.
 * the closest refresh rate.
 */
 */
struct fb_videomode *fb_find_nearest_mode(struct fb_videomode *mode,
const struct fb_videomode *fb_find_nearest_mode(const struct fb_videomode *mode,
					        struct list_head *head)
					        struct list_head *head)
{
{
	struct list_head *pos;
	struct list_head *pos;
@@ -845,7 +845,7 @@ struct fb_videomode *fb_find_nearest_mode(struct fb_videomode *mode,
 * RETURNS:
 * RETURNS:
 * struct fb_videomode, NULL if none found
 * struct fb_videomode, NULL if none found
 */
 */
struct fb_videomode *fb_match_mode(struct fb_var_screeninfo *var,
const struct fb_videomode *fb_match_mode(const struct fb_var_screeninfo *var,
					 struct list_head *head)
					 struct list_head *head)
{
{
	struct list_head *pos;
	struct list_head *pos;
@@ -870,7 +870,7 @@ struct fb_videomode *fb_match_mode(struct fb_var_screeninfo *var,
 * NOTES:
 * NOTES:
 * Will only add unmatched mode entries
 * Will only add unmatched mode entries
 */
 */
int fb_add_videomode(struct fb_videomode *mode, struct list_head *head)
int fb_add_videomode(const struct fb_videomode *mode, struct list_head *head)
{
{
	struct list_head *pos;
	struct list_head *pos;
	struct fb_modelist *modelist;
	struct fb_modelist *modelist;
@@ -905,7 +905,8 @@ int fb_add_videomode(struct fb_videomode *mode, struct list_head *head)
 * NOTES:
 * NOTES:
 * Will remove all matching mode entries
 * Will remove all matching mode entries
 */
 */
void fb_delete_videomode(struct fb_videomode *mode, struct list_head *head)
void fb_delete_videomode(const struct fb_videomode *mode,
			 struct list_head *head)
{
{
	struct list_head *pos, *n;
	struct list_head *pos, *n;
	struct fb_modelist *modelist;
	struct fb_modelist *modelist;
@@ -941,7 +942,7 @@ void fb_destroy_modelist(struct list_head *head)
 * @num: number of entries in array
 * @num: number of entries in array
 * @head: struct list_head of modelist
 * @head: struct list_head of modelist
 */
 */
void fb_videomode_to_modelist(struct fb_videomode *modedb, int num,
void fb_videomode_to_modelist(const struct fb_videomode *modedb, int num,
			      struct list_head *head)
			      struct list_head *head)
{
{
	int i;
	int i;
@@ -954,12 +955,12 @@ void fb_videomode_to_modelist(struct fb_videomode *modedb, int num,
	}
	}
}
}


struct fb_videomode *fb_find_best_display(struct fb_monspecs *specs,
const struct fb_videomode *fb_find_best_display(const struct fb_monspecs *specs,
					        struct list_head *head)
					        struct list_head *head)
{
{
	struct list_head *pos;
	struct list_head *pos;
	struct fb_modelist *modelist;
	struct fb_modelist *modelist;
	struct fb_videomode *m, *m1 = NULL, *md = NULL, *best = NULL;
	const struct fb_videomode *m, *m1 = NULL, *md = NULL, *best = NULL;
	int first = 0;
	int first = 0;


	if (!head->prev || !head->next || list_empty(head))
	if (!head->prev || !head->next || list_empty(head))
Loading