0x720
};
-#define numSMTCchipIDs (sizeof(smtc_ChipIDs) / sizeof(u16))
+#define numSMTCchipIDs ARRAY_SIZE(smtc_ChipIDs)
static struct fb_var_screeninfo smtcfb_var = {
.xres = 1024,
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;
err = pci_enable_device(pdev); /* enable SMTC chip */
if (err)
return err;
- err = -ENOMEM;
hw.chipID = ent->device;
sprintf(name, "sm%Xfb", hw.chipID);
return 0;
- failed:
+failed:
printk(KERN_INFO "Silicon Motion, Inc. primary display init fail\n");
smtc_unmap_smem(sfb);
#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 */
},
};
-#define numVGAModes (sizeof(VGAMode) / sizeof(struct ModeInit))
+#define numVGAModes ARRAY_SIZE(VGAMode)