LKML Archive on lore.kernel.org help / color / mirror / Atom feed
* [PATCH v2 3/6] staging: sm750fb: Make internal functions static @ 2015-03-11 10:45 Lorenzo Stoakes 2015-03-11 10:45 ` [PATCH v2 4/6] staging: sm750fb: Remove unused function Lorenzo Stoakes 2015-03-11 10:45 ` [PATCH v2 6/6] staging: sm750fb: Remove spinlock helper function Lorenzo Stoakes 0 siblings, 2 replies; 10+ messages in thread From: Lorenzo Stoakes @ 2015-03-11 10:45 UTC (permalink / raw) To: sudipm.mukherjee, teddy.wang, gregkh Cc: linux-fbdev, devel, linux-kernel, Lorenzo Stoakes This patch declares externally unavailable functions static. This fixes the following sparse warnings:- drivers/staging/sm750fb/ddk750_swi2c.c:223:6: warning: symbol 'swI2CStart' was not declared. Should it be static? drivers/staging/sm750fb/ddk750_swi2c.c:234:6: warning: symbol 'swI2CStop' was not declared. Should it be static? drivers/staging/sm750fb/ddk750_swi2c.c:252:6: warning: symbol 'swI2CWriteByte' was not declared. Should it be static? drivers/staging/sm750fb/ddk750_swi2c.c:320:15: warning: symbol 'swI2CReadByte' was not declared. Should it be static? drivers/staging/sm750fb/ddk750_swi2c.c:361:6: warning: symbol 'swI2CInit_SM750LE' was not declared. Should it be static? drivers/staging/sm750fb/ddk750_hwi2c.c:63:6: warning: symbol 'hwI2CWaitTXDone' was not declared. Should it be static? drivers/staging/sm750fb/ddk750_hwi2c.c:93:14: warning: symbol 'hwI2CWriteData' was not declared. Should it be static? drivers/staging/sm750fb/ddk750_hwi2c.c:160:14: warning: symbol 'hwI2CReadData' was not declared. Should it be static? Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com> --- drivers/staging/sm750fb/ddk750_hwi2c.c | 6 +++--- drivers/staging/sm750fb/ddk750_swi2c.c | 10 +++++----- drivers/staging/sm750fb/sm750_accel.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c b/drivers/staging/sm750fb/ddk750_hwi2c.c index 84dfb6f..7826376 100644 --- a/drivers/staging/sm750fb/ddk750_hwi2c.c +++ b/drivers/staging/sm750fb/ddk750_hwi2c.c @@ -60,7 +60,7 @@ void hwI2CClose(void) } -long hwI2CWaitTXDone(void) +static long hwI2CWaitTXDone(void) { unsigned int timeout; @@ -90,7 +90,7 @@ long hwI2CWaitTXDone(void) * Return Value: * Total number of bytes those are actually written. */ -unsigned int hwI2CWriteData( +static unsigned int hwI2CWriteData( unsigned char deviceAddress, unsigned int length, unsigned char *pBuffer @@ -157,7 +157,7 @@ unsigned int hwI2CWriteData( * Return Value: * Total number of actual bytes read from the slave device */ -unsigned int hwI2CReadData( +static unsigned int hwI2CReadData( unsigned char deviceAddress, unsigned int length, unsigned char *pBuffer diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c b/drivers/staging/sm750fb/ddk750_swi2c.c index 1249759..516f5bb 100644 --- a/drivers/staging/sm750fb/ddk750_swi2c.c +++ b/drivers/staging/sm750fb/ddk750_swi2c.c @@ -220,7 +220,7 @@ static void swI2CAck(void) /* * This function sends the start command to the slave device */ -void swI2CStart(void) +static void swI2CStart(void) { /* Start I2C */ swI2CSDA(1); @@ -231,7 +231,7 @@ void swI2CStart(void) /* * This function sends the stop command to the slave device */ -void swI2CStop(void) +static void swI2CStop(void) { /* Stop the I2C */ swI2CSCL(1); @@ -249,7 +249,7 @@ void swI2CStop(void) * 0 - Success * -1 - Fail to write byte */ -long swI2CWriteByte(unsigned char data) +static long swI2CWriteByte(unsigned char data) { unsigned char value = data; int i; @@ -317,7 +317,7 @@ long swI2CWriteByte(unsigned char data) * Return Value: * One byte data read from the Slave device */ -unsigned char swI2CReadByte(unsigned char ack) +static unsigned char swI2CReadByte(unsigned char ack) { int i; unsigned char data = 0; @@ -358,7 +358,7 @@ unsigned char swI2CReadByte(unsigned char ack) * -1 - Fail to initialize the i2c * 0 - Success */ -long swI2CInit_SM750LE( +static long swI2CInit_SM750LE( unsigned char i2cClkGPIO, unsigned char i2cDataGPIO ) -- 2.3.2 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 4/6] staging: sm750fb: Remove unused function 2015-03-11 10:45 [PATCH v2 3/6] staging: sm750fb: Make internal functions static Lorenzo Stoakes @ 2015-03-11 10:45 ` Lorenzo Stoakes 2015-03-11 10:57 ` Sudip Mukherjee 2015-03-11 10:45 ` [PATCH v2 6/6] staging: sm750fb: Remove spinlock helper function Lorenzo Stoakes 1 sibling, 1 reply; 10+ messages in thread From: Lorenzo Stoakes @ 2015-03-11 10:45 UTC (permalink / raw) To: sudipm.mukherjee, teddy.wang, gregkh Cc: linux-fbdev, devel, linux-kernel, Lorenzo Stoakes This patch removes the unused hw712_fillrect function. This patch fixes the following sparse warning:- drivers/staging/sm750fb/sm750_accel.c:95:5: warning: symbol 'hw712_fillrect' was not declared. Should it be static? Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com> --- drivers/staging/sm750fb/sm750_accel.c | 78 ----------------------------------- 1 file changed, 78 deletions(-) diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 6521c3b..c5a3726 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -89,84 +89,6 @@ void hw_set2dformat(struct lynx_accel * accel,int fmt) write_dpr(accel,DE_STRETCH_FORMAT,reg); } -/* seems sm712 RectFill command is broken,so need use BitBlt to - * replace it. */ - -int hw712_fillrect(struct lynx_accel * accel, - u32 base,u32 pitch,u32 Bpp, - u32 x,u32 y,u32 width,u32 height, - u32 color,u32 rop) -{ - u32 deCtrl; - if(accel->de_wait() != 0) - { - /* int time wait and always busy,seems hardware - * got something error */ - pr_debug("%s:De engine always bussy\n",__func__); - return -1; - } - /* 24bpp 2d acceleration still not work,we already support 2d on - * both 8/16/32 bpp now, so there is no harm if we disable 2d on - * 24bpp for current stage. */ -#if 0 - if(Bpp == 3){ - width *= 3; - x *= 3; - write_dpr(accel,DE_PITCH, - FIELD_VALUE(0,DE_PITCH,DESTINATION,pitch)| - FIELD_VALUE(0,DE_PITCH,SOURCE,pitch));//dpr10 - } - else -#endif - { - write_dpr(accel,DE_PITCH, - FIELD_VALUE(0,DE_PITCH,DESTINATION,pitch/Bpp)| - FIELD_VALUE(0,DE_PITCH,SOURCE,pitch/Bpp));//dpr10 - - } - - write_dpr(accel,DE_FOREGROUND,color);//DPR14 - write_dpr(accel,DE_MONO_PATTERN_HIGH,~0);//DPR34 - write_dpr(accel,DE_MONO_PATTERN_LOW,~0);//DPR38 - - write_dpr(accel,DE_WINDOW_SOURCE_BASE,base);//dpr44 - write_dpr(accel,DE_WINDOW_DESTINATION_BASE,base);//dpr40 - - - write_dpr(accel,DE_WINDOW_WIDTH, - FIELD_VALUE(0,DE_WINDOW_WIDTH,DESTINATION,pitch/Bpp)| - FIELD_VALUE(0,DE_WINDOW_WIDTH,SOURCE,pitch/Bpp));//dpr3c - - - write_dpr(accel,DE_DESTINATION, - FIELD_SET(0,DE_DESTINATION,WRAP,DISABLE)| - FIELD_VALUE(0,DE_DESTINATION,X,x)| - FIELD_VALUE(0,DE_DESTINATION,Y,y));//dpr4 - - write_dpr(accel,DE_DIMENSION, - FIELD_VALUE(0,DE_DIMENSION,X,width)| - FIELD_VALUE(0,DE_DIMENSION,Y_ET,height));//dpr8 - - deCtrl = - FIELD_SET(0,DE_CONTROL,STATUS,START)| - FIELD_SET(0,DE_CONTROL,COMMAND,BITBLT)| - FIELD_SET(0,DE_CONTROL,ROP2_SOURCE,PATTERN)| - FIELD_SET(0,DE_CONTROL,ROP_SELECT,ROP2)| - FIELD_VALUE(0,DE_CONTROL,ROP,rop);//dpr0xc -#if 0 - /* dump registers */ - int i; - inf_msg("x,y,w,h = %d,%d,%d,%d\n",x,y,width,height); - for(i=0x04;i<=0x44;i+=4){ - inf_msg("dpr%02x = %08x\n",i,read_dpr(accel,i)); - } - inf_msg("deCtrl = %08x\n",deCtrl); -#endif - - write_dpr(accel,DE_CONTROL,deCtrl); - return 0; -} - int hw_fillrect(struct lynx_accel * accel, u32 base,u32 pitch,u32 Bpp, u32 x,u32 y,u32 width,u32 height, -- 2.3.2 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v2 4/6] staging: sm750fb: Remove unused function 2015-03-11 10:45 ` [PATCH v2 4/6] staging: sm750fb: Remove unused function Lorenzo Stoakes @ 2015-03-11 10:57 ` Sudip Mukherjee 2015-03-11 10:59 ` Lorenzo Stoakes 0 siblings, 1 reply; 10+ messages in thread From: Sudip Mukherjee @ 2015-03-11 10:57 UTC (permalink / raw) To: Lorenzo Stoakes; +Cc: teddy.wang, gregkh, linux-fbdev, devel, linux-kernel On Wed, Mar 11, 2015 at 10:45:48AM +0000, Lorenzo Stoakes wrote: > This patch removes the unused hw712_fillrect function. This patch fixes > the following sparse warning:- > > drivers/staging/sm750fb/sm750_accel.c:95:5: warning: symbol 'hw712_fillrect' was not declared. Should it be static? > > Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com> > --- > drivers/staging/sm750fb/sm750_accel.c | 78 ----------------------------------- > 1 file changed, 78 deletions(-) > > diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c > index 6521c3b..c5a3726 100644 > --- a/drivers/staging/sm750fb/sm750_accel.c > +++ b/drivers/staging/sm750fb/sm750_accel.c but function prototype still remains in sm750_accel.h regards sudip ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 4/6] staging: sm750fb: Remove unused function 2015-03-11 10:57 ` Sudip Mukherjee @ 2015-03-11 10:59 ` Lorenzo Stoakes 2015-03-11 11:04 ` Sudip Mukherjee 0 siblings, 1 reply; 10+ messages in thread From: Lorenzo Stoakes @ 2015-03-11 10:59 UTC (permalink / raw) To: Sudip Mukherjee; +Cc: teddy.wang, Greg KH, linux-fbdev, devel, linux-kernel On 11 March 2015 at 10:57, Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote: > but function prototype still remains in sm750_accel.h No it doesn't, v2 of patch 3 in the series no longer puts it there :) -- Lorenzo Stoakes https:/ljs.io ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 4/6] staging: sm750fb: Remove unused function 2015-03-11 10:59 ` Lorenzo Stoakes @ 2015-03-11 11:04 ` Sudip Mukherjee 0 siblings, 0 replies; 10+ messages in thread From: Sudip Mukherjee @ 2015-03-11 11:04 UTC (permalink / raw) To: Lorenzo Stoakes; +Cc: teddy.wang, Greg KH, linux-fbdev, devel, linux-kernel On Wed, Mar 11, 2015 at 10:59:41AM +0000, Lorenzo Stoakes wrote: > On 11 March 2015 at 10:57, Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote: > > but function prototype still remains in sm750_accel.h > > No it doesn't, v2 of patch 3 in the series no longer puts it there :) oops.. i am sorry.. i still had your previous patches applied thatiswhy i got the prototype in sm750_accel.h regards sudip > > -- > Lorenzo Stoakes > https:/ljs.io ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 6/6] staging: sm750fb: Remove spinlock helper function 2015-03-11 10:45 [PATCH v2 3/6] staging: sm750fb: Make internal functions static Lorenzo Stoakes 2015-03-11 10:45 ` [PATCH v2 4/6] staging: sm750fb: Remove unused function Lorenzo Stoakes @ 2015-03-11 10:45 ` Lorenzo Stoakes 2015-03-11 14:58 ` Sudip Mukherjee 1 sibling, 1 reply; 10+ messages in thread From: Lorenzo Stoakes @ 2015-03-11 10:45 UTC (permalink / raw) To: sudipm.mukherjee, teddy.wang, gregkh Cc: linux-fbdev, devel, linux-kernel, Lorenzo Stoakes This patch removes the unnecessary spinlock helper function and instead calls spin_lock and spin_unlock directly. This does *not* resolve sparse warnings about context imbalances but these are spurious. Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com> --- drivers/staging/sm750fb/sm750.c | 47 +++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 3e36b6a..217795e 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -56,23 +56,6 @@ static char * g_settings = NULL; static int g_dualview = 0; static char * g_option = NULL; -/* if not use spin_lock,system will die if user load driver - * and immediatly unload driver frequently (dual)*/ -static inline void myspin_lock(spinlock_t * sl){ - struct lynx_share * share; - share = container_of(sl,struct lynx_share,slock); - if(share->dual){ - spin_lock(sl); - } -} - -static inline void myspin_unlock(spinlock_t * sl){ - struct lynx_share * share; - share = container_of(sl,struct lynx_share,slock); - if(share->dual){ - spin_unlock(sl); - } -} static const struct fb_videomode lynx750_ext[] = { /* 1024x600-60 VESA [1.71:1] */ {NULL, 60, 1024, 600, 20423, 144, 40, 18, 1, 104, 3, @@ -209,13 +192,19 @@ static void lynxfb_ops_fillrect(struct fb_info* info,const struct fb_fillrect* r color = (Bpp == 1)?region->color:((u32*)info->pseudo_palette)[region->color]; rop = ( region->rop != ROP_COPY ) ? HW_ROP2_XOR:HW_ROP2_COPY; - myspin_lock(&share->slock); + /* if not use spin_lock,system will die if user load driver + * and immediatly unload driver frequently (dual)*/ + if (share->dual) + spin_lock(&share->slock); + share->accel.de_fillrect(&share->accel, base,pitch,Bpp, region->dx,region->dy, region->width,region->height, color,rop); - myspin_unlock(&share->slock); + + if (share->dual) + spin_unlock(&share->slock); } static void lynxfb_ops_copyarea(struct fb_info * info,const struct fb_copyarea * region) @@ -233,12 +222,18 @@ static void lynxfb_ops_copyarea(struct fb_info * info,const struct fb_copyarea * pitch = info->fix.line_length; Bpp = info->var.bits_per_pixel >> 3; - myspin_lock(&share->slock); + /* if not use spin_lock,system will die if user load driver + * and immediatly unload driver frequently (dual)*/ + if (share->dual) + spin_lock(&share->slock); + share->accel.de_copyarea(&share->accel, base,pitch,region->sx,region->sy, base,pitch,Bpp,region->dx,region->dy, region->width,region->height,HW_ROP2_COPY); - myspin_unlock(&share->slock); + + if (share->dual) + spin_unlock(&share->slock); } static void lynxfb_ops_imageblit(struct fb_info*info,const struct fb_image* image) @@ -272,14 +267,20 @@ static void lynxfb_ops_imageblit(struct fb_info*info,const struct fb_image* imag } return; _do_work: - myspin_lock(&share->slock); + /* if not use spin_lock,system will die if user load driver + * and immediatly unload driver frequently (dual)*/ + if (share->dual) + spin_lock(&share->slock); + share->accel.de_imageblit(&share->accel, image->data,image->width>>3,0, base,pitch,Bpp, image->dx,image->dy, image->width,image->height, fgcol,bgcol,HW_ROP2_COPY); - myspin_unlock(&share->slock); + + if (share->dual) + spin_unlock(&share->slock); } static int lynxfb_ops_pan_display(struct fb_var_screeninfo *var, -- 2.3.2 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v2 6/6] staging: sm750fb: Remove spinlock helper function 2015-03-11 10:45 ` [PATCH v2 6/6] staging: sm750fb: Remove spinlock helper function Lorenzo Stoakes @ 2015-03-11 14:58 ` Sudip Mukherjee 2015-03-11 15:03 ` Lorenzo Stoakes 0 siblings, 1 reply; 10+ messages in thread From: Sudip Mukherjee @ 2015-03-11 14:58 UTC (permalink / raw) To: Lorenzo Stoakes; +Cc: teddy.wang, gregkh, linux-fbdev, devel, linux-kernel On Wed, Mar 11, 2015 at 10:45:49AM +0000, Lorenzo Stoakes wrote: > This patch removes the unnecessary spinlock helper function and instead > calls spin_lock and spin_unlock directly. > > This does *not* resolve sparse warnings about context imbalances but these are > spurious. tested the whole series on hardware, looks ok. now it depends on Greg if he wants to accept patches with such big commit logs, and another problem he will face is to get some patches from this thread and some from the old thread. (while testing i faced this problem to maintain the sequence of patches) regards sudip ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 6/6] staging: sm750fb: Remove spinlock helper function 2015-03-11 14:58 ` Sudip Mukherjee @ 2015-03-11 15:03 ` Lorenzo Stoakes 2015-03-18 7:52 ` Sudip Mukherjee 0 siblings, 1 reply; 10+ messages in thread From: Lorenzo Stoakes @ 2015-03-11 15:03 UTC (permalink / raw) To: Sudip Mukherjee; +Cc: teddy.wang, Greg KH, linux-fbdev, devel, linux-kernel On 11 March 2015 at 14:58, Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote: > > tested the whole series on hardware, looks ok. > Great! > now it depends on Greg if he wants to accept patches with such big > commit logs, and another problem he will face is to get some patches from > this thread and some from the old thread. > (while testing i faced this problem to maintain the sequence of > patches) I am more than happy to resend the whole series as necessary if that makes it easier for Greg or anyone else :) I have previously resubmitted an entire patch series only for people to find the v2 resubmits of unchanged code to be confusing. I am absolutely happy to do whatever works for Greg of course! Best, -- Lorenzo Stoakes https:/ljs.io ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 6/6] staging: sm750fb: Remove spinlock helper function 2015-03-11 15:03 ` Lorenzo Stoakes @ 2015-03-18 7:52 ` Sudip Mukherjee 2015-03-18 8:30 ` Lorenzo Stoakes 0 siblings, 1 reply; 10+ messages in thread From: Sudip Mukherjee @ 2015-03-18 7:52 UTC (permalink / raw) To: Lorenzo Stoakes; +Cc: Greg KH, linux-fbdev, devel, linux-kernel, dan.carpenter On Wed, Mar 11, 2015 at 03:03:39PM +0000, Lorenzo Stoakes wrote: > On 11 March 2015 at 14:58, Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote: > > I am more than happy to resend the whole series as necessary if that > makes it easier for Greg or anyone else :) I have previously > resubmitted an entire patch series only for people to find the v2 > resubmits of unchanged code to be confusing. I am absolutely happy to > do whatever works for Greg of course! your series is not applying anymore to linux-next. looks like some patches came from the Outreachy and were already applied. please redo it against staging-testing. regards sudip > > Best, > > -- > Lorenzo Stoakes > https:/ljs.io ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 6/6] staging: sm750fb: Remove spinlock helper function 2015-03-18 7:52 ` Sudip Mukherjee @ 2015-03-18 8:30 ` Lorenzo Stoakes 0 siblings, 0 replies; 10+ messages in thread From: Lorenzo Stoakes @ 2015-03-18 8:30 UTC (permalink / raw) To: Sudip Mukherjee; +Cc: Greg KH, linux-fbdev, devel, linux-kernel, Dan Carpenter On 18 March 2015 at 07:52, Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote: > your series is not applying anymore to linux-next. > looks like some patches came from the Outreachy and were already > applied. > please redo it against staging-testing. Will do that now! I think at this point it'll be easier for me to resend the whole series to make it clear which is applicable right now. Best, -- Lorenzo Stoakes https:/ljs.io ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-03-18 8:30 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-03-11 10:45 [PATCH v2 3/6] staging: sm750fb: Make internal functions static Lorenzo Stoakes 2015-03-11 10:45 ` [PATCH v2 4/6] staging: sm750fb: Remove unused function Lorenzo Stoakes 2015-03-11 10:57 ` Sudip Mukherjee 2015-03-11 10:59 ` Lorenzo Stoakes 2015-03-11 11:04 ` Sudip Mukherjee 2015-03-11 10:45 ` [PATCH v2 6/6] staging: sm750fb: Remove spinlock helper function Lorenzo Stoakes 2015-03-11 14:58 ` Sudip Mukherjee 2015-03-11 15:03 ` Lorenzo Stoakes 2015-03-18 7:52 ` Sudip Mukherjee 2015-03-18 8:30 ` Lorenzo Stoakes
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).