diff mbox

[v2,3/4] staging: sm750fb: correctly define SM750LE_REVISION_ID

Message ID 1425886506-8643-3-git-send-email-sudipm.mukherjee@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sudip Mukherjee March 9, 2015, 7:35 a.m. UTC
check if it is already defined before defining SM750LE_REVISION_ID
again and at the same time mention correct data type.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---

v2: removed the redundant cast in sm750_hw.c

 drivers/staging/sm750fb/ddk750_chip.h | 4 +++-
 drivers/staging/sm750fb/sm750_hw.c    | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Lad, Prabhakar March 9, 2015, 7:47 a.m. UTC | #1
On Mon, Mar 9, 2015 at 7:35 AM, Sudip Mukherjee
<sudipm.mukherjee@gmail.com> wrote:
> check if it is already defined before defining SM750LE_REVISION_ID
> again and at the same time mention correct data type.
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
>
> v2: removed the redundant cast in sm750_hw.c
>
>  drivers/staging/sm750fb/ddk750_chip.h | 4 +++-
>  drivers/staging/sm750fb/sm750_hw.c    | 2 +-
>  2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h
> index 1c78875..d761b72 100644
> --- a/drivers/staging/sm750fb/ddk750_chip.h
> +++ b/drivers/staging/sm750fb/ddk750_chip.h
> @@ -1,7 +1,9 @@
>  #ifndef DDK750_CHIP_H__
>  #define DDK750_CHIP_H__
>  #define DEFAULT_INPUT_CLOCK 14318181 /* Default reference clock */
> -#define SM750LE_REVISION_ID (char)0xfe
> +#ifndef SM750LE_REVISION_ID
> +#define SM750LE_REVISION_ID ((unsigned char)0xfe)

BTW who is defining this somewhere else ?

Cheers,
--Prabhakar Lad
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sudip Mukherjee March 9, 2015, 8:41 a.m. UTC | #2
On Mon, Mar 09, 2015 at 07:47:40AM +0000, Lad, Prabhakar wrote:
> On Mon, Mar 9, 2015 at 7:35 AM, Sudip Mukherjee
> <sudipm.mukherjee@gmail.com> wrote:
> > check if it is already defined before defining SM750LE_REVISION_ID
> > again and at the same time mention correct data type.
> >
> > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> > ---
> >
> > v2: removed the redundant cast in sm750_hw.c
> >
> >  drivers/staging/sm750fb/ddk750_chip.h | 4 +++-
> >  drivers/staging/sm750fb/sm750_hw.c    | 2 +-
> >  2 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h
> > index 1c78875..d761b72 100644
> > --- a/drivers/staging/sm750fb/ddk750_chip.h
> > +++ b/drivers/staging/sm750fb/ddk750_chip.h
> > @@ -1,7 +1,9 @@
> >  #ifndef DDK750_CHIP_H__
> >  #define DDK750_CHIP_H__
> >  #define DEFAULT_INPUT_CLOCK 14318181 /* Default reference clock */
> > -#define SM750LE_REVISION_ID (char)0xfe
> > +#ifndef SM750LE_REVISION_ID
> > +#define SM750LE_REVISION_ID ((unsigned char)0xfe)
> 
> BTW who is defining this somewhere else ?
it is defined in ddk750_chip.h which is again being used by ddk750_chip.c .


regards
sudip

> 
> Cheers,
> --Prabhakar Lad
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h
index 1c78875..d761b72 100644
--- a/drivers/staging/sm750fb/ddk750_chip.h
+++ b/drivers/staging/sm750fb/ddk750_chip.h
@@ -1,7 +1,9 @@ 
 #ifndef DDK750_CHIP_H__
 #define DDK750_CHIP_H__
 #define DEFAULT_INPUT_CLOCK 14318181 /* Default reference clock */
-#define SM750LE_REVISION_ID (char)0xfe
+#ifndef SM750LE_REVISION_ID
+#define SM750LE_REVISION_ID ((unsigned char)0xfe)
+#endif
 
 /* This is all the chips recognized by this library */
 typedef enum _logical_chip_type_t
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index ec2d499..a2b7fe2 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -277,7 +277,7 @@  int hw_sm750_crtc_checkMode(struct lynxfb_crtc* crtc,struct fb_var_screeninfo* v
 		case 16:
 			break;
 		case 32:
-			if(share->revid == (unsigned char)SM750LE_REVISION_ID){
+			if (share->revid == SM750LE_REVISION_ID) {
 				pr_debug("750le do not support 32bpp\n");
 				return -EINVAL;
 			}