diff options
author | anish kumar <anish198519851985@gmail.com> | 2011-05-19 11:28:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-19 18:34:31 -0400 |
commit | 1639c8ab4857f18f59222141777c8db931071785 (patch) | |
tree | 9b4a6b47416ac13651b756078195cecf0e32da41 /drivers/staging/sm7xx | |
parent | 2d9903621dbfa6524e7e98fded2fae31ef09f484 (diff) |
Staging: sm7xx: removing extra white spaces,redundant code and using macros
This patch is to remove extra spaces,redundant code and using
ARRAY_SIZE macros.
Signed-off-by: anish kumar <anish198519851985@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/sm7xx')
-rw-r--r-- | drivers/staging/sm7xx/smtcfb.c | 7 | ||||
-rw-r--r-- | drivers/staging/sm7xx/smtcfb.h | 7 |
2 files changed, 4 insertions, 10 deletions
diff --git a/drivers/staging/sm7xx/smtcfb.c b/drivers/staging/sm7xx/smtcfb.c index 94cb4e8dcaf..1aca0cb40ca 100644 --- a/drivers/staging/sm7xx/smtcfb.c +++ b/drivers/staging/sm7xx/smtcfb.c | |||
@@ -128,7 +128,7 @@ u16 smtc_ChipIDs[] = { | |||
128 | 0x720 | 128 | 0x720 |
129 | }; | 129 | }; |
130 | 130 | ||
131 | #define numSMTCchipIDs (sizeof(smtc_ChipIDs) / sizeof(u16)) | 131 | #define numSMTCchipIDs ARRAY_SIZE(smtc_ChipIDs) |
132 | 132 | ||
133 | static struct fb_var_screeninfo smtcfb_var = { | 133 | static struct fb_var_screeninfo smtcfb_var = { |
134 | .xres = 1024, | 134 | .xres = 1024, |
@@ -842,7 +842,7 @@ static int __init sm712vga_setup(char *options) | |||
842 | smdbg("\nsm712vga_setup = %s\n", options); | 842 | smdbg("\nsm712vga_setup = %s\n", options); |
843 | 843 | ||
844 | for (index = 0; | 844 | for (index = 0; |
845 | index < (sizeof(vesa_mode) / sizeof(struct vesa_mode_table)); | 845 | index < ARRAY_SIZE(vesa_mode); |
846 | index++) { | 846 | index++) { |
847 | if (strstr(options, vesa_mode[index].mode_index)) { | 847 | if (strstr(options, vesa_mode[index].mode_index)) { |
848 | smtc_screen_info.lfb_width = vesa_mode[index].lfb_width; | 848 | smtc_screen_info.lfb_width = vesa_mode[index].lfb_width; |
@@ -876,7 +876,6 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev, | |||
876 | err = pci_enable_device(pdev); /* enable SMTC chip */ | 876 | err = pci_enable_device(pdev); /* enable SMTC chip */ |
877 | if (err) | 877 | if (err) |
878 | return err; | 878 | return err; |
879 | err = -ENOMEM; | ||
880 | 879 | ||
881 | hw.chipID = ent->device; | 880 | hw.chipID = ent->device; |
882 | sprintf(name, "sm%Xfb", hw.chipID); | 881 | sprintf(name, "sm%Xfb", hw.chipID); |
@@ -1006,7 +1005,7 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev, | |||
1006 | 1005 | ||
1007 | return 0; | 1006 | return 0; |
1008 | 1007 | ||
1009 | failed: | 1008 | failed: |
1010 | printk(KERN_INFO "Silicon Motion, Inc. primary display init fail\n"); | 1009 | printk(KERN_INFO "Silicon Motion, Inc. primary display init fail\n"); |
1011 | 1010 | ||
1012 | smtc_unmap_smem(sfb); | 1011 | smtc_unmap_smem(sfb); |
diff --git a/drivers/staging/sm7xx/smtcfb.h b/drivers/staging/sm7xx/smtcfb.h index 0c113835b85..c5e6989e65a 100644 --- a/drivers/staging/sm7xx/smtcfb.h +++ b/drivers/staging/sm7xx/smtcfb.h | |||
@@ -30,11 +30,6 @@ | |||
30 | #define SCREEN_Y_RES 600 | 30 | #define SCREEN_Y_RES 600 |
31 | #define SCREEN_BPP 16 | 31 | #define SCREEN_BPP 16 |
32 | 32 | ||
33 | #ifndef FIELD_OFFSET | ||
34 | #define FIELD_OFSFET(type, field) \ | ||
35 | ((unsigned long) (PUCHAR) & (((type *)0)->field)) | ||
36 | #endif | ||
37 | |||
38 | /*Assume SM712 graphics chip has 4MB VRAM */ | 33 | /*Assume SM712 graphics chip has 4MB VRAM */ |
39 | #define SM712_VIDEOMEMORYSIZE 0x00400000 | 34 | #define SM712_VIDEOMEMORYSIZE 0x00400000 |
40 | /*Assume SM722 graphics chip has 8MB VRAM */ | 35 | /*Assume SM722 graphics chip has 8MB VRAM */ |
@@ -790,4 +785,4 @@ struct ModeInit VGAMode[] = { | |||
790 | }, | 785 | }, |
791 | }; | 786 | }; |
792 | 787 | ||
793 | #define numVGAModes (sizeof(VGAMode) / sizeof(struct ModeInit)) | 788 | #define numVGAModes ARRAY_SIZE(VGAMode) |