summaryrefslogtreecommitdiffstats
path: root/drivers/staging/sm7xx
diff options
context:
space:
mode:
authoranish kumar <anish198519851985@gmail.com>2011-05-19 20:58:42 +0530
committerGreg Kroah-Hartman <gregkh@suse.de>2011-05-19 15:34:31 -0700
commit1639c8ab4857f18f59222141777c8db931071785 (patch)
tree9b4a6b47416ac13651b756078195cecf0e32da41 /drivers/staging/sm7xx
parent2d9903621dbfa6524e7e98fded2fae31ef09f484 (diff)
downloadblackbird-op-linux-1639c8ab4857f18f59222141777c8db931071785.tar.gz
blackbird-op-linux-1639c8ab4857f18f59222141777c8db931071785.zip
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.c7
-rw-r--r--drivers/staging/sm7xx/smtcfb.h7
2 files changed, 4 insertions, 10 deletions
diff --git a/drivers/staging/sm7xx/smtcfb.c b/drivers/staging/sm7xx/smtcfb.c
index 94cb4e8dcaf7..1aca0cb40caf 100644
--- a/drivers/staging/sm7xx/smtcfb.c
+++ b/drivers/staging/sm7xx/smtcfb.c
@@ -128,7 +128,7 @@ u16 smtc_ChipIDs[] = {
0x720
};
-#define numSMTCchipIDs (sizeof(smtc_ChipIDs) / sizeof(u16))
+#define numSMTCchipIDs ARRAY_SIZE(smtc_ChipIDs)
static struct fb_var_screeninfo smtcfb_var = {
.xres = 1024,
@@ -842,7 +842,7 @@ static int __init sm712vga_setup(char *options)
smdbg("\nsm712vga_setup = %s\n", options);
for (index = 0;
- index < (sizeof(vesa_mode) / sizeof(struct vesa_mode_table));
+ index < ARRAY_SIZE(vesa_mode);
index++) {
if (strstr(options, vesa_mode[index].mode_index)) {
smtc_screen_info.lfb_width = vesa_mode[index].lfb_width;
@@ -876,7 +876,6 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev,
err = pci_enable_device(pdev); /* enable SMTC chip */
if (err)
return err;
- err = -ENOMEM;
hw.chipID = ent->device;
sprintf(name, "sm%Xfb", hw.chipID);
@@ -1006,7 +1005,7 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev,
return 0;
- failed:
+failed:
printk(KERN_INFO "Silicon Motion, Inc. primary display init fail\n");
smtc_unmap_smem(sfb);
diff --git a/drivers/staging/sm7xx/smtcfb.h b/drivers/staging/sm7xx/smtcfb.h
index 0c113835b85c..c5e6989e65ab 100644
--- a/drivers/staging/sm7xx/smtcfb.h
+++ b/drivers/staging/sm7xx/smtcfb.h
@@ -30,11 +30,6 @@
#define SCREEN_Y_RES 600
#define SCREEN_BPP 16
-#ifndef FIELD_OFFSET
-#define FIELD_OFSFET(type, field) \
- ((unsigned long) (PUCHAR) & (((type *)0)->field))
-#endif
-
/*Assume SM712 graphics chip has 4MB VRAM */
#define SM712_VIDEOMEMORYSIZE 0x00400000
/*Assume SM722 graphics chip has 8MB VRAM */
@@ -790,4 +785,4 @@ struct ModeInit VGAMode[] = {
},
};
-#define numVGAModes (sizeof(VGAMode) / sizeof(struct ModeInit))
+#define numVGAModes ARRAY_SIZE(VGAMode)
OpenPOWER on IntegriCloud