* [PATCH 1/3] Cleanup:removing extra spaces,redundant code and using macros[staging sm7xx]
@ 2011-05-16 15:49 anish
2011-05-17 20:29 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: anish @ 2011-05-16 15:49 UTC (permalink / raw)
To: greg, teddy.wang, anish198519851985; +Cc: linux-kernel
Hi Greg,
Please ignore previous 3 patches as mentioned in my previous mail.
Thanks,
anish
This patch is to remove extra spaces,redundant code and using
ARRAY_SIZE macros.
Signed-off-by: anish kumar<anish198519851985@gmail.com>
---
drivers/staging/sm7xx/smtcfb.c | 7 +++----
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 94cb4e8..1aca0cb 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 0c11383..c5e6989 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)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/3] Cleanup:removing extra spaces,redundant code and using macros[staging sm7xx]
2011-05-16 15:49 [PATCH 1/3] Cleanup:removing extra spaces,redundant code and using macros[staging sm7xx] anish
@ 2011-05-17 20:29 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2011-05-17 20:29 UTC (permalink / raw)
To: anish; +Cc: teddy.wang, linux-kernel
On Mon, May 16, 2011 at 09:19:16PM +0530, anish wrote:
> Hi Greg,
>
> Please ignore previous 3 patches as mentioned in my previous mail.
Ok, but why does this say "1/3" when there is only 1 patch?
Care to resend me exactly what you want me to apply? I've now dropped
all patches from you from my queue now.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] Cleanup:removing extra spaces,redundant code and using macros[staging sm7xx]
@ 2011-05-15 3:25 anish
0 siblings, 0 replies; 4+ messages in thread
From: anish @ 2011-05-15 3:25 UTC (permalink / raw)
To: greg, teddy.wang; +Cc: linux-kernel
This patch is to remove extra spaces,redundant code and using
ARRAY_SIZE macros.
Signed-off-by: anish kumar<anish198519851985@gmail.com>
---
drivers/staging/sm7xx/smtcfb.c | 13 ++++++-------
drivers/staging/sm7xx/smtcfb.h | 7 +------
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/sm7xx/smtcfb.c b/drivers/staging/sm7xx/smtcfb.c
index 3e2230f..c1b8228 100644
--- a/drivers/staging/sm7xx/smtcfb.c
+++ b/drivers/staging/sm7xx/smtcfb.c
@@ -99,17 +99,17 @@ struct vesa_mode_table {
static struct vesa_mode_table vesa_mode[] = {
{"0x301", 640, 480, 8},
{"0x303", 800, 600, 8},
- {"0x305", 1024, 768, 8},
+ {"0x305", 1024, 768, 8},
{"0x307", 1280, 1024, 8},
{"0x311", 640, 480, 16},
{"0x314", 800, 600, 16},
- {"0x317", 1024, 768, 16},
+ {"0x317", 1024, 768, 16},
{"0x31A", 1280, 1024, 16},
{"0x312", 640, 480, 24},
{"0x315", 800, 600, 24},
- {"0x318", 1024, 768, 24},
+ {"0x318", 1024, 768, 24},
{"0x31B", 1280, 1024, 24},
};
@@ -125,7 +125,7 @@ u16 smtc_ChipIDs[] = {
0x720
};
-#define numSMTCchipIDs (sizeof(smtc_ChipIDs) / sizeof(u16))
+#define numSMTCchipIDs ARRAY_SIZE(smtc_ChipIDs)
static void sm712_set_timing(struct smtcfb_info *sfb,
struct par_info *ppar_info)
@@ -812,7 +812,7 @@ static int __init __maybe_unused 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;
@@ -846,7 +846,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);
@@ -1139,6 +1138,6 @@ static void __exit smtcfb_exit(void)
module_init(smtcfb_init);
module_exit(smtcfb_exit);
-MODULE_AUTHOR("Siliconmotion ");
+MODULE_AUTHOR("Siliconmotion");
MODULE_DESCRIPTION("Framebuffer driver for SMI Graphic Cards");
MODULE_LICENSE("GPL");
diff --git a/drivers/staging/sm7xx/smtcfb.h b/drivers/staging/sm7xx/smtcfb.h
index 0c11383..c5e6989 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)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 1/3] Cleanup:removing extra spaces,redundant code and using macros[staging sm7xx]
@ 2011-05-15 3:24 anish
0 siblings, 0 replies; 4+ messages in thread
From: anish @ 2011-05-15 3:24 UTC (permalink / raw)
To: greg, teddy.wang; +Cc: linux-kernel
This patch is to remove extra spaces,redundant code and using
ARRAY_SIZE macros.
Signed-off-by: anish kumar<anish198519851985@gmail.com>
---
drivers/staging/sm7xx/smtcfb.c | 13 ++++++-------
drivers/staging/sm7xx/smtcfb.h | 7 +------
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/sm7xx/smtcfb.c b/drivers/staging/sm7xx/smtcfb.c
index 3e2230f..c1b8228 100644
--- a/drivers/staging/sm7xx/smtcfb.c
+++ b/drivers/staging/sm7xx/smtcfb.c
@@ -99,17 +99,17 @@ struct vesa_mode_table {
static struct vesa_mode_table vesa_mode[] = {
{"0x301", 640, 480, 8},
{"0x303", 800, 600, 8},
- {"0x305", 1024, 768, 8},
+ {"0x305", 1024, 768, 8},
{"0x307", 1280, 1024, 8},
{"0x311", 640, 480, 16},
{"0x314", 800, 600, 16},
- {"0x317", 1024, 768, 16},
+ {"0x317", 1024, 768, 16},
{"0x31A", 1280, 1024, 16},
{"0x312", 640, 480, 24},
{"0x315", 800, 600, 24},
- {"0x318", 1024, 768, 24},
+ {"0x318", 1024, 768, 24},
{"0x31B", 1280, 1024, 24},
};
@@ -125,7 +125,7 @@ u16 smtc_ChipIDs[] = {
0x720
};
-#define numSMTCchipIDs (sizeof(smtc_ChipIDs) / sizeof(u16))
+#define numSMTCchipIDs ARRAY_SIZE(smtc_ChipIDs)
static void sm712_set_timing(struct smtcfb_info *sfb,
struct par_info *ppar_info)
@@ -812,7 +812,7 @@ static int __init __maybe_unused 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;
@@ -846,7 +846,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);
@@ -1139,6 +1138,6 @@ static void __exit smtcfb_exit(void)
module_init(smtcfb_init);
module_exit(smtcfb_exit);
-MODULE_AUTHOR("Siliconmotion ");
+MODULE_AUTHOR("Siliconmotion");
MODULE_DESCRIPTION("Framebuffer driver for SMI Graphic Cards");
MODULE_LICENSE("GPL");
diff --git a/drivers/staging/sm7xx/smtcfb.h b/drivers/staging/sm7xx/smtcfb.h
index 0c11383..c5e6989 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)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-05-17 20:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-16 15:49 [PATCH 1/3] Cleanup:removing extra spaces,redundant code and using macros[staging sm7xx] anish
2011-05-17 20:29 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2011-05-15 3:25 anish
2011-05-15 3:24 anish
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).