Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

video/macfb: Remove redundant code

The value of info->var.bits_per_pixel get checked in macfb_setcolreg().
Remove additional checks as they are redundant.

macfb_defined.activate gets initialized to FB_ACTIVATE_NOW by the struct
initializer. Remove redundant assignments.

macfb_defined.bits_per_pixel, .width and .height all get assigned
unconditionally. Remove redundant initializers.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Tested-by: Stan Johnson <userm57@yahoo.com>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

authored by

Finn Thain and committed by
Bartlomiej Zolnierkiewicz
e4995b12 3f984342

-24
-24
drivers/video/fbdev/macfb.c
··· 120 120 #define PIXEL_TO_MM(a) (((a)*10)/28) /* width in mm at 72 dpi */ 121 121 122 122 static struct fb_var_screeninfo macfb_defined = { 123 - .bits_per_pixel = 8, 124 123 .activate = FB_ACTIVATE_NOW, 125 - .width = -1, 126 - .height = -1, 127 124 .right_margin = 32, 128 125 .upper_margin = 16, 129 126 .lower_margin = 4, ··· 198 201 unsigned int bpp = info->var.bits_per_pixel; 199 202 unsigned long flags; 200 203 201 - if (bpp > 8) 202 - return 1; /* failsafe */ 203 - 204 204 local_irq_save(flags); 205 205 206 206 /* On these chips, the CLUT register numbers are spread out ··· 227 233 struct fb_info *info) 228 234 { 229 235 unsigned long flags; 230 - 231 - if (info->var.bits_per_pixel > 8) 232 - return 1; /* failsafe */ 233 236 234 237 local_irq_save(flags); 235 238 ··· 344 353 unsigned long flags; 345 354 int clut_status; 346 355 347 - if (info->var.bits_per_pixel > 8) 348 - return 1; /* failsafe */ 349 - 350 356 local_irq_save(flags); 351 357 352 358 /* Set the register address */ ··· 676 688 case NUBUS_DRHW_APPLE_MDC: 677 689 strcpy(macfb_fix.id, "Mac Disp. Card"); 678 690 macfb_setpalette = mdc_setpalette; 679 - macfb_defined.activate = FB_ACTIVATE_NOW; 680 691 break; 681 692 case NUBUS_DRHW_APPLE_TFB: 682 693 strcpy(macfb_fix.id, "Toby"); 683 694 macfb_setpalette = toby_setpalette; 684 - macfb_defined.activate = FB_ACTIVATE_NOW; 685 695 break; 686 696 case NUBUS_DRHW_APPLE_JET: 687 697 strcpy(macfb_fix.id, "Jet"); 688 698 macfb_setpalette = jet_setpalette; 689 - macfb_defined.activate = FB_ACTIVATE_NOW; 690 699 break; 691 700 default: 692 701 strcpy(macfb_fix.id, "Generic NuBus"); ··· 716 731 strcpy(macfb_fix.id, "DAFB"); 717 732 macfb_setpalette = dafb_setpalette; 718 733 dafb_cmap_regs = ioremap(DAFB_BASE, 0x1000); 719 - macfb_defined.activate = FB_ACTIVATE_NOW; 720 734 break; 721 735 722 736 /* ··· 725 741 strcpy(macfb_fix.id, "V8"); 726 742 macfb_setpalette = v8_brazil_setpalette; 727 743 v8_brazil_cmap_regs = ioremap(DAC_BASE, 0x1000); 728 - macfb_defined.activate = FB_ACTIVATE_NOW; 729 744 break; 730 745 731 746 /* ··· 738 755 strcpy(macfb_fix.id, "Brazil"); 739 756 macfb_setpalette = v8_brazil_setpalette; 740 757 v8_brazil_cmap_regs = ioremap(DAC_BASE, 0x1000); 741 - macfb_defined.activate = FB_ACTIVATE_NOW; 742 758 break; 743 759 744 760 /* ··· 754 772 strcpy(macfb_fix.id, "Sonora"); 755 773 macfb_setpalette = v8_brazil_setpalette; 756 774 v8_brazil_cmap_regs = ioremap(DAC_BASE, 0x1000); 757 - macfb_defined.activate = FB_ACTIVATE_NOW; 758 775 break; 759 776 760 777 /* ··· 766 785 strcpy(macfb_fix.id, "RBV"); 767 786 macfb_setpalette = rbv_setpalette; 768 787 rbv_cmap_regs = ioremap(DAC_BASE, 0x1000); 769 - macfb_defined.activate = FB_ACTIVATE_NOW; 770 788 break; 771 789 772 790 /* ··· 776 796 strcpy(macfb_fix.id, "Civic"); 777 797 macfb_setpalette = civic_setpalette; 778 798 civic_cmap_regs = ioremap(CIVIC_BASE, 0x1000); 779 - macfb_defined.activate = FB_ACTIVATE_NOW; 780 799 break; 781 800 782 801 ··· 789 810 macfb_setpalette = v8_brazil_setpalette; 790 811 v8_brazil_cmap_regs = 791 812 ioremap(DAC_BASE, 0x1000); 792 - macfb_defined.activate = FB_ACTIVATE_NOW; 793 813 } 794 814 break; 795 815 ··· 801 823 macfb_setpalette = v8_brazil_setpalette; 802 824 v8_brazil_cmap_regs = 803 825 ioremap(DAC_BASE, 0x1000); 804 - macfb_defined.activate = FB_ACTIVATE_NOW; 805 826 } 806 827 break; 807 828 ··· 869 892 strcpy(macfb_fix.id, "CSC"); 870 893 macfb_setpalette = csc_setpalette; 871 894 csc_cmap_regs = ioremap(CSC_BASE, 0x1000); 872 - macfb_defined.activate = FB_ACTIVATE_NOW; 873 895 break; 874 896 875 897 default: