[PATCH 2/2] staging: slicoss: fix camel case check

2016-05-29 Thread Jaime Arrocha
From: Jaime Arrocha 

Fixed several checks about camel case use provided by checkpatch.pl.
CHECK: Avoid CamelCase
Changes verified to work by compiling module.

Signed-off-by: Jaime Arrocha 
---
 drivers/staging/slicoss/slic.h| 30 +++
 drivers/staging/slicoss/slicoss.c | 50 +++
 2 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index 6722743..2c1d819 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -52,8 +52,8 @@
 
 #define GB_RCVUCODE_VERS_STRING  "1.2"
 #define GB_RCVUCODE_VERS_DATE"2006/03/27 15:12:15"
-static u32 OasisRcvUCodeLen = 512;
-static u32 GBRcvUCodeLen = 512;
+static u32 oasis_rcvucodelen = 512;
+static u32 gb_rcvucodelen = 512;
 #define SECTION_SIZE 65536
 
 #define SLIC_RSPQ_PAGES_GB   10
@@ -370,20 +370,20 @@ struct slic_upr {
 struct slic_ifevents {
uintoflow802;
uintuflow802;
-   uintTprtoflow;
+   uinttprtoflow;
uintrcvearly;
-   uintBufov;
-   uintCarre;
-   uintLonge;
-   uintInvp;
-   uintCrc;
-   uintDrbl;
-   uintCode;
-   uintIpHlen;
-   uintIpLen;
-   uintIpCsum;
-   uintTpCsum;
-   uintTpHlen;
+   uintbufov;
+   uintcarre;
+   uintlonge;
+   uintinvp;
+   uintcrc;
+   uintdrbl;
+   uintcode;
+   uintiphlen;
+   uintiplen;
+   uintipcsum;
+   uinttpcsum;
+   uinttphlen;
 };
 
 struct adapter {
diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c
index ac126d4..04d0078 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -414,13 +414,13 @@ static int slic_card_download_gbrcv(struct adapter 
*adapter)
index += 4;
switch (adapter->devid) {
case SLIC_2GB_DEVICE_ID:
-   if (rcvucodelen != OasisRcvUCodeLen) {
+   if (rcvucodelen != oasis_rcvucodelen) {
release_firmware(fw);
return -EINVAL;
}
break;
case SLIC_1GB_DEVICE_ID:
-   if (rcvucodelen != GBRcvUCodeLen) {
+   if (rcvucodelen != gb_rcvucodelen) {
release_firmware(fw);
return -EINVAL;
}
@@ -1917,7 +1917,7 @@ static void slic_rcv_handle_error(struct adapter *adapter,
if (hdr->frame_status14 & VRHSTAT_802OE)
adapter->if_events.oflow802++;
if (hdr->frame_status14 & VRHSTAT_TPOFLO)
-   adapter->if_events.Tprtoflow++;
+   adapter->if_events.tprtoflow++;
if (hdr->frame_status_b14 & VRHSTATB_802UE)
adapter->if_events.uflow802++;
if (hdr->frame_status_b14 & VRHSTATB_RCVE) {
@@ -1925,45 +1925,45 @@ static void slic_rcv_handle_error(struct adapter 
*adapter,
netdev->stats.rx_fifo_errors++;
}
if (hdr->frame_status_b14 & VRHSTATB_BUFF) {
-   adapter->if_events.Bufov++;
+   adapter->if_events.bufov++;
netdev->stats.rx_over_errors++;
}
if (hdr->frame_status_b14 & VRHSTATB_CARRE) {
-   adapter->if_events.Carre++;
+   adapter->if_events.carre++;
netdev->stats.tx_carrier_errors++;
}
if (hdr->frame_status_b14 & VRHSTATB_LONGE)
-   adapter->if_events.Longe++;
+   adapter->if_events.longe++;
if (hdr->frame_status_b14 & VRHSTATB_PREA)
-   adapter->if_events.Invp++;
+   adapter->if_events.invp++;
if (hdr->frame_status_b14 & VRHSTATB_CRC) {
-   adapter->if_events.Crc++;
+   adapter->if_events.crc++;
netdev->stats.rx_crc_errors++;
}
if (hdr->frame_status_b14 & VRHSTATB_DRBL)
-   adapter->if_events.Drbl++;
+   adapter->if_events.drbl++;
if (hdr->frame_status_b14 & VRHSTATB_CODE)
-   adapter->if_events.Code++;
+   adapter->if_events.code++;
if (hdr->frame_status_b14 & VRHSTATB_TPCSUM)
-   adapter->if_events.TpCsum++;
+   adapter->if_events.tpcsum++;
if (hdr->frame_status_b14 & VRHSTATB_TPHLEN)
-   adapter->if_events.TpHlen++;
+   adapter-

[PATCH 1/2] staging: slicoss: fix coding style spacing issues

2016-05-29 Thread Jaime Arrocha
From: Jaime Arrocha 

This patch fixes spacing in variable declarations.
This patch series does not depend on each other.

Signed-off-by: Jaime Arrocha 
---
 drivers/staging/slicoss/slic.h | 280 -
 1 file changed, 140 insertions(+), 140 deletions(-)

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index cc0afee..6722743 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -42,30 +42,30 @@
 #define __SLIC_DRIVER_H__
 
 /* firmware stuff */
-#define OASIS_UCODE_VERS_STRING"1.2"
-#define OASIS_UCODE_VERS_DATE  "2006/03/27 15:10:37"
-#define OASIS_UCODE_HOSTIF_ID  3
+#define OASIS_UCODE_VERS_STRING  "1.2"
+#define OASIS_UCODE_VERS_DATE"2006/03/27 15:10:37"
+#define OASIS_UCODE_HOSTIF_ID3
 
-#define MOJAVE_UCODE_VERS_STRING   "1.2"
-#define MOJAVE_UCODE_VERS_DATE "2006/03/27 15:12:22"
-#define MOJAVE_UCODE_HOSTIF_ID 3
+#define MOJAVE_UCODE_VERS_STRING "1.2"
+#define MOJAVE_UCODE_VERS_DATE   "2006/03/27 15:12:22"
+#define MOJAVE_UCODE_HOSTIF_ID   3
 
-#define GB_RCVUCODE_VERS_STRING"1.2"
-#define GB_RCVUCODE_VERS_DATE  "2006/03/27 15:12:15"
+#define GB_RCVUCODE_VERS_STRING  "1.2"
+#define GB_RCVUCODE_VERS_DATE"2006/03/27 15:12:15"
 static u32 OasisRcvUCodeLen = 512;
 static u32 GBRcvUCodeLen = 512;
 #define SECTION_SIZE 65536
 
-#define SLIC_RSPQ_PAGES_GB10
-#define SLIC_RSPQ_BUFSINPAGE  (PAGE_SIZE / SLIC_RSPBUF_SIZE)
+#define SLIC_RSPQ_PAGES_GB   10
+#define SLIC_RSPQ_BUFSINPAGE (PAGE_SIZE / SLIC_RSPBUF_SIZE)
 
 struct slic_rspqueue {
-   u32 offset;
-   u32 pageindex;
-   u32 num_pages;
+   u32offset;
+   u32pageindex;
+   u32num_pages;
struct slic_rspbuf *rspbuf;
-   u32 *vaddr[SLIC_RSPQ_PAGES_GB];
-   dma_addr_t  paddr[SLIC_RSPQ_PAGES_GB];
+   u32*vaddr[SLIC_RSPQ_PAGES_GB];
+   dma_addr_t paddr[SLIC_RSPQ_PAGES_GB];
 };
 
 #define SLIC_RCVQ_EXPANSION 1
@@ -79,9 +79,9 @@ struct slic_rspqueue {
 struct slic_rcvqueue {
struct sk_buff*head;
struct sk_buff*tail;
-   u32count;
-   u32size;
-   u32errors;
+   u32   count;
+   u32   size;
+   u32   errors;
 };
 
 struct slic_rcvbuf_info {
@@ -92,6 +92,7 @@ struct slic_rcvbuf_info {
u32 lasttime;
u32 lastid;
 };
+
 /*
  * SLIC Handle structure.  Used to restrict handle values to
  * 32 bits by using an index rather than an address.
@@ -109,9 +110,9 @@ struct slic_handle_word {
 
 struct slic_handle {
struct slic_handle_word  token;  /* token passed between host and card*/
-   ushort  type;
-   void *address;/* actual address of the object*/
-   ushort  offset;
+   ushort   type;
+   void *address; /* actual address of the object*/
+   ushort   offset;
struct slic_handle   *other_handle;
struct slic_handle   *next;
 };
@@ -130,16 +131,17 @@ struct slic_handle {
 
 struct slic_hostcmd {
struct slic_host64_cmd  cmd64;
-   u32type;
-   struct sk_buff*skb;
-   u32paddrl;
-   u32paddrh;
-   u32busy;
-   u32cmdsize;
-   ushort numbufs;
-   struct slic_handle*pslic_handle;/* handle associated with command */
-   struct slic_hostcmd*next;
-   struct slic_hostcmd*next_all;
+   u32 type;
+   struct sk_buff  *skb;
+   u32 paddrl;
+   u32 paddrh;
+   u32 busy;
+   u32 cmdsize;
+   ushort  numbufs;
+   /* handle associated with command */
+   struct slic_handle  *pslic_handle;
+   struct slic_hostcmd *next;
+   struct slic_hostcmd *next_all;
 };
 
 #define SLIC_CMDQ_CMDSINPAGE(PAGE_SIZE / SLIC_HOSTCMD_SIZE)
@@ -151,23 +153,23 @@ struct slic_hostcmd {
 #define SLIC_CMDQ_INITPAGES  (SLIC_CMDQ_INITCMDS / SLIC_CMDQ_CMDSINPAGE)
 
 struct slic_cmdqmem {
-   int pagecnt;
-   u32 *pages[SLIC_CMDQ_MAXPAGES];
+   intpagecnt;
+   u32*pages[SLIC_CMDQ_MAXPAGES];
dma_addr_t dma_pages[SLIC_CMDQ_MAXPAGES];
 };
 
 struct slic_cmdqueue {
struct slic_hostcmd *head;
struct slic_hostcmd *tail;
-   int count;
-   spinlock_t lock;
+   int count;
+   spinlock_t  lock;
 };
 
 #define SLIC_MAX_CARDS  32
 #define SLIC_MAX_PORTS  4/* Max # of ports per card   */
 
 struct mcast_address {

Re: [PATCH] fbtft: limit transfer length by spi device limit

2016-05-29 Thread Noralf Trønnes


Den 26.05.2016 21:25, skrev Michal Suchanek:

Some SPI controllers can transfer only small piece of data at a time.
Since SPI core gained a function to get the maximum transfer length use
it.

Signed-off-by: Michal Suchanek 
---

  Tested on sunxi spi with DMA enabled and disabled. Makes a visible speed
difference and display works in either case.

  drivers/staging/fbtft/fbtft-core.c | 9 +
  1 file changed, 9 insertions(+)

diff --git a/drivers/staging/fbtft/fbtft-core.c 
b/drivers/staging/fbtft/fbtft-core.c
index 0c1a77c..f3bdc8f 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -1346,6 +1346,15 @@ int fbtft_probe_common(struct fbtft_display *display,
return PTR_ERR(pdata);
}
  
+	if (sdev && (spi_max_transfer_size(sdev) < SIZE_MAX))

+   if ((pdata->txbuflen <= 0) || (pdata->txbuflen > 
spi_max_transfer_size(sdev))) {
+   dev_warn(dev,
+"Limiting used buffer size %i -> %i due to device 
%s transfer size limitation",
+pdata->txbuflen, spi_max_transfer_size(sdev),
+dev_name(&sdev->dev));
+   pdata->txbuflen = spi_max_transfer_size(sdev);
+   }
+
info = fbtft_framebuffer_alloc(display, dev, pdata);
if (!info)
return -ENOMEM;


(Ugh, this code of mine looks worse each time I'm confronted with it.)

You have even taken care of the special txbuflen == -1 value I see,
so I guess this is as good as it gets without any major refactoring, so:

Acked-by: Noralf Trønnes 

And there's no point in doing any refactoring since I'm working on a DRM
successor for fbtft. I have been working on it since the fbdev maintainer
issued the "No more new fbdev drivers, please" call in September and now
it has reached a tipping point where I can say that I will keep working
on it until it's done.
Some info: https://github.com/notro/tinydrm/wiki

Thanks,
Noralf.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel