[PATCH 3/3] staging: xgifb: vb_setmode: brace style fixes

2018-01-11 Thread kballou
Add braces to certain "multiline" conditions where "multiline" means
including comments.

Signed-off-by: kballou 
---
 drivers/staging/xgifb/vb_setmode.c | 26 +-
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/xgifb/vb_setmode.c 
b/drivers/staging/xgifb/vb_setmode.c
index 6856286c3b5a..563dae5016b1 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -629,12 +629,14 @@ static void xgifb_set_lcd(int chip_id,
xgifb_reg_and(pVBInfo->P3c4, 0x35, ~0x80); /* Vsync polarity */
 
temp = XGI330_RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
-   if (temp & 0x4000)
+   if (temp & 0x4000) {
/* Hsync polarity */
xgifb_reg_or(pVBInfo->P3c4, 0x30, 0x20);
-   if (temp & 0x8000)
+   }
+   if (temp & 0x8000) {
/* Vsync polarity */
xgifb_reg_or(pVBInfo->P3c4, 0x35, 0x80);
+   }
 }
 
 /*
@@ -1783,9 +1785,10 @@ static void XGI_UpdateModeInfo(struct vb_device_info 
*pVBInfo)
 
temp &= 0x05;
 
-   if (!(tempcl & ActiveLCD))
+   if (!(tempcl & ActiveLCD)) {
if (temp == 0x01)
tempcl |= ActiveCRT2;
+   }
 
if (temp == 0x04)
tempcl |= ActiveLCD;
@@ -2023,10 +2026,11 @@ static void XGI_GetTVInfo(unsigned short ModeIdIndex,
if (tempbx & TVSetPALM)
/* set to NTSC if PAL-M */
tempbx &= ~TVSetPAL;
-   } else
+   } else {
tempbx &= (SetCHTVOverScan |
   TVSetNTSCJ |
   TVSetPAL);
+   }
 
if (pVBInfo->VBInfo & SetCRT2ToSCART)
tempbx |= TVSetPAL;
@@ -2051,9 +2055,10 @@ static void XGI_GetTVInfo(unsigned short ModeIdIndex,
(!(pVBInfo->VBInfo & SetNotSimuMode)))
tempbx |= TVSimuMode;
 
-   if (!(tempbx & TVSetPAL) && (modeflag > 13) && (resinfo == 8))
+   if (!(tempbx & TVSetPAL) && (modeflag > 13) && (resinfo == 8)) {
/* NTSC 1024x768, */
tempbx |= NTSC1024x768;
+   }
 
tempbx |= RPLLDIV2XO;
 
@@ -2352,9 +2357,10 @@ void XGI_DisplayOff(struct xgifb_video_info *xgifb_info,
mdelay(xgifb_info->lvds_data.PSC_S3);
}
 
-   if (pVBInfo->IF_DEF_LVDS == 0)
+   if (pVBInfo->IF_DEF_LVDS == 0) {
/* DVO/DVI signal off */
XGI_XG27BLSignalVDD(0x20, 0x00, pVBInfo);
+   }
}
 
xgifb_reg_and_or(pVBInfo->P3c4, 0x01, 0xDF, 0x20);
@@ -4660,14 +4666,16 @@ static void XGI_SetLCDCap_A(unsigned short tempcx,
 static void XGI_SetLCDCap_B(unsigned short tempcx,
struct vb_device_info *pVBInfo)
 {
-   if (tempcx & EnableLCD24bpp) /* 24bits */
+   if (tempcx & EnableLCD24bpp) { /* 24bits */
xgifb_reg_and_or(pVBInfo->Part2Port, 0x1A, 0xE0,
-(unsigned short)(((tempcx & 0x00ff) >> 6) | 
0x0c));
-   else
+(unsigned short)(((tempcx & 0x00ff) >> 6) |
+ 0x0c));
+   } else {
xgifb_reg_and_or(pVBInfo->Part2Port, 0x1A, 0xE0,
 (unsigned short)(((tempcx & 0x00ff) >> 6) |
  0x18));
  /* Enable Dither */
+   }
 }
 
 static void XGI_LongWait(struct vb_device_info *pVBInfo)
-- 
2.13.6

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


[PATCH 0/3] staging: xgifb: checkpatch fixes

2018-01-11 Thread kballou
This patch series fixes a number of checkpatch issues with the `xgifb`
driver in staging.  This is my first patch set, so keeping it short
for learning.

In patches 2/3 and 3/3, there are a number of "CamelCase" and
"unnecessary parentheses" checks still failing.  I'm not sure if I
should be fixing these or not(?).  Similarly, there's a number of line
length warnings still in `staging/xgifb/vb_setmode.c` that do not
break nicely and may be exceptions to the rule.  Furthermore, patch
3/3 feels arbitrary and possibly unnecessary.

-Kenny

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


[PATCH 2/3] staging: xgifb: vb_setmode: fix 80 char lines

2018-01-11 Thread kballou
Fix a number of checkpatch warnings in xgfib/vb_setmode.c about line
length being over 80 characters.

Signed-off-by: kballou 
---
 drivers/staging/xgifb/vb_setmode.c | 78 ++
 1 file changed, 54 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/xgifb/vb_setmode.c 
b/drivers/staging/xgifb/vb_setmode.c
index e9d930f150cb..6856286c3b5a 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -74,7 +74,8 @@ static void XGI_SetSeqRegs(struct vb_device_info *pVBInfo)
/* Get SR1,2,3,4 from file */
/* SR1 is with screen off 0x20 */
SRdata = XGI330_StandTable.SR[i];
-   xgifb_reg_set(pVBInfo->P3c4, i + 1, SRdata); /* Set SR 1 2 3 4 
*/
+   /* Set SR 1 2 3 4 */
+   xgifb_reg_set(pVBInfo->P3c4, i + 1, SRdata);
}
 }
 
@@ -714,7 +715,9 @@ static void XGI_SetCRT1DE(unsigned short ModeIdIndex,
data &= 0x7F;
xgifb_reg_set(pVBInfo->P3d4, 0x11, data); /* Unlock CRTC */
xgifb_reg_set(pVBInfo->P3d4, 0x01, (unsigned short)(tempcx & 0xff));
-   xgifb_reg_and_or(pVBInfo->P3d4, 0x0b, ~0x0c,
+   xgifb_reg_and_or(pVBInfo->P3d4,
+0x0b,
+~0x0c,
 (unsigned short)((tempcx & 0x0ff00) >> 10));
xgifb_reg_set(pVBInfo->P3d4, 0x12, (unsigned short)(tempbx & 0xff));
tempax = 0;
@@ -1225,9 +1228,10 @@ static void const *XGI_GetLcdPtr(struct 
XGI330_LCDDataTablStruct const *table,
return table[i].DATAPTR;
 }
 
-static struct SiS_TVData const *XGI_GetTVPtr(unsigned short ModeIdIndex,
-unsigned short 
RefreshRateTableIndex,
-struct vb_device_info *pVBInfo)
+static struct SiS_TVData const *XGI_GetTVPtr(
+   unsigned short ModeIdIndex,
+   unsigned short RefreshRateTableIndex,
+   struct vb_device_info *pVBInfo)
 {
unsigned short i, tempdx, tempal, modeflag;
 
@@ -1468,7 +1472,8 @@ static void XGI_SetLVDSRegs(unsigned short ModeIdIndex,
tempax |= tempcx;
 
xgifb_reg_set(pVBInfo->Part1Port, 0x15, tempax);
-   xgifb_reg_set(pVBInfo->Part1Port, 0x14,
+   xgifb_reg_set(pVBInfo->Part1Port,
+ 0x14,
  (unsigned short)(tempbx & 0xff));
 
tempax = pVBInfo->VT;
@@ -1480,14 +1485,19 @@ static void XGI_SetLVDSRegs(unsigned short ModeIdIndex,
if (tempcx >= tempax)
tempcx -= tempax;
 
-   xgifb_reg_set(pVBInfo->Part1Port, 0x1b, (unsigned short)(tempbx & 
0xff));
-   xgifb_reg_set(pVBInfo->Part1Port, 0x1c, (unsigned short)(tempcx & 
0xff));
+   xgifb_reg_set(pVBInfo->Part1Port,
+ 0x1b,
+ (unsigned short)(tempbx & 0xff));
+   xgifb_reg_set(pVBInfo->Part1Port,
+ 0x1c,
+ (unsigned short)(tempcx & 0xff));
 
tempbx = (tempbx >> 8) & 0x07;
tempcx = (tempcx >> 8) & 0x07;
 
-   xgifb_reg_set(pVBInfo->Part1Port, 0x1d, (unsigned short)((tempcx << 3) |
- tempbx));
+   xgifb_reg_set(pVBInfo->Part1Port,
+ 0x1d,
+ (unsigned short)((tempcx << 3) | tempbx));
 
tempax = pVBInfo->VT;
tempbx = LCDPtr1->LCDVRS;
@@ -1501,8 +1511,13 @@ static void XGI_SetLVDSRegs(unsigned short ModeIdIndex,
if (tempcx >= tempax)
tempcx -= tempax;
 
-   xgifb_reg_set(pVBInfo->Part1Port, 0x18, (unsigned short)(tempbx & 
0xff));
-   xgifb_reg_and_or(pVBInfo->Part1Port, 0x19, ~0x0f, (unsigned 
short)(tempcx & 0x0f));
+   xgifb_reg_set(pVBInfo->Part1Port,
+ 0x18,
+ (unsigned short)(tempbx & 0xff));
+   xgifb_reg_and_or(pVBInfo->Part1Port,
+0x19,
+~0x0f,
+(unsigned short)(tempcx & 0x0f));
 
tempax = ((tempbx >> 8) & 0x07) << 3;
 
@@ -1592,16 +1607,24 @@ static void XGI_SetLVDSRegs(unsigned short ModeIdIndex,
 
tempax = ((tempbx >> 8) & 0xff) << 3;
tempax |= (unsigned short)((temp3 >> 8) & 0x07);
-   xgifb_reg_set(pVBInfo->Part1Port, 0x20, (unsigned short)(tempax & 
0xff));
-   xgifb_reg_set(pVBInfo->Part1Port, 0x21, (unsigned short)(tempbx & 
0xff));
+   xgifb_reg_set(pVBInfo->Part1Port,
+ 0x20,
+ (unsigned short)(tempax & 0xff));
+   xgifb_reg_set(pVBInfo->Part1Port,
+ 0x21,
+ (unsigned short)(tempbx & 0xff));
 
temp3 >>= 16;
 
if (modeflag & HalfDCLK)
temp3 >>= 1;
 
-   xgifb_reg_set(pVBInfo->Part1Port, 0x22, (unsigned short)((temp3 >> 8) & 
0xff));
-   xgifb_reg_set(pVBInfo->Part1Port, 0x23, (unsigned short)(temp3 & 0xff));
+   xgifb_reg_set(pVBInfo->Part1Port,
+

[PATCH 1/3] staging: xgifb: vb_table: fix whitespacing issues

2018-01-11 Thread kballou
Correct minor checkpatch issues.

Signed-off-by: kballou 
---
 drivers/staging/xgifb/vb_table.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/xgifb/vb_table.h b/drivers/staging/xgifb/vb_table.h
index 0da63e1da32f..42ecf7fe6766 100644
--- a/drivers/staging/xgifb/vb_table.h
+++ b/drivers/staging/xgifb/vb_table.h
@@ -2493,7 +2493,7 @@ static const struct XGI301C_Tap4TimingStruct 
xgifb_ntsc_525_tap4_timing[] = {
 0x02, 0x0C, 0x0E, 0x04, 0x01, 0x0B, 0x0E, 0x06, /* ; EA-EF */
 0x01, 0x0B, 0x0E, 0x06, 0x00, 0x0A, 0x0F, 0x07, /* ; F0-F7 */
 0x00, 0x0A, 0x0F, 0x07, 0x00, 0x09, 0x0F, 0x08  /* ; F8-FF */
-}
+   }
}
 };
 
@@ -2507,7 +2507,7 @@ static const struct XGI301C_Tap4TimingStruct 
YPbPr750pTap4Timing[] = {
 0x7D, 0x0F, 0x16, 0x7E, 0x7D, 0x0E, 0x17, 0x7E, /* ; EA-EF */
 0x7D, 0x0C, 0x18, 0x7F, 0x7D, 0x0A, 0x18, 0x01, /* ; F0-F7 */
 0x7D, 0x08, 0x19, 0x02, 0x7D, 0x06, 0x19, 0x04 /* F8-FF */
-}
+   }
}
 };
 #endif
-- 
2.13.6

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


Re: [PATCH 1/3] staging: xgifb: vb_table: fix whitespacing issues

2018-01-11 Thread Greg KH
On Thu, Jan 11, 2018 at 11:15:31PM -0700, kballou wrote:
> Correct minor checkpatch issues.
> 
> Signed-off-by: kballou 

I need a "real" name here please.  I doubt you sign legal documents this
way, right?

thanks,

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


Re: [PATCH 06/24] staging: vc04_services: bcm2835-audio: remove redundant license text

2018-01-11 Thread Greg Kroah-Hartman
On Thu, Jan 11, 2018 at 10:21:09AM -0800, Eric Anholt wrote:
> Greg Kroah-Hartman  writes:
> 
> > Now that the SPDX tag is in all
> > drivers/staging/vc04_services/bcm2835-audio/ files, that identifies the
> > license in a specific and legally-defined manner.  So the extra GPL text
> > wording can be removed as it is no longer needed at all.
> >
> > This is done on a quest to remove the 700+ different ways that files in
> > the kernel describe the GPL license text.  And there's unneeded stuff
> > like the address (sometimes incorrect) for the FSF which is never
> > needed.
> >
> > No copyright headers or other non-license-description text was removed.
> 
> 
> > diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c 
> > b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
> > index 4ad67e64e6b9..ec468d5719b1 100644
> > --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
> > +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
> > @@ -1,17 +1,5 @@
> >  // SPDX-License-Identifier: GPL-2.0
> > -/*
> > - * Copyright 2011 Broadcom Corporation.  All rights reserved.
> > - *
> > - * Unless you and Broadcom execute a separate written software license
> > - * agreement governing use of this software, this software is licensed to 
> > you
> > - * under the terms of the GNU General Public License version 2, available 
> > at
> > - * http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
> > - *
> > - * Notwithstanding the above, under no circumstances may you combine this
> > - * software in any way with any other Broadcom software provided under a
> > - * license other than the GPL, without Broadcom's express prior written
> > - * consent.
> > - 
> > */
> > +/* Copyright 2011 Broadcom Corporation.  All rights reserved. */
> 
> The "Notwithstanding..." section feels like something unusual and not
> represented by the SPDX identifier.  Not sure what to do about that.

It is covered by the GPL license, it's just "crazy text" that means
nothing really.  They are just mad that people were taking their code
and using it in non-gpl products :(

> The 2 camera patches are:
> 
> Reviewed-by: Eric Anholt 

thanks for the review,

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


Re: 答复: 答复: [PATCH] ION: Sys_heap: fix the incorrect pool->gfp_mask setting

2018-01-11 Thread Laura Abbott

On 01/10/2018 06:06 PM, Zengtao (B) wrote:

-邮件原件-
发件人: Laura Abbott [mailto:labb...@redhat.com]
发送时间: 2018年1月11日 8:01
收件人: Zengtao (B) ; Dan Carpenter
; Chenfeng (puck) 
抄送: sumit.sem...@linaro.org; gre...@linuxfoundation.org;
a...@android.com; tk...@android.com; m...@android.com;
de...@driverdev.osuosl.org; linux-ker...@vger.kernel.org
主题: Re: 答复: [PATCH] ION: Sys_heap: fix the incorrect pool->gfp_mask
setting

On 01/09/2018 04:06 AM, Zengtao (B) wrote:

-邮件原件-
发件人: Dan Carpenter [mailto:dan.carpen...@oracle.com]
发送时间: 2018年1月9日 17:14
收件人: Chenfeng (puck) 
抄送: Zengtao (B) ; labb...@redhat.com;
sumit.sem...@linaro.org; gre...@linuxfoundation.org;
a...@android.com; tk...@android.com; m...@android.com;
de...@driverdev.osuosl.org; linux-ker...@vger.kernel.org
主题: Re: [PATCH] ION: Sys_heap: fix the incorrect pool->gfp_mask
setting

On Tue, Jan 09, 2018 at 11:30:09AM +0800, Chen Feng wrote:



On 2018/1/9 18:43, Zeng Tao wrote:

This issue is introduced by the commit  ("ION: Sys_heap:
Add cached pool to spead up cached buffer alloc"),


Use the Fixes tag.

Fixes: e7f63771b60e ("ION: Sys_heap: Add cached pool to spead up
cached buffer alloc")


Agree, thanks.



If you're going to be fixing this, it would be good to fix the other problems
pointed out (stop with the #define of the flags).


It is OK, I will fix in the new version fix.

And to make the code more explicit, I have to choices of fixes:
Choice 1:
if (orders[i] > 4)
gfp_flags = high_order_gfp_flags;
else
gfp_flags = low_order_gfp_flags;
Choice 2:
gfp_flags = (orders[i] > 4) ? high_order_gfp_flags : low_order_gfp_flags;



I prefer #1, but please make sure you are following the
suggestions in https://marc.info/?l=linux-kernel=151518104214191=2


Any suggestion ?


BTW, I found another problem related:
Currently the order 4 and order 0 allocation flag haven't got the __GFP_NOWARN 
set,
if the order 4 allocation failed but the allocation of order 0 success, it will 
print warning
message which is useless.

Of course, this is not related to this fix, but this is what I have met when 
test this fix.



Yes, go ahead and fix that in a separate patch too.


Thanks
Zengtao



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


Re:

2018-01-11 Thread Ben Evans
I've been working off and on with this.  Since you're getting into the
counters in a couple of the patches, part of the reason for all the
#defines here are because MDC, MDT and OST counters are all shoved into
the same array dynamically, sometimes.  It would be a much cleaner
approach to have a separate array for the MDC stats, then print them
conditionally.

This would reduce all of the calls to these macros to counter increments.

-Ben Evans

On 1/11/18, 12:16 PM, "Fabian Huegel"  wrote:

>We cleaned up a lot of checkpatch errors and warnings in obd_class.h,
>but there are still some CHECKs and two warnings about flow control
>inside macros left.
>
>Changing those macros to inline functions would probably
>be a good idea, unfortunatly it's not straightforward since they use
>'#op' to print the name of the operation.
>
>We also did some aligning to make the code more readable and removed
>an unnecessary macro.
>
>We only tested, that the kernel still compiles and the lustre kernel
>module loads successfully, but given the harmless nature of these
>changes we don't expect any problems.
>
>The patches are based on the staging-testing branch of the staging tree.
>

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


[PATCH 8/8] staging: lustre: Align backslashes in multi-line macros

2018-01-11 Thread Fabian Huegel
This patch right aligns all backslashes in multi-line macros
in obd_class.h for better readability.

Signed-off-by: Fabian Huegel 
Signed-off-by: Christoph Volkert 
---
 drivers/staging/lustre/lustre/include/obd_class.h | 166 +++---
 1 file changed, 83 insertions(+), 83 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_class.h 
b/drivers/staging/lustre/lustre/include/obd_class.h
index 99c9a3d..6b8027f 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -327,116 +327,116 @@ static inline int obd_check_dev_active(struct 
obd_device *obd)
return rc;
 }
 
-#define OBD_COUNTER_OFFSET(op)   \
-   ((offsetof(struct obd_ops, op) -  \
- offsetof(struct obd_ops, iocontrol))  \
-/ sizeof(((struct obd_ops *)(0))->iocontrol))
-
-#define OBD_COUNTER_INCREMENT(obdx, op)   \
-do { \
-   if ((obdx)->obd_stats) {  \
-   unsigned int coffset;\
-   coffset = (unsigned int)((obdx)->obd_cntr_base) + \
-   OBD_COUNTER_OFFSET(op);\
-   LASSERT(coffset < (obdx)->obd_stats->ls_num); \
-   lprocfs_counter_incr((obdx)->obd_stats, coffset); \
-   } \
+#define OBD_COUNTER_OFFSET(op) \
+   ((offsetof(struct obd_ops, op) -\
+   offsetof(struct obd_ops, iocontrol))\
+   / sizeof(((struct obd_ops *)(0))->iocontrol))
+
+#define OBD_COUNTER_INCREMENT(obdx, op)
\
+do {   \
+   if ((obdx)->obd_stats) {\
+   unsigned int coffset;   \
+   coffset = (unsigned int)((obdx)->obd_cntr_base) +   \
+   OBD_COUNTER_OFFSET(op); \
+   LASSERT(coffset < (obdx)->obd_stats->ls_num);   \
+   lprocfs_counter_incr((obdx)->obd_stats, coffset);   \
+   }   \
 } while (0)
 
-#define EXP_COUNTER_INCREMENT(export, op)  \
-do {   \
-   if ((export)->exp_obd->obd_stats) {   \
-   unsigned int coffset;   \
+#define EXP_COUNTER_INCREMENT(export, op)   \
+do {\
+   if ((export)->exp_obd->obd_stats) {  \
+   unsigned int coffset;\
coffset = (unsigned int)((export)->exp_obd->obd_cntr_base) + \
-   OBD_COUNTER_OFFSET(op);   \
+   OBD_COUNTER_OFFSET(op);  \
LASSERT(coffset < (export)->exp_obd->obd_stats->ls_num); \
lprocfs_counter_incr((export)->exp_obd->obd_stats, coffset); \
-   }   \
+   }\
 } while (0)
 
-#define MD_COUNTER_OFFSET(op) \
-   ((offsetof(struct md_ops, op) -\
- offsetof(struct md_ops, getstatus))\
-/ sizeof(((struct md_ops *)(0))->getstatus))
+#define MD_COUNTER_OFFSET(op)  \
+   ((offsetof(struct md_ops, op) - \
+   offsetof(struct md_ops, getstatus)) \
+   / sizeof(((struct md_ops *)(0))->getstatus))
 
-#define MD_COUNTER_INCREMENT(obdx, op)\
-do {  \
-   if ((obd)->md_stats) { \
-   unsigned int coffset;   \
+#define MD_COUNTER_INCREMENT(obdx, op)  \
+do {\
+   if ((obd)->md_stats) {   \
+   unsigned int coffset;\
coffset = (unsigned int)((obdx)->md_cntr_base) + \
-   MD_COUNTER_OFFSET(op); \
-   LASSERT(coffset < (obdx)->md_stats->ls_num); \
+   MD_COUNTER_OFFSET(op);   \
+   LASSERT(coffset < (obdx)->md_stats->ls_num); \

[PATCH 6/8] staging: lustre: Fix overlong lines

2018-01-11 Thread Fabian Huegel
Fixed four lines that went over the 80 character limit
to reduce checkpatch warnings.

Signed-off-by: Fabian Huegel 
Signed-off-by: Christoph Volkert 
---
 drivers/staging/lustre/lustre/include/obd_class.h | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_class.h 
b/drivers/staging/lustre/lustre/include/obd_class.h
index d195866..06f825b 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -850,7 +850,9 @@ static inline int obd_pool_del(struct obd_device *obd, char 
*poolname)
return rc;
 }
 
-static inline int obd_pool_add(struct obd_device *obd, char *poolname, char 
*ostname)
+static inline int obd_pool_add(struct obd_device *obd,
+  char *poolname,
+  char *ostname)
 {
int rc;
 
@@ -861,7 +863,9 @@ static inline int obd_pool_add(struct obd_device *obd, char 
*poolname, char *ost
return rc;
 }
 
-static inline int obd_pool_rem(struct obd_device *obd, char *poolname, char 
*ostname)
+static inline int obd_pool_rem(struct obd_device *obd,
+  char *poolname,
+  char *ostname)
 {
int rc;
 
@@ -997,7 +1001,8 @@ static inline int obd_statfs(const struct lu_env *env, 
struct obd_export *exp,
spin_unlock(>obd_osfs_lock);
}
} else {
-   CDEBUG(D_SUPER, "%s: use %p cache blocks %llu/%llu objects 
%llu/%llu\n",
+   CDEBUG(D_SUPER,
+  "%s: use %p cache blocks %llu/%llu objects %llu/%llu\n",
   obd->obd_name, >obd_osfs,
   obd->obd_osfs.os_bavail, obd->obd_osfs.os_blocks,
   obd->obd_osfs.os_ffree, obd->obd_osfs.os_files);
@@ -1579,7 +1584,8 @@ int class_procfs_init(void);
 int class_procfs_clean(void);
 
 /* prng.c */
-#define ll_generate_random_uuid(uuid_out) get_random_bytes(uuid_out, 
sizeof(class_uuid_t))
+#define ll_generate_random_uuid(uuid_out) \
+   get_random_bytes(uuid_out, sizeof(class_uuid_t))
 
 /* statfs_pack.c */
 struct kstatfs;
-- 
2.7.4

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


[PATCH 7/8] staging: lustre: Align struct member identifiers

2018-01-11 Thread Fabian Huegel
This patch properly left aligns all member identifiers in every
struct defined in obd_class.h for better readability.

Signed-off-by: Fabian Huegel 
Signed-off-by: Christoph Volkert 
---
 drivers/staging/lustre/lustre/include/obd_class.h | 44 +++
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_class.h 
b/drivers/staging/lustre/lustre/include/obd_class.h
index 06f825b..99c9a3d 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -145,13 +145,13 @@ void lprocfs_echo_init_vars(struct lprocfs_static_vars 
*lvars);
 
 /* Passed as data param to class_config_parse_llog */
 struct config_llog_instance {
-   char   *cfg_obdname;
-   void   *cfg_instance;
+   char   *cfg_obdname;
+   void   *cfg_instance;
struct super_block *cfg_sb;
struct obd_uuid cfg_uuid;
llog_cb_t   cfg_callback;
-   int  cfg_last_idx; /* for partial llog processing */
-   int  cfg_flags;
+   int cfg_last_idx; /* for partial llog processing */
+   int cfg_flags;
 };
 
 int class_config_parse_llog(const struct lu_env *env, struct llog_ctxt *ctxt,
@@ -169,31 +169,31 @@ enum {
 
 /* list of active configuration logs  */
 struct config_llog_data {
-   struct ldlm_res_idcld_resid;
+   struct ldlm_res_id  cld_resid;
struct config_llog_instance cld_cfg;
-   struct list_head  cld_list_chain;
-   atomic_tcld_refcount;
+   struct list_headcld_list_chain;
+   atomic_tcld_refcount;
struct config_llog_data*cld_sptlrpc;/* depended sptlrpc log */
struct config_llog_data*cld_params; /* common parameters log */
struct config_llog_data*cld_recover;/* imperative recover log */
-   struct obd_export *cld_mgcexp;
+   struct obd_export  *cld_mgcexp;
struct mutexcld_lock;
-   int  cld_type;
-   unsigned intcld_stopping:1, /*
-* we were told to stop
-* watching
-*/
-   cld_lostlock:1; /* lock not requeued */
-   charcld_logname[0];
+   int cld_type;
+   unsigned intcld_stopping:1, /*
+* we were told to stop
+* watching
+*/
+   cld_lostlock:1; /* lock not requeued */
+   charcld_logname[0];
 };
 
 struct lustre_profile {
-   struct list_head   lp_list;
-   char*lp_profile;
-   char*lp_dt;
-   char*lp_md;
-   int lp_refs;
-   boollp_list_deleted;
+   struct list_head lp_list;
+   char*lp_profile;
+   char*lp_dt;
+   char*lp_md;
+   int  lp_refs;
+   bool lp_list_deleted;
 };
 
 struct lustre_profile *class_get_profile(const char *prof);
@@ -1544,7 +1544,7 @@ struct lwp_register_item {
struct obd_export **lri_exp;
register_lwp_cb lri_cb_func;
void   *lri_cb_data;
-   struct list_headlri_list;
+   struct list_headlri_list;
charlri_name[MTI_NAME_MAXLEN];
 };
 
-- 
2.7.4

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


[PATCH 5/8] staging: lustre: Add identifier names to function declarations

2018-01-11 Thread Fabian Huegel
Checkpatch was complaining about missing identifier names in function
declarations. So we added the missing names according to the names in
the respective function implementation. *obd_import* was sometimes named
*import* and sometimes *imp* (in genops.c), so to avoid confusion we just
named it imp everywhere.

Signed-off-by: Fabian Huegel 
Signed-off-by: Christoph Volkert 
---
 drivers/staging/lustre/lustre/include/obd_class.h | 22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_class.h 
b/drivers/staging/lustre/lustre/include/obd_class.h
index 9a61117..d195866 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -52,7 +52,7 @@ extern struct obd_device *obd_devs[MAX_OBD_DEVICES];
 extern rwlock_t obd_dev_lock;
 
 /* OBD Operations Declarations */
-struct obd_device *class_exp2obd(struct obd_export *);
+struct obd_device *class_exp2obd(struct obd_export *exp);
 int class_handle_ioctl(unsigned int cmd, unsigned long arg);
 int lustre_get_jobid(char *jobid);
 
@@ -60,10 +60,10 @@ struct lu_device_type;
 
 /* genops.c */
 extern struct list_head obd_types;
-struct obd_export *class_conn2export(struct lustre_handle *);
-int class_register_type(struct obd_ops *, struct md_ops *,
-   const char *nm, struct lu_device_type *ldt);
-int class_unregister_type(const char *nm);
+struct obd_export *class_conn2export(struct lustre_handle *conn);
+int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops,
+   const char *name, struct lu_device_type *ldt);
+int class_unregister_type(const char *name);
 
 struct obd_device *class_newdev(const char *type_name, const char *name);
 void class_release_dev(struct obd_device *obd);
@@ -203,9 +203,11 @@ void class_del_profiles(void);
 
 #if LUSTRE_TRACKS_LOCK_EXP_REFS
 
-void __class_export_add_lock_ref(struct obd_export *, struct ldlm_lock *);
-void __class_export_del_lock_ref(struct obd_export *, struct ldlm_lock *);
-extern void (*class_export_dump_hook)(struct obd_export *);
+void __class_export_add_lock_ref(struct obd_export *exp,
+struct ldlm_lock *lock);
+void __class_export_del_lock_ref(struct obd_export *exp,
+struct ldlm_lock *lock);
+extern void (*class_export_dump_hook)(struct obd_export *exp);
 
 #else
 
@@ -221,8 +223,8 @@ struct obd_export *class_new_export(struct obd_device 
*obddev,
struct obd_uuid *cluuid);
 void class_unlink_export(struct obd_export *exp);
 
-struct obd_import *class_import_get(struct obd_import *);
-void class_import_put(struct obd_import *);
+struct obd_import *class_import_get(struct obd_import *imp);
+void class_import_put(struct obd_import *imp);
 struct obd_import *class_new_import(struct obd_device *obd);
 void class_destroy_import(struct obd_import *exp);
 
-- 
2.7.4

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


[PATCH 2/8] staging: lustre: Enclose complex macros in do-while loops

2018-01-11 Thread Fabian Huegel
Some complex multi-line macros were not enclosed by a do-while(0),
so we fixed that.

Signed-off-by: Fabian Huegel 
Signed-off-by: Christoph Volkert 
---
 drivers/staging/lustre/lustre/include/obd_class.h | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_class.h 
b/drivers/staging/lustre/lustre/include/obd_class.h
index 5c8cf30..dbe8225 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -332,22 +332,26 @@ static inline int obd_check_dev_active(struct obd_device 
*obd)
 / sizeof(((struct obd_ops *)(0))->iocontrol))
 
 #define OBD_COUNTER_INCREMENT(obdx, op)   \
+do { \
if ((obdx)->obd_stats) {  \
unsigned int coffset;\
coffset = (unsigned int)((obdx)->obd_cntr_base) + \
OBD_COUNTER_OFFSET(op);\
LASSERT(coffset < (obdx)->obd_stats->ls_num); \
lprocfs_counter_incr((obdx)->obd_stats, coffset); \
-   }
+   } \
+} while (0)
 
 #define EXP_COUNTER_INCREMENT(export, op)  \
+do {   \
if ((export)->exp_obd->obd_stats) {   \
unsigned int coffset;   \
coffset = (unsigned int)((export)->exp_obd->obd_cntr_base) + \
OBD_COUNTER_OFFSET(op);   \
LASSERT(coffset < (export)->exp_obd->obd_stats->ls_num); \
lprocfs_counter_incr((export)->exp_obd->obd_stats, coffset); \
-   }
+   }   \
+} while (0)
 
 #define MD_COUNTER_OFFSET(op) \
((offsetof(struct md_ops, op) -\
@@ -355,15 +359,18 @@ static inline int obd_check_dev_active(struct obd_device 
*obd)
 / sizeof(((struct md_ops *)(0))->getstatus))
 
 #define MD_COUNTER_INCREMENT(obdx, op)\
+do {  \
if ((obd)->md_stats) { \
unsigned int coffset;   \
coffset = (unsigned int)((obdx)->md_cntr_base) + \
MD_COUNTER_OFFSET(op); \
LASSERT(coffset < (obdx)->md_stats->ls_num); \
lprocfs_counter_incr((obdx)->md_stats, coffset); \
-   }
+   }\
+} while (0)
 
 #define EXP_MD_COUNTER_INCREMENT(export, op)\
+do {   \
if ((export)->exp_obd->obd_stats) {   \
unsigned int coffset;   \
coffset = (unsigned int)((export)->exp_obd->md_cntr_base) +  \
@@ -373,7 +380,8 @@ static inline int obd_check_dev_active(struct obd_device 
*obd)
if ((export)->exp_md_stats)   \
lprocfs_counter_incr(   \
(export)->exp_md_stats, coffset);   \
-   }
+   }   \
+} while (0)
 
 #define EXP_CHECK_MD_OP(exp, op)   \
 do {   \
-- 
2.7.4

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


[PATCH 1/8] staging: lustre: Enclose complex macros in parentheses

2018-01-11 Thread Fabian Huegel
Checkpatch wants complex macros to be enclosed in parentheses, so we
put parentheses around these four macros.

Signed-off-by: Fabian Huegel 
Signed-off-by: Christoph Volkert 
---
 drivers/staging/lustre/lustre/include/obd_class.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_class.h 
b/drivers/staging/lustre/lustre/include/obd_class.h
index 67c535c..5c8cf30 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -294,10 +294,10 @@ struct obdo;
 
 void obdo_to_ioobj(const struct obdo *oa, struct obd_ioobj *ioobj);
 
-#define OBT(dev)   (dev)->obd_type
-#define OBP(dev, op)(dev)->obd_type->typ_dt_ops->op
-#define MDP(dev, op)(dev)->obd_type->typ_md_ops->op
-#define CTXTP(ctxt, op) (ctxt)->loc_logops->lop_##op
+#define OBT(dev)   ((dev)->obd_type)
+#define OBP(dev, op)((dev)->obd_type->typ_dt_ops->op)
+#define MDP(dev, op)((dev)->obd_type->typ_md_ops->op)
+#define CTXTP(ctxt, op) ((ctxt)->loc_logops->lop_##op)
 
 /* Ensure obd_setup: used for cleanup which must be called
  * while obd is stopping
-- 
2.7.4

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


[PATCH 3/8] staging: lustre: Remove DECLARE_LU_VARS macro

2018-01-11 Thread Fabian Huegel
This macro was only used in four places to declare two variables.
It saved one line of code, but in our opinion hurt readability.
So we removed the macro, substituting every occurrence with the
declaration of the two variables (like the preprocessor would have done).

Signed-off-by: Fabian Huegel 
Signed-off-by: Christoph Volkert 
---
 drivers/staging/lustre/lustre/include/obd_class.h | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_class.h 
b/drivers/staging/lustre/lustre/include/obd_class.h
index dbe8225..8fc14ed 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -489,14 +489,11 @@ static inline int obd_set_info_async(const struct lu_env 
*env,
  * obd_precleanup() and obd_cleanup() call both lu_device and obd operations.
  */
 
-#define DECLARE_LU_VARS(ldt, d) \
-   struct lu_device_type *ldt;   \
-   struct lu_device *d
-
 static inline int obd_setup(struct obd_device *obd, struct lustre_cfg *cfg)
 {
int rc;
-   DECLARE_LU_VARS(ldt, d);
+   struct lu_device_type *ldt;
+   struct lu_device *d;
 
ldt = obd->obd_type->typ_lu;
if (ldt) {
@@ -534,7 +531,8 @@ static inline int obd_setup(struct obd_device *obd, struct 
lustre_cfg *cfg)
 static inline int obd_precleanup(struct obd_device *obd)
 {
int rc;
-   DECLARE_LU_VARS(ldt, d);
+   struct lu_device_type *ldt;
+   struct lu_device *d;
 
rc = obd_check_dev(obd);
if (rc)
@@ -560,7 +558,8 @@ static inline int obd_precleanup(struct obd_device *obd)
 static inline int obd_cleanup(struct obd_device *obd)
 {
int rc;
-   DECLARE_LU_VARS(ldt, d);
+   struct lu_device_type *ldt;
+   struct lu_device *d;
 
rc = obd_check_dev(obd);
if (rc)
@@ -608,7 +607,8 @@ static inline int
 obd_process_config(struct obd_device *obd, int datalen, void *data)
 {
int rc;
-   DECLARE_LU_VARS(ldt, d);
+   struct lu_device_type *ldt;
+   struct lu_device *d;
 
rc = obd_check_dev(obd);
if (rc)
-- 
2.7.4

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


[no subject]

2018-01-11 Thread Fabian Huegel
We cleaned up a lot of checkpatch errors and warnings in obd_class.h,
but there are still some CHECKs and two warnings about flow control
inside macros left.

Changing those macros to inline functions would probably
be a good idea, unfortunatly it's not straightforward since they use
'#op' to print the name of the operation.

We also did some aligning to make the code more readable and removed
an unnecessary macro.

We only tested, that the kernel still compiles and the lustre kernel
module loads successfully, but given the harmless nature of these
changes we don't expect any problems.

The patches are based on the staging-testing branch of the staging tree.

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


[PATCH 4/8] staging: lustre: Fix comment style

2018-01-11 Thread Fabian Huegel
Most multi-line comments started on the first line, but the preferred
linux kernel style is to start multi-line comments on the second line.
Some comments became less readable after the change, so we changed them
to single-line comments.

Signed-off-by: Fabian Huegel 
Signed-off-by: Christoph Volkert 
---
 drivers/staging/lustre/lustre/include/obd_class.h | 47 +--
 1 file changed, 27 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_class.h 
b/drivers/staging/lustre/lustre/include/obd_class.h
index 8fc14ed..9a61117 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -40,15 +40,12 @@
 #include 
 #include 
 
-#define OBD_STATFS_NODELAY  0x0001  /* requests should be send without 
delay
-* and resends for avoid deadlocks
-*/
-#define OBD_STATFS_FROM_CACHE   0x0002  /* the statfs callback should not 
update
-* obd_osfs_age
-*/
-#define OBD_STATFS_FOR_MDT00x0004  /* The statfs is only for retrieving
-* information from MDT0.
-*/
+/* requests should be send without delay and resends for avoid deadlocks */
+#define OBD_STATFS_NODELAY  0x0001
+/* the statfs callback should not update obd_osfs_age */
+#define OBD_STATFS_FROM_CACHE   0x0002
+/* the statfs is only for retrieving information from MDT0 */
+#define OBD_STATFS_FOR_MDT00x0004
 
 /* OBD Device Declarations */
 extern struct obd_device *obd_devs[MAX_OBD_DEVICES];
@@ -137,7 +134,7 @@ int class_config_llog_handler(const struct lu_env *env,
  struct llog_rec_hdr *rec, void *data);
 int class_add_uuid(const char *uuid, __u64 nid);
 
-/*obdecho*/
+/* obdecho */
 void lprocfs_echo_init_vars(struct lprocfs_static_vars *lvars);
 
 #define CFG_F_START 0x01   /* Set when we start updating from a log */
@@ -182,7 +179,8 @@ struct config_llog_data {
struct obd_export *cld_mgcexp;
struct mutexcld_lock;
int  cld_type;
-   unsigned intcld_stopping:1, /* we were told to stop
+   unsigned intcld_stopping:1, /*
+* we were told to stop
 * watching
 */
cld_lostlock:1; /* lock not requeued */
@@ -299,7 +297,8 @@ void obdo_to_ioobj(const struct obdo *oa, struct obd_ioobj 
*ioobj);
 #define MDP(dev, op)((dev)->obd_type->typ_md_ops->op)
 #define CTXTP(ctxt, op) ((ctxt)->loc_logops->lop_##op)
 
-/* Ensure obd_setup: used for cleanup which must be called
+/*
+ * Ensure obd_setup: used for cleanup which must be called
  * while obd is stopping
  */
 static inline int obd_check_dev(struct obd_device *obd)
@@ -586,7 +585,8 @@ static inline int obd_cleanup(struct obd_device *obd)
 
 static inline void obd_cleanup_client_import(struct obd_device *obd)
 {
-   /* If we set up but never connected, the
+   /*
+* If we set up but never connected, the
 * client import will not have been cleaned.
 */
down_write(>u.cli.cl_sem);
@@ -725,7 +725,8 @@ static inline struct obd_uuid *obd_get_uuid(struct 
obd_export *exp)
return uuid;
 }
 
-/** Create a new /a exp on device /a obd for the uuid /a cluuid
+/*
+ * Create a new /a exp on device /a obd for the uuid /a cluuid
  * @param exp New export handle
  * @param d Connect data, supported flags are set, flags also understood
  *by obd are returned.
@@ -737,7 +738,8 @@ static inline int obd_connect(const struct lu_env *env,
  void *localdata)
 {
int rc;
-   __u64 ocf = data ? data->ocd_connect_flags : 0; /* for post-condition
+   __u64 ocf = data ? data->ocd_connect_flags : 0; /*
+* for post-condition
 * check
 */
 
@@ -902,7 +904,8 @@ static inline int obd_destroy_export(struct obd_export *exp)
return 0;
 }
 
-/* @max_age is the oldest time in jiffies that we accept using a cached data.
+/*
+ * @max_age is the oldest time in jiffies that we accept using a cached data.
  * If the cache is older than @max_age we will get a new value from the
  * target.  Use a value of "cfs_time_current() + HZ" to guarantee freshness.
  */
@@ -963,7 +966,8 @@ static inline int obd_statfs_rqset(struct obd_export *exp,
return rc;
 }
 
-/* @max_age is the oldest time in jiffies that we accept using a cached data.
+/*
+ * @max_age is the oldest time in jiffies that we 

Re: [PATCH v3 0/6] fixes to remove enum typedefs

2018-01-11 Thread Claudiu Beznea
Hi Ajay,

Just a little note for your future patches: all changes history would
be good to be kept here, something like this:

changes in v3: this, this and this

changes in v2: this and this

Thanks,
Claudiu

On 11.01.2018 16:12, Ajay Singh wrote:
> Changes since v2: Removed v2 patch number 3,4,5 , where were handling
>   different changes under same subject line.
>   As those changes were independent, will work on those items and
>   send as separate patch later.
>   
> 
> Ajay Singh (6):
>   staging: wilc1000: removed typedef from enum BSSTYPE_T
>   staging: wilc1000: remove unnecessary typedef enum G_OPERATING_MODE_T
>   staging: wilc1000: removed enums typedef for BEACON_IE & TX_RATE_T
>   staging: wilc1000: removed enum typedef CHIP_PS_STATE_T
>   staging: wilc1000: removed enum typedef BUS_ACQUIRE_T
>   staging: wilc1000: removed enum typedef BUS_RELEASE_T
> 
>  drivers/staging/wilc1000/host_interface.c |  2 +-
>  drivers/staging/wilc1000/wilc_wlan.c  |  6 +++---
>  drivers/staging/wilc1000/wilc_wlan_if.h   | 28 ++--
>  3 files changed, 18 insertions(+), 18 deletions(-)
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 6/7] staging: dgnc: make dgnc_poll_tick static

2018-01-11 Thread Greg Kroah-Hartman
No one needs to see this global variable, so make it static.

Cc: Lidza Louina 
Cc: Mark Hounschell 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/dgnc/dgnc_driver.c | 2 +-
 drivers/staging/dgnc/dgnc_driver.h | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index 3f2815c16ea7..801966282bdd 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -23,8 +23,8 @@ MODULE_SUPPORTED_DEVICE("dgnc");
 static unsigned int dgnc_num_boards;
 struct dgnc_board  *dgnc_board[MAXBOARDS];
 static DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
-intdgnc_poll_tick = 20;/* Poll interval - 20 ms */
 
+static int dgnc_poll_tick = 20;/* Poll interval - 20 ms */
 static ulong   dgnc_poll_time; /* Time of next poll */
 static uintdgnc_poll_stop; /* Used to tell poller to stop */
 static struct timer_list dgnc_poll_timer;
diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index a6bfe15bd499..b71e6d1d4ec4 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -372,7 +372,6 @@ struct channel_t {
ulong   ch_xoff_sends;
 };
 
-extern int dgnc_poll_tick; /* Poll interval - 20 ms */
 extern struct dgnc_board *dgnc_board[MAXBOARDS];/* Array of boards */
 
 #endif /* _DGNC_DRIVER_H */
-- 
2.15.1

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


[PATCH 4/7] staging: dgnc: make dgnc_poll_lock static

2018-01-11 Thread Greg Kroah-Hartman
There's no need for this spinlock to be global, so make it a static
variable.

Cc: Lidza Louina 
Cc: Mark Hounschell 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/dgnc/dgnc_driver.c | 2 +-
 drivers/staging/dgnc/dgnc_driver.h | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index ce9090a95d84..ae3767315ef5 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -23,7 +23,7 @@ MODULE_SUPPORTED_DEVICE("dgnc");
 static unsigned int dgnc_num_boards;
 struct dgnc_board  *dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
-DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
+static DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
 intdgnc_poll_tick = 20;/* Poll interval - 20 ms */
 
 static ulong   dgnc_poll_time; /* Time of next poll */
diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index 691c79c979f6..ebd46895f5a9 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -375,7 +375,6 @@ struct channel_t {
 extern uintdgnc_major; /* Our driver/mgmt major */
 extern int dgnc_poll_tick; /* Poll interval - 20 ms */
 extern spinlock_t  dgnc_global_lock;   /* Driver global spinlock */
-extern spinlock_t  dgnc_poll_lock; /* Poll scheduling lock */
 extern struct dgnc_board *dgnc_board[MAXBOARDS];/* Array of boards */
 
 #endif /* _DGNC_DRIVER_H */
-- 
2.15.1

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


[PATCH 5/7] staging: dgnc: remove some global variables

2018-01-11 Thread Greg Kroah-Hartman
There were some global variables not being used at all, so just delete
them.

Cc: Lidza Louina 
Cc: Mark Hounschell 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/dgnc/dgnc_driver.c | 1 -
 drivers/staging/dgnc/dgnc_driver.h | 2 --
 2 files changed, 3 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index ae3767315ef5..3f2815c16ea7 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -22,7 +22,6 @@ MODULE_SUPPORTED_DEVICE("dgnc");
 
 static unsigned int dgnc_num_boards;
 struct dgnc_board  *dgnc_board[MAXBOARDS];
-DEFINE_SPINLOCK(dgnc_global_lock);
 static DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
 intdgnc_poll_tick = 20;/* Poll interval - 20 ms */
 
diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index ebd46895f5a9..a6bfe15bd499 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -372,9 +372,7 @@ struct channel_t {
ulong   ch_xoff_sends;
 };
 
-extern uintdgnc_major; /* Our driver/mgmt major */
 extern int dgnc_poll_tick; /* Poll interval - 20 ms */
-extern spinlock_t  dgnc_global_lock;   /* Driver global spinlock */
 extern struct dgnc_board *dgnc_board[MAXBOARDS];/* Array of boards */
 
 #endif /* _DGNC_DRIVER_H */
-- 
2.15.1

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


[PATCH 2/7] staging: dgnc: remove crazy "management" device node

2018-01-11 Thread Greg Kroah-Hartman
There's no need for a special character device just to get some random
information out of a single serial port driver.  So remove the
dgnc_mgmt.c file, and some structures and ioctl definitions that only it
was using.

Cc: Lidza Louina 
Cc: Mark Hounschell 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/dgnc/Makefile  |   2 +-
 drivers/staging/dgnc/dgnc_driver.c |  47 
 drivers/staging/dgnc/dgnc_mgmt.c   | 239 -
 drivers/staging/dgnc/dgnc_mgmt.h   |  17 ---
 drivers/staging/dgnc/digi.h|  44 ---
 5 files changed, 1 insertion(+), 348 deletions(-)
 delete mode 100644 drivers/staging/dgnc/dgnc_mgmt.c
 delete mode 100644 drivers/staging/dgnc/dgnc_mgmt.h

diff --git a/drivers/staging/dgnc/Makefile b/drivers/staging/dgnc/Makefile
index 6db58475efb0..818e2ea3d1b0 100644
--- a/drivers/staging/dgnc/Makefile
+++ b/drivers/staging/dgnc/Makefile
@@ -1,5 +1,5 @@
 obj-$(CONFIG_DGNC) += dgnc.o
 
 dgnc-objs :=   dgnc_cls.o dgnc_driver.o\
-   dgnc_mgmt.o dgnc_neo.o\
+   dgnc_neo.o\
dgnc_tty.o
diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index 3e49a4ed24fd..64967048d478 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -11,7 +11,6 @@
 #include 
 #include "dgnc_driver.h"
 #include "dgnc_pci.h"
-#include "dgnc_mgmt.h"
 #include "dgnc_tty.h"
 #include "dgnc_cls.h"
 #include "dgnc_neo.h"
@@ -21,22 +20,12 @@ MODULE_AUTHOR("Digi International, http://www.digi.com;);
 MODULE_DESCRIPTION("Driver for the Digi International Neo and Classic PCI 
based product line");
 MODULE_SUPPORTED_DEVICE("dgnc");
 
-static const struct file_operations dgnc_board_fops = {
-   .owner  =   THIS_MODULE,
-   .unlocked_ioctl =   dgnc_mgmt_ioctl,
-   .open   =   dgnc_mgmt_open,
-   .release=   dgnc_mgmt_close
-};
-
 uint   dgnc_num_boards;
 struct dgnc_board  *dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
 DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
-uint   dgnc_major;
 intdgnc_poll_tick = 20;/* Poll interval - 20 ms */
 
-static struct class *dgnc_class;
-
 static ulong   dgnc_poll_time; /* Time of next poll */
 static uintdgnc_poll_stop; /* Used to tell poller to stop */
 static struct timer_list dgnc_poll_timer;
@@ -379,32 +368,7 @@ static struct pci_driver dgnc_driver = {
 
 static int dgnc_start(void)
 {
-   int rc = 0;
unsigned long flags;
-   struct device *dev;
-
-   rc = register_chrdev(0, "dgnc", _board_fops);
-   if (rc < 0) {
-   pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc);
-   return rc;
-   }
-   dgnc_major = rc;
-
-   dgnc_class = class_create(THIS_MODULE, "dgnc_mgmt");
-   if (IS_ERR(dgnc_class)) {
-   rc = PTR_ERR(dgnc_class);
-   pr_err(DRVSTR ": Can't create dgnc_mgmt class (%d)\n", rc);
-   goto failed_class;
-   }
-
-   dev = device_create(dgnc_class, NULL,
-   MKDEV(dgnc_major, 0),
-   NULL, "dgnc_mgmt");
-   if (IS_ERR(dev)) {
-   rc = PTR_ERR(dev);
-   pr_err(DRVSTR ": Can't create device (%d)\n", rc);
-   goto failed_device;
-   }
 
/* Start the poller */
spin_lock_irqsave(_poll_lock, flags);
@@ -416,13 +380,6 @@ static int dgnc_start(void)
add_timer(_poll_timer);
 
return 0;
-
-failed_device:
-   class_destroy(dgnc_class);
-failed_class:
-   unregister_chrdev(dgnc_major, "dgnc");
-
-   return rc;
 }
 
 /* Free all the memory associated with a board */
@@ -486,10 +443,6 @@ static void cleanup(void)
/* Turn off poller right away. */
del_timer_sync(_poll_timer);
 
-   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
-   class_destroy(dgnc_class);
-   unregister_chrdev(dgnc_major, "dgnc");
-
for (i = 0; i < dgnc_num_boards; ++i) {
dgnc_cleanup_tty(dgnc_board[i]);
dgnc_cleanup_board(dgnc_board[i]);
diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c
deleted file mode 100644
index 47b10168560d..
--- a/drivers/staging/dgnc/dgnc_mgmt.c
+++ /dev/null
@@ -1,239 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright 2003 Digi International (www.digi.com)
- * Scott H Kilau 
- */
-
-/*
- * This file implements the mgmt functionality for the
- * Neo and ClassicBoard based product lines.
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include "dgnc_driver.h"
-#include "dgnc_pci.h"
-#include "dgnc_mgmt.h"
-
-/* Our "in use" variables, to enforce 1 open only */
-static int 

[PATCH 3/7] staging: dgnc: make dgnc_num_boards static

2018-01-11 Thread Greg Kroah-Hartman
There's no need for the world to know the number of dgnc boards in the
system, so just make it a static variable.

Cc: Lidza Louina 
Cc: Mark Hounschell 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/dgnc/dgnc_driver.c | 2 +-
 drivers/staging/dgnc/dgnc_driver.h | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index 64967048d478..ce9090a95d84 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -20,7 +20,7 @@ MODULE_AUTHOR("Digi International, http://www.digi.com;);
 MODULE_DESCRIPTION("Driver for the Digi International Neo and Classic PCI 
based product line");
 MODULE_SUPPORTED_DEVICE("dgnc");
 
-uint   dgnc_num_boards;
+static unsigned int dgnc_num_boards;
 struct dgnc_board  *dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
 DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index 8389b6cf5317..691c79c979f6 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -376,7 +376,6 @@ extern uint dgnc_major; /* Our 
driver/mgmt major */
 extern int dgnc_poll_tick; /* Poll interval - 20 ms */
 extern spinlock_t  dgnc_global_lock;   /* Driver global spinlock */
 extern spinlock_t  dgnc_poll_lock; /* Poll scheduling lock */
-extern uintdgnc_num_boards;/* Total number of boards */
 extern struct dgnc_board *dgnc_board[MAXBOARDS];/* Array of boards */
 
 #endif /* _DGNC_DRIVER_H */
-- 
2.15.1

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


[PATCH 7/7] staging: dgnc: remove duplicated tty defines

2018-01-11 Thread Greg Kroah-Hartman
The dgnc driver defined numerous TTY defines that the core kernel
already defines.  So just remove this duplication.

Cc: Lidza Louina 
Cc: Mark Hounschell 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/dgnc/digi.h | 24 
 1 file changed, 24 deletions(-)

diff --git a/drivers/staging/dgnc/digi.h b/drivers/staging/dgnc/digi.h
index 6cb541fe8422..6a09bd32e349 100644
--- a/drivers/staging/dgnc/digi.h
+++ b/drivers/staging/dgnc/digi.h
@@ -7,30 +7,6 @@
 #ifndef _DIGI_H
 #define _DIGI_H
 
-#ifndef TIOCM_LE
-#defineTIOCM_LE0x01/* line enable */
-#defineTIOCM_DTR   0x02/* data terminal ready 
*/
-#defineTIOCM_RTS   0x04/* request to send */
-#defineTIOCM_ST0x08/* secondary transmit */
-#defineTIOCM_SR0x10/* secondary receive */
-#defineTIOCM_CTS   0x20/* clear to send */
-#defineTIOCM_CAR   0x40/* carrier detect */
-#defineTIOCM_RNG   0x80/* ring indicator */
-#defineTIOCM_DSR   0x100   /* data set ready */
-#defineTIOCM_RITIOCM_RNG   /* ring (alternate) */
-#defineTIOCM_CDTIOCM_CAR   /* carrier detect (alt) 
*/
-#endif
-
-#if !defined(TIOCMSET)
-#defineTIOCMSET(('d' << 8) | 252)  /* set modem ctrl state 
*/
-#defineTIOCMGET(('d' << 8) | 253)  /* set modem ctrl state 
*/
-#endif
-
-#if !defined(TIOCMBIC)
-#defineTIOCMBIC(('d' << 8) | 254)  /* set modem ctrl state 
*/
-#defineTIOCMBIS(('d' << 8) | 255)  /* set modem ctrl state 
*/
-#endif
-
 #define DIGI_GETA  (('e' << 8) | 94)   /* Read params */
 #define DIGI_SETA  (('e' << 8) | 95)   /* Set params */
 #define DIGI_SETAW (('e' << 8) | 96)   /* Drain & set params */
-- 
2.15.1

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


[PATCH 1/7] staging: dgnc: delete dgnc_utils.c

2018-01-11 Thread Greg Kroah-Hartman
There was just one function in it, and it duplicated what
msleep_interruptable() was doing, which is pointless, so delete it and
fix up the one calling site.

Cc: Lidza Louina 
Cc: Mark Hounschell 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/dgnc/Makefile |  2 +-
 drivers/staging/dgnc/dgnc_tty.c   |  3 +--
 drivers/staging/dgnc/dgnc_utils.c | 17 -
 drivers/staging/dgnc/dgnc_utils.h |  7 ---
 4 files changed, 2 insertions(+), 27 deletions(-)
 delete mode 100644 drivers/staging/dgnc/dgnc_utils.c
 delete mode 100644 drivers/staging/dgnc/dgnc_utils.h

diff --git a/drivers/staging/dgnc/Makefile b/drivers/staging/dgnc/Makefile
index 40ff0d007695..6db58475efb0 100644
--- a/drivers/staging/dgnc/Makefile
+++ b/drivers/staging/dgnc/Makefile
@@ -2,4 +2,4 @@ obj-$(CONFIG_DGNC) += dgnc.o
 
 dgnc-objs :=   dgnc_cls.o dgnc_driver.o\
dgnc_mgmt.o dgnc_neo.o\
-   dgnc_tty.o dgnc_utils.o
+   dgnc_tty.o
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index d2809f6bfe69..1323d7f68ab8 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -26,7 +26,6 @@
 #include "dgnc_tty.h"
 #include "dgnc_neo.h"
 #include "dgnc_cls.h"
-#include "dgnc_utils.h"
 
 /* Default transparent print information. */
 
@@ -1229,7 +1228,7 @@ static void dgnc_tty_close(struct tty_struct *tty, struct 
file *file)
if (ch->ch_close_delay) {
spin_unlock_irqrestore(>ch_lock,
   flags);
-   dgnc_ms_sleep(ch->ch_close_delay);
+   msleep_interruptible(ch->ch_close_delay);
spin_lock_irqsave(>ch_lock, flags);
}
}
diff --git a/drivers/staging/dgnc/dgnc_utils.c 
b/drivers/staging/dgnc/dgnc_utils.c
deleted file mode 100644
index 620f5741a1ed..
--- a/drivers/staging/dgnc/dgnc_utils.c
+++ /dev/null
@@ -1,17 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#include 
-#include 
-#include "dgnc_utils.h"
-
-/**
- * dgnc_ms_sleep - Put the driver to sleep
- * @ms - milliseconds to sleep
- *
- * Return: 0 if timed out, if interrupted by a signal return signal.
- */
-int dgnc_ms_sleep(ulong ms)
-{
-   __set_current_state(TASK_INTERRUPTIBLE);
-   schedule_timeout((ms * HZ) / 1000);
-   return signal_pending(current);
-}
diff --git a/drivers/staging/dgnc/dgnc_utils.h 
b/drivers/staging/dgnc/dgnc_utils.h
deleted file mode 100644
index b30527f0889d..
--- a/drivers/staging/dgnc/dgnc_utils.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _DGNC_UTILS_H
-#define _DGNC_UTILS_H
-
-int dgnc_ms_sleep(ulong ms);
-
-#endif /* _DGNC_UTILS_H */
-- 
2.15.1

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


Re: [PATCH 1/2] kconfig: use bool instead of boolean for type definition attributes, again

2018-01-11 Thread Masahiro Yamada
2017-12-16 0:38 GMT+09:00 Masahiro Yamada :
> Commit 6341e62b212a ("kconfig: use bool instead of boolean for type
> definition attributes") did treewide replacement of 'boolean', and
> also mentioned the keyword 'boolean' would be dropped later on.
>
> Some years have passed, but it has not happened yet.  Meanwhile, some
> new instances have come up.
>
> I am really going to drop this keyword.  I need to do the replacement
> once again.
>
> Signed-off-by: Masahiro Yamada 
> ---
>

Applied to linux-kbuild/kconfig.


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


[PATCH v3 6/6] staging: wilc1000: removed enum typedef BUS_RELEASE_T

2018-01-11 Thread Ajay Singh
This patch removes enum typedef BUS_RELEASE_T and define
"enum bus_release" to use instead of typedef.

checkpatch.pl not to add new typedef warning is fixed with this patch.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wlan.c| 2 +-
 drivers/staging/wilc1000/wilc_wlan_if.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 80a5a0b..a2b26ec 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -13,7 +13,7 @@ static inline void acquire_bus(struct wilc *wilc, enum 
bus_acquire acquire)
chip_wakeup(wilc);
 }
 
-static inline void release_bus(struct wilc *wilc, BUS_RELEASE_T release)
+static inline void release_bus(struct wilc *wilc, enum bus_release release)
 {
if (release == RELEASE_ALLOW_SLEEP)
chip_allow_sleep(wilc);
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index 2bc500d..1641ddb 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -148,10 +148,10 @@ enum bus_acquire {
ACQUIRE_AND_WAKEUP  = 1,
 };
 
-typedef enum {
+enum bus_release {
RELEASE_ONLY= 0,
RELEASE_ALLOW_SLEEP = 1,
-} BUS_RELEASE_T;
+};
 
 typedef enum {
NO_SECURITY = 0,
-- 
2.7.4


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


[PATCH v3 5/6] staging: wilc1000: removed enum typedef BUS_ACQUIRE_T

2018-01-11 Thread Ajay Singh
This patch removes enum typedef BUS_ACQUIRE_T and define
enum bus_acquire to use instead of typedef.

checkpatch.pl not to add new typedef warning is fixed with this patch.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wlan.c| 2 +-
 drivers/staging/wilc1000/wilc_wlan_if.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 3a58a62..80a5a0b 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -6,7 +6,7 @@
 
 static enum chip_ps_states chip_ps_state = CHIP_WAKEDUP;
 
-static inline void acquire_bus(struct wilc *wilc, BUS_ACQUIRE_T acquire)
+static inline void acquire_bus(struct wilc *wilc, enum bus_acquire acquire)
 {
mutex_lock(>hif_cs);
if (acquire == ACQUIRE_AND_WAKEUP)
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index ab12090..2bc500d 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -143,10 +143,10 @@ enum chip_ps_states {
CHIP_SLEEPING_MANUAL= 2
 };
 
-typedef enum {
+enum bus_acquire {
ACQUIRE_ONLY= 0,
ACQUIRE_AND_WAKEUP  = 1,
-} BUS_ACQUIRE_T;
+};
 
 typedef enum {
RELEASE_ONLY= 0,
-- 
2.7.4


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


[PATCH v3 1/6] staging: wilc1000: removed typedef from enum BSSTYPE_T

2018-01-11 Thread Ajay Singh
This patch removes typedef from enum BSSTYPE_T and
rename it to bss_types.

It fixes "WARNING: do not add new typdefs" warning
reported by checkpatch.pl.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 drivers/staging/wilc1000/wilc_wlan_if.h   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index d69248a..4ff1a59 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -202,7 +202,7 @@ struct host_if_msg {
 };
 
 struct join_bss_param {
-   BSSTYPE_T bss_type;
+   enum bss_types bss_type;
u8 dtim_period;
u16 beacon_period;
u16 cap_info;
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index c1693cf..2baf6c4 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -85,11 +85,11 @@ typedef enum {
P2P_IE  = 221,
 } BEACON_IE;
 
-typedef enum {
+enum bss_types {
INFRASTRUCTURE  = 0,
INDEPENDENT,
AP,
-} BSSTYPE_T;
+};
 
 typedef enum {
RATE_AUTO   = 0,
-- 
2.7.4


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


[PATCH v3 4/6] staging: wilc1000: removed enum typedef CHIP_PS_STATE_T

2018-01-11 Thread Ajay Singh
This patch removes enum typedef CHIP_PS_STATE_T and introduce
enum chip_ps_states to use instead of typedef.

checkpatch.pl not to add new typedef warning is fixed with this patch.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wlan.c| 2 +-
 drivers/staging/wilc1000/wilc_wlan_if.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index f49dfa8..3a58a62 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -4,7 +4,7 @@
 #include "wilc_wfi_netdevice.h"
 #include "wilc_wlan_cfg.h"
 
-static CHIP_PS_STATE_T chip_ps_state = CHIP_WAKEDUP;
+static enum chip_ps_states chip_ps_state = CHIP_WAKEDUP;
 
 static inline void acquire_bus(struct wilc *wilc, BUS_ACQUIRE_T acquire)
 {
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index db2dab4..ab12090 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -137,11 +137,11 @@ typedef enum {
MAX_PSPOLL_PS   = 4
 } USER_PS_MODE_T;
 
-typedef enum {
+enum chip_ps_states {
CHIP_WAKEDUP= 0,
CHIP_SLEEPING_AUTO  = 1,
CHIP_SLEEPING_MANUAL= 2
-} CHIP_PS_STATE_T;
+};
 
 typedef enum {
ACQUIRE_ONLY= 0,
-- 
2.7.4


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


[PATCH v3 3/6] staging: wilc1000: removed enums typedef for BEACON_IE & TX_RATE_T

2018-01-11 Thread Ajay Singh
This patch removed the unnecessary enum typedef for BEACON_IE &
TX_RATE_T
It fix "WARNING: do not add new typedefs" reported by checkpatch.pl

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wlan_if.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index 222bde2..db2dab4 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -75,7 +75,7 @@ typedef void (*wilc_tx_complete_func_t)(void *, int);
 #define MAX_SSID_LEN33
 #define MAX_RATES_SUPPORTED 12
 
-typedef enum {
+enum {
SUPP_RATES_IE   = 1,
EXT_SUPP_RATES_IE   = 50,
HT_CAPABILITY_IE= 45,
@@ -83,7 +83,7 @@ typedef enum {
WPA_IE  = 221,
WMM_IE  = 221,
P2P_IE  = 221,
-} BEACON_IE;
+};
 
 enum bss_types {
INFRASTRUCTURE  = 0,
@@ -91,7 +91,7 @@ enum bss_types {
AP,
 };
 
-typedef enum {
+enum {
RATE_AUTO   = 0,
RATE_1MB= 1,
RATE_2MB= 2,
@@ -105,7 +105,7 @@ typedef enum {
RATE_26MB   = 36,
RATE_48MB   = 48,
RATE_54MB   = 54
-} TX_RATE_T;
+};
 
 enum {
B_ONLY_MODE = 0,/* 1, 2 M, otherwise 5, 11 M */
-- 
2.7.4


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


[PATCH v3 2/6] staging: wilc1000: remove unnecessary typedef enum G_OPERATING_MODE_T

2018-01-11 Thread Ajay Singh
This patch has removed G_OPERATING_MODE_T typedef enum.
Now, its used as anonymous-enums for constants.
checkpatch.pl warning to avoid new typedef is fixes with this patch.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wlan_if.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index 2baf6c4..222bde2 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -107,12 +107,12 @@ typedef enum {
RATE_54MB   = 54
 } TX_RATE_T;
 
-typedef enum {
+enum {
B_ONLY_MODE = 0,/* 1, 2 M, otherwise 5, 11 M */
G_ONLY_MODE,/* 6,12,24 otherwise 9,18,36,48,54 */
G_MIXED_11B_1_MODE, /* 1,2,5.5,11 otherwise all on */
G_MIXED_11B_2_MODE, /* 1,2,5,11,6,12,24 otherwise all on */
-} G_OPERATING_MODE_T;
+};
 
 typedef enum {
G_SHORT_PREAMBLE= 0,/* Short Preamble */
-- 
2.7.4


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


[PATCH v3 0/6] fixes to remove enum typedefs

2018-01-11 Thread Ajay Singh
Changes since v2: Removed v2 patch number 3,4,5 , where were handling
different changes under same subject line.
As those changes were independent, will work on those items and
send as separate patch later.


Ajay Singh (6):
  staging: wilc1000: removed typedef from enum BSSTYPE_T
  staging: wilc1000: remove unnecessary typedef enum G_OPERATING_MODE_T
  staging: wilc1000: removed enums typedef for BEACON_IE & TX_RATE_T
  staging: wilc1000: removed enum typedef CHIP_PS_STATE_T
  staging: wilc1000: removed enum typedef BUS_ACQUIRE_T
  staging: wilc1000: removed enum typedef BUS_RELEASE_T

 drivers/staging/wilc1000/host_interface.c |  2 +-
 drivers/staging/wilc1000/wilc_wlan.c  |  6 +++---
 drivers/staging/wilc1000/wilc_wlan_if.h   | 28 ++--
 3 files changed, 18 insertions(+), 18 deletions(-)

-- 
2.7.4


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


[PATCH -next] staging: ccree: remove redundant dev_err call in init_cc_resources()

2018-01-11 Thread Wei Yongjun
There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.

Signed-off-by: Wei Yongjun 
---
 drivers/staging/ccree/cc_driver.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/ccree/cc_driver.c 
b/drivers/staging/ccree/cc_driver.c
index 6682d9d..c27d5a8 100644
--- a/drivers/staging/ccree/cc_driver.c
+++ b/drivers/staging/ccree/cc_driver.c
@@ -174,10 +174,8 @@ static int init_cc_resources(struct platform_device 
*plat_dev)
req_mem_cc_regs = platform_get_resource(plat_dev, IORESOURCE_MEM, 0);
/* Map registers space */
new_drvdata->cc_base = devm_ioremap_resource(dev, req_mem_cc_regs);
-   if (IS_ERR(new_drvdata->cc_base)) {
-   dev_err(dev, "Failed to ioremap registers");
+   if (IS_ERR(new_drvdata->cc_base))
return PTR_ERR(new_drvdata->cc_base);
-   }
 
dev_dbg(dev, "Got MEM resource (%s): %pR\n", req_mem_cc_regs->name,
req_mem_cc_regs);

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


Re: [PATCH v2 0/2] staging: rtl8723bs: Fix multiple trailing semicolons

2018-01-11 Thread Luis de Bethencourt
On 01/11/2018 01:19 AM, Joe Perches wrote:
> On Wed, 2018-01-10 at 17:01 +, Luis de Bethencourt wrote:
>> On 01/10/2018 04:51 PM, Luis de Bethencourt wrote:
>>> Hi,
>>>
>>> Removing the last patch from the original series after Dan's comment.
>>>
>>> Tomorrow, I will send a new patch that removes the commented out code. This 
>>> will
>>> replace that last patch.
>>>
>>> Thanks for the review,
>>> Luis
>>>
>>>
>>> Luis de Bethencourt (2):
>>>   staging: rtl8723bs: Fix trailing semicolon
>>>   staging: rtl8723bs: Fix trailing semicolon
>>>
>>>  drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c  | 2 +-
>>>  drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c | 2 +-
>>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>
>> A little bit too late but I just realized that instead of LKML (which is 
>> down),
>> I can link to the archives of the driverdev mailing list instead. 
>>
>> Here is Dan's email which I reference above:
>> http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2018-January/115392.html
>>
>> Thanks,
>> Luis 
> 
> If you really want to remove these, perhaps do it treewide.
> 
> $ git grep -P -n ";\s*;\s*$" -- "*.[ch]"|grep -vw for|grep -vP ":\s+;\s*;\s*$"
> arch/arc/kernel/setup.c:376:  char *opt_nm = NULL;;
> arch/arc/kernel/unwind.c:369: panic("Attention !!! Dwarf FDE parsing 
> errors\n");;
> arch/arm/include/asm/kvm_emulate.h:134:   return cpsr_mode > USR_MODE;;
> arch/arm/kernel/time.c:86:static clock_access_fn __read_boot_clock = 
> dummy_clock_access;;
> arch/arm64/kernel/ptrace.c:1422:  int err, idx = 
> compat_ptrace_hbp_num_to_idx(num);;
> arch/mips/include/asm/checksum.h:113: u32 sum = (__force u32)csum;;
> arch/powerpc/kvm/book3s_xive.c:160:   return -ENOMEM;;
> arch/powerpc/platforms/powernv/pci-ioda.c:1843:   return -ENODEV;;
> arch/x86/boot/compressed/eboot.c:442: u32 *handles = (u32 *)uga_handle;;
> arch/x86/boot/compressed/eboot.c:487: u64 *handles = (u64 *)uga_handle;;
> block/sed-opal.c:493: return -EOPNOTSUPP;;
> drivers/clocksource/mips-gic-timer.c:208: return -EINVAL;;
> drivers/clocksource/mips-gic-timer.c:213: return -EINVAL;;
> drivers/clocksource/timer-sun5i.c:337:return 
> PTR_ERR(timer_base);;
> drivers/dax/device.c:136: return NULL;;
> drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c:721: union lane_status 
> dpcd_lane_status[LANE_COUNT_DP_MAX] = {{{0}}};;
> drivers/gpu/drm/amd/powerplay/amd_powerplay.c:165:return 
> -EINVAL;;
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c:683:  aspace = NULL;;
> drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:645:block = 
> (size >> page[i].shift) << page[i].shift;;
> drivers/gpu/drm/scheduler/gpu_scheduler.c:464:int i;;
> drivers/hwmon/lm75.c:103: break;;
> drivers/iommu/intel-svm.c:196:unsigned long mask = 
> __rounddown_pow_of_two(address ^ last);;
> drivers/md/dm-thin.c:1725:struct dm_thin_endio_hook *h = 
> dm_per_bio_data(bio, sizeof(struct dm_thin_endio_hook));;
> drivers/md/raid1.c::  r1_bio->behind_master_bio = behind_bio;;
> drivers/net/can/rx-offload.c:259: return can_rx_offload_init_queue(dev, 
> offload, weight);;
> drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c:488:
> mlx5e_close_channels(>channels);;
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h:1175:
> u8 dummy4_1:1;;
> drivers/pci/pci-driver.c:971: return pm_generic_freeze_late(dev);;
> drivers/powercap/intel_rapl.c:1212:   int nr_pl, ret;;
> drivers/soc/imx/gpc.c:351:return 
> PTR_ERR(domain->supply);;
> drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c:1055:  regEA4 = 
> PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_Before_IQK_A_2, bMaskDWord);;
> drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c:156:  tmplong2 = 
> PHY_QueryBBReg(Adapter, rFPGA0_XA_HSSIParameter2|MaskforPhySet, bMaskDWord);;
> drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:970:   ret = 
> -EINVAL;;
> drivers/target/target_core_user.c:1409:   return ret;;
> include/net/vxlan.h:304:  return features;;
> net/netfilter/nft_dynset.c:167:   err = 
> nft_validate_register_load(priv->sreg_key, set->klen);;
> samples/bpf/xdp_monitor_kern.c:107:   u64 *cnt;;
> scripts/mod/modpost.c:1688:   const char *tosec = sec_name(elf, 
> get_secindex(elf, sym));;
> sound/core/pcm_native.c:3449: struct snd_pcm_runtime *runtime = 
> substream->runtime;;
> sound/soc/codecs/cs42l73.c:1358:  return ret;;
> tools/perf/util/evlist.c:1763:goto state_err;;
> tools/testing/selftests/nsfs/pidns.c:73:  return 
> pr_err("Don't get EPERM");;
> 

Hi Joe,

I was following the good-old premise of reading/fixing the code for hardware
you have.

Since you think there is value on fixing the trailing semicolons treewide. I
will slowly do that over the 

Re: [PATCH 3/7] crypto: ccree: add ablkcipher support

2018-01-11 Thread Stephan Mueller
Am Donnerstag, 11. Januar 2018, 10:17:10 CET schrieb Gilad Ben-Yossef:

Hi Gilad,

> + // verify weak keys
> + if (ctx_p->flow_mode == S_DIN_to_DES) {
> + if (!des_ekey(tmp, key) &&
> + (crypto_tfm_get_flags(tfm) & CRYPTO_TFM_REQ_WEAK_KEY)) {
> + tfm->crt_flags |= CRYPTO_TFM_RES_WEAK_KEY;
> + dev_dbg(dev, "weak DES key");
> + return -EINVAL;
> + }
> + }
> + if (ctx_p->cipher_mode == DRV_CIPHER_XTS &&
> + xts_check_key(tfm, key, keylen)) {
> + dev_dbg(dev, "weak XTS key");
> + return -EINVAL;
> + }
> + if (ctx_p->flow_mode == S_DIN_to_DES &&
> + keylen == DES3_EDE_KEY_SIZE &&
> + cc_verify_3des_keys(key, keylen)) {
> + dev_dbg(dev, "weak 3DES key");
> + return -EINVAL;
> + }

For the DES key, wouldn't it make sense to use __des3_ede_setkey?

Note, I would plan to release a patch for review to change that function to 
disallow key1 == key2 or key1 == key3 or key2 == key3 in FIPS mode.

Ciao
Stephan


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


[PATCH 09/24] staging: speakup: add SPDX identifier.

2018-01-11 Thread Greg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the remaining staging speakup files to have a proper SPDX
identifier, based on the license text in the file itself.  The SPDX
identifier is a legally binding shorthand, which can be used instead of
the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner 
Cc: Kate Stewart 
Cc: Philippe Ombredanne 
Cc: William Hubbs 
Cc: Chris Brannon 
Cc: Kirk Reiser 
Cc: Samuel Thibault 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/speakup/buffers.c  | 1 +
 drivers/staging/speakup/fakekey.c  | 1 +
 drivers/staging/speakup/keyhelp.c  | 1 +
 drivers/staging/speakup/kobjects.c | 1 +
 drivers/staging/speakup/main.c | 1 +
 drivers/staging/speakup/serialio.c | 1 +
 drivers/staging/speakup/speakup_acntpc.c   | 1 +
 drivers/staging/speakup/speakup_acntsa.c   | 1 +
 drivers/staging/speakup/speakup_apollo.c   | 1 +
 drivers/staging/speakup/speakup_audptr.c   | 1 +
 drivers/staging/speakup/speakup_bns.c  | 1 +
 drivers/staging/speakup/speakup_decext.c   | 1 +
 drivers/staging/speakup/speakup_decpc.c| 1 +
 drivers/staging/speakup/speakup_dectlk.c   | 1 +
 drivers/staging/speakup/speakup_dtlk.c | 1 +
 drivers/staging/speakup/speakup_dummy.c| 1 +
 drivers/staging/speakup/speakup_keypc.c| 1 +
 drivers/staging/speakup/speakup_ltlk.c | 1 +
 drivers/staging/speakup/speakup_soft.c | 1 +
 drivers/staging/speakup/speakup_spkout.c   | 1 +
 drivers/staging/speakup/speakup_txprt.c| 1 +
 drivers/staging/speakup/spk_priv.h | 1 +
 drivers/staging/speakup/spk_priv_keyinfo.h | 1 +
 drivers/staging/speakup/spk_ttyio.c| 1 +
 drivers/staging/speakup/synth.c| 1 +
 drivers/staging/speakup/thread.c   | 1 +
 drivers/staging/speakup/varhandlers.c  | 1 +
 27 files changed, 27 insertions(+)

diff --git a/drivers/staging/speakup/buffers.c 
b/drivers/staging/speakup/buffers.c
index 6137fa83c609..461f131644a2 100644
--- a/drivers/staging/speakup/buffers.c
+++ b/drivers/staging/speakup/buffers.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include 
 #include 
 #include 
diff --git a/drivers/staging/speakup/fakekey.c 
b/drivers/staging/speakup/fakekey.c
index 294c74b47224..6a6ff3512943 100644
--- a/drivers/staging/speakup/fakekey.c
+++ b/drivers/staging/speakup/fakekey.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /* fakekey.c
  * Functions for simulating keypresses.
  *
diff --git a/drivers/staging/speakup/keyhelp.c 
b/drivers/staging/speakup/keyhelp.c
index 4e6e5daba50c..a1f650543056 100644
--- a/drivers/staging/speakup/keyhelp.c
+++ b/drivers/staging/speakup/keyhelp.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /* speakup_keyhelp.c
  * help module for speakup
  *
diff --git a/drivers/staging/speakup/kobjects.c 
b/drivers/staging/speakup/kobjects.c
index ca85476e3ff7..f1f90222186b 100644
--- a/drivers/staging/speakup/kobjects.c
+++ b/drivers/staging/speakup/kobjects.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Speakup kobject implementation
  *
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index aae868509e13..600221aac324 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /* speakup.c
  * review functions for the speakup screen review package.
  * originally written by: Kirk Reiser and Andy Berdan.
diff --git a/drivers/staging/speakup/serialio.c 
b/drivers/staging/speakup/serialio.c
index 9cfc8142a318..177a2988641c 100644
--- a/drivers/staging/speakup/serialio.c
+++ b/drivers/staging/speakup/serialio.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include 
 #include 
 
diff --git a/drivers/staging/speakup/speakup_acntpc.c 
b/drivers/staging/speakup/speakup_acntpc.c
index a041441766aa..442ae84e3128 100644
--- a/drivers/staging/speakup/speakup_acntpc.c
+++ b/drivers/staging/speakup/speakup_acntpc.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * written by: Kirk Reiser 
  * this version considerably modified by David Borowski, david...@rogers.com
diff --git a/drivers/staging/speakup/speakup_acntsa.c 
b/drivers/staging/speakup/speakup_acntsa.c
index 43315849b7b6..c7cb944e4171 100644
--- a/drivers/staging/speakup/speakup_acntsa.c
+++ b/drivers/staging/speakup/speakup_acntsa.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * originally written by: Kirk Reiser 
  * this version considerably modified by David Borowski, david...@rogers.com
diff --git a/drivers/staging/speakup/speakup_apollo.c 

[PATCH 04/24] staging: typec: remove redundant license text

2018-01-11 Thread Greg Kroah-Hartman
Now that the SPDX tag is in all drivers/staging/typec/ files, that
identifies the license in a specific and legally-defined manner.  So the
extra GPL text wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/typec/tcpci.c | 10 --
 drivers/staging/typec/tcpci.h | 10 --
 2 files changed, 20 deletions(-)

diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c
index 8722dc1444f8..9bd4412356c9 100644
--- a/drivers/staging/typec/tcpci.c
+++ b/drivers/staging/typec/tcpci.c
@@ -2,16 +2,6 @@
 /*
  * Copyright 2015-2017 Google, Inc
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
  * USB Type-C Port Controller Interface.
  */
 
diff --git a/drivers/staging/typec/tcpci.h b/drivers/staging/typec/tcpci.h
index 2a16dbf852a5..fdfb06cc3b86 100644
--- a/drivers/staging/typec/tcpci.h
+++ b/drivers/staging/typec/tcpci.h
@@ -2,16 +2,6 @@
 /*
  * Copyright 2015-2017 Google, Inc
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
  * USB Type-C Port Controller Interface.
  */
 
-- 
2.15.1

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


[PATCH 07/24] staging: vc04_services: bcm2835-camera: add SPDX identifiers

2018-01-11 Thread Greg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the bcm2835-camera driver to have a proper SPDX identifier, based
on the license text in the file itself.  The SPDX identifier is a
legally binding shorthand, which can be used instead of the full boiler
plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner 
Cc: Kate Stewart 
Cc: Philippe Ombredanne 
Cc: Eric Anholt 
Cc: Stefan Wahren 
Cc: Florian Fainelli 
Cc: Ray Jui 
Cc: Scott Branden 
Cc: 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c  | 1 +
 drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h  | 1 +
 drivers/staging/vc04_services/bcm2835-camera/controls.c| 1 +
 drivers/staging/vc04_services/bcm2835-camera/mmal-common.h | 1 +
 drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h  | 1 +
 drivers/staging/vc04_services/bcm2835-camera/mmal-msg-common.h | 1 +
 drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h | 1 +
 drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h   | 1 +
 drivers/staging/vc04_services/bcm2835-camera/mmal-msg.h| 1 +
 drivers/staging/vc04_services/bcm2835-camera/mmal-parameters.h | 1 +
 drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c  | 1 +
 drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h  | 1 +
 12 files changed, 12 insertions(+)

diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c 
b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
index e26895dc052e..36b9a3188900 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Broadcom BM2835 V4L2 driver
  *
diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h 
b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h
index 83920683a448..ce7dcab7dfd9 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Broadcom BM2835 V4L2 driver
  *
diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c 
b/drivers/staging/vc04_services/bcm2835-camera/controls.c
index 77a5d6f4e1eb..d0e8ff8a655a 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/controls.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Broadcom BM2835 V4L2 driver
  *
diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-common.h 
b/drivers/staging/vc04_services/bcm2835-camera/mmal-common.h
index 840fd139e033..c42dca74a5af 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-common.h
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-common.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Broadcom BM2835 V4L2 driver
  *
diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h 
b/drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h
index e71d9600b278..832507f5cb50 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Broadcom BM2835 V4L2 driver
  *
diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-common.h 
b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-common.h
index 66e8a6edf628..ece222c3febd 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-common.h
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-common.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Broadcom BM2835 V4L2 driver
  *
diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h 
b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h
index 24b002e8df0c..110a4e01c5e5 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Broadcom BM2835 V4L2 driver
  *
diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h 
b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h
index 84a0f4b717ef..ccbd32d134a6 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Broadcom 

[PATCH] staging: ccree: don't break lines unnecessarily

2018-01-11 Thread Dan Carpenter
These lines are less than 80 characters so we don't need to break them
up into chunks.

Signed-off-by: Dan Carpenter 

diff --git a/drivers/staging/ccree/cc_aead.c b/drivers/staging/ccree/cc_aead.c
index 265adffdab41..b58413172231 100644
--- a/drivers/staging/ccree/cc_aead.c
+++ b/drivers/staging/ccree/cc_aead.c
@@ -2600,8 +2600,7 @@ static struct cc_crypto_alg *cc_create_aead_alg(struct 
cc_alg_template *tmpl,
 
alg = >template_aead;
 
-   snprintf(alg->base.cra_name, CRYPTO_MAX_ALG_NAME, "%s",
-tmpl->name);
+   snprintf(alg->base.cra_name, CRYPTO_MAX_ALG_NAME, "%s", tmpl->name);
snprintf(alg->base.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s",
 tmpl->driver_name);
alg->base.cra_module = THIS_MODULE;
diff --git a/drivers/staging/ccree/cc_cipher.c 
b/drivers/staging/ccree/cc_cipher.c
index 8afdbc120b13..5c7e91f1cde7 100644
--- a/drivers/staging/ccree/cc_cipher.c
+++ b/drivers/staging/ccree/cc_cipher.c
@@ -127,8 +127,7 @@ static int validate_data_size(struct cc_cipher_ctx *ctx_p,
 static unsigned int get_max_keysize(struct crypto_tfm *tfm)
 {
struct cc_crypto_alg *cc_alg =
-   container_of(tfm->__crt_alg, struct cc_crypto_alg,
-crypto_alg);
+   container_of(tfm->__crt_alg, struct cc_crypto_alg, crypto_alg);
 
if ((cc_alg->crypto_alg.cra_flags & CRYPTO_ALG_TYPE_MASK) ==
CRYPTO_ALG_TYPE_ABLKCIPHER)
@@ -391,8 +390,7 @@ static void cc_setup_cipher_desc(struct crypto_tfm *tfm,
unsigned int du_size = nbytes;
 
struct cc_crypto_alg *cc_alg =
-   container_of(tfm->__crt_alg, struct cc_crypto_alg,
-crypto_alg);
+   container_of(tfm->__crt_alg, struct cc_crypto_alg, crypto_alg);
 
if ((cc_alg->crypto_alg.cra_flags & CRYPTO_ALG_BULK_MASK) ==
CRYPTO_ALG_BULK_DU_512)
@@ -611,8 +609,7 @@ static void cc_cipher_complete(struct device *dev, void 
*cc_req, int err)
kfree(req_ctx->backup_info);
} else if (!err) {
scatterwalk_map_and_copy(req->info, req->dst,
-(req->nbytes - ivsize),
-ivsize, 0);
+(req->nbytes - ivsize), ivsize, 0);
}
 
ablkcipher_request_complete(areq, err);
@@ -1096,8 +1093,7 @@ struct cc_crypto_alg *cc_cipher_create_alg(struct 
cc_alg_template *template,
 int cc_cipher_free(struct cc_drvdata *drvdata)
 {
struct cc_crypto_alg *t_alg, *n;
-   struct cc_cipher_handle *blkcipher_handle =
-   drvdata->blkcipher_handle;
+   struct cc_cipher_handle *blkcipher_handle = drvdata->blkcipher_handle;
if (blkcipher_handle) {
/* Remove registered algs */
list_for_each_entry_safe(t_alg, n,
diff --git a/drivers/staging/ccree/cc_driver.c 
b/drivers/staging/ccree/cc_driver.c
index 6682d9d93931..192b1759de45 100644
--- a/drivers/staging/ccree/cc_driver.c
+++ b/drivers/staging/ccree/cc_driver.c
@@ -216,8 +216,7 @@ static int init_cc_resources(struct platform_device 
*plat_dev)
}
 
if (rc) {
-   dev_err(dev, "Failed in dma_set_mask, mask=%par\n",
-   _mask);
+   dev_err(dev, "Failed in dma_set_mask, mask=%par\n", _mask);
return rc;
}
 
diff --git a/drivers/staging/ccree/cc_fips.c b/drivers/staging/ccree/cc_fips.c
index b25c34e08717..de08af976b7f 100644
--- a/drivers/staging/ccree/cc_fips.c
+++ b/drivers/staging/ccree/cc_fips.c
@@ -53,8 +53,7 @@ void cc_fips_fini(struct cc_drvdata *drvdata)
 
 void fips_handler(struct cc_drvdata *drvdata)
 {
-   struct cc_fips_handle *fips_handle_ptr =
-   drvdata->fips_handle;
+   struct cc_fips_handle *fips_handle_ptr = drvdata->fips_handle;
 
tasklet_schedule(_handle_ptr->tasklet);
 }
diff --git a/drivers/staging/ccree/cc_hash.c b/drivers/staging/ccree/cc_hash.c
index 86f9ec711edc..8afc39f10bb3 100644
--- a/drivers/staging/ccree/cc_hash.c
+++ b/drivers/staging/ccree/cc_hash.c
@@ -1858,9 +1858,8 @@ int cc_init_hash_sram(struct cc_drvdata *drvdata)
hash_handle->larval_digest_sram_addr = sram_buff_ofs;
 
/* Copy-to-sram initial SHA* digests */
-   cc_set_sram_desc(md5_init, sram_buff_ofs,
-ARRAY_SIZE(md5_init), larval_seq,
-_seq_len);
+   cc_set_sram_desc(md5_init, sram_buff_ofs, ARRAY_SIZE(md5_init),
+larval_seq, _seq_len);
rc = send_request_init(drvdata, larval_seq, larval_seq_len);
if (rc)
goto init_digest_const_err;
@@ -2004,8 +2003,7 @@ int cc_hash_alloc(struct cc_drvdata *drvdata)
kfree(t_alg);
goto fail;
} else {
-   list_add_tail(_alg->entry,
-  

[PATCH 24/24] staging: fbtft: remove redundant license text

2018-01-11 Thread Greg Kroah-Hartman
Now that the SPDX tag is in all fbtft files, that identifies the license
in a specific and legally-defined manner.  So the extra GPL text wording
can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Thomas Petazzoni 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/fbtft/fb_agm1264k-fl.c | 10 --
 drivers/staging/fbtft/fb_bd663474.c| 10 --
 drivers/staging/fbtft/fb_hx8340bn.c| 10 --
 drivers/staging/fbtft/fb_hx8347d.c | 10 --
 drivers/staging/fbtft/fb_hx8353d.c | 10 --
 drivers/staging/fbtft/fb_hx8357d.c | 10 --
 drivers/staging/fbtft/fb_ili9163.c | 10 --
 drivers/staging/fbtft/fb_ili9320.c | 10 --
 drivers/staging/fbtft/fb_ili9325.c | 10 --
 drivers/staging/fbtft/fb_ili9340.c | 10 --
 drivers/staging/fbtft/fb_ili9341.c | 10 --
 drivers/staging/fbtft/fb_ili9481.c | 10 --
 drivers/staging/fbtft/fb_ili9486.c | 10 --
 drivers/staging/fbtft/fb_pcd8544.c | 10 --
 drivers/staging/fbtft/fb_ra8875.c  | 10 --
 drivers/staging/fbtft/fb_s6d02a1.c | 10 --
 drivers/staging/fbtft/fb_s6d1121.c | 10 --
 drivers/staging/fbtft/fb_sh1106.c  | 10 --
 drivers/staging/fbtft/fb_ssd1289.c | 10 --
 drivers/staging/fbtft/fb_ssd1305.c | 10 --
 drivers/staging/fbtft/fb_ssd1306.c | 10 --
 drivers/staging/fbtft/fb_ssd1325.c | 10 --
 drivers/staging/fbtft/fb_st7735r.c | 10 --
 drivers/staging/fbtft/fb_st7789v.c | 10 --
 drivers/staging/fbtft/fb_tinylcd.c | 10 --
 drivers/staging/fbtft/fb_tls8204.c | 10 --
 drivers/staging/fbtft/fb_uc1611.c  | 10 --
 drivers/staging/fbtft/fb_uc1701.c  | 10 --
 drivers/staging/fbtft/fb_upd161704.c   | 10 --
 drivers/staging/fbtft/fb_watterott.c   | 10 --
 drivers/staging/fbtft/fbtft-core.c | 10 --
 drivers/staging/fbtft/fbtft.h  | 14 +-
 drivers/staging/fbtft/fbtft_device.c   | 10 --
 drivers/staging/fbtft/flexfb.c | 10 --
 drivers/staging/fbtft/internal.h   | 15 +--
 35 files changed, 2 insertions(+), 357 deletions(-)

diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c 
b/drivers/staging/fbtft/fb_agm1264k-fl.c
index 5f2136136202..f6f30f5bf15a 100644
--- a/drivers/staging/fbtft/fb_agm1264k-fl.c
+++ b/drivers/staging/fbtft/fb_agm1264k-fl.c
@@ -3,16 +3,6 @@
  * FB driver for Two KS0108 LCD controllers in AGM1264K-FL display
  *
  * Copyright (C) 2014 ololoshka2871
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 
 #include 
diff --git a/drivers/staging/fbtft/fb_bd663474.c 
b/drivers/staging/fbtft/fb_bd663474.c
index 7319b7fb36aa..a58c514f4721 100644
--- a/drivers/staging/fbtft/fb_bd663474.c
+++ b/drivers/staging/fbtft/fb_bd663474.c
@@ -7,16 +7,6 @@
  * Based on fb_ili9325.c by Noralf Tronnes
  * Based on ili9325.c by Jeroen Domburg
  * Init code from UTFT library by Henning Karlsen
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 
 #include 
diff --git a/drivers/staging/fbtft/fb_hx8340bn.c 
b/drivers/staging/fbtft/fb_hx8340bn.c
index 161acbbb7ac9..d47dcf31fffb 100644
--- a/drivers/staging/fbtft/fb_hx8340bn.c
+++ b/drivers/staging/fbtft/fb_hx8340bn.c
@@ -8,16 +8,6 @@
  * This is done by transferring eight 9-bit words in 9 bytes.
  *
  * Copyright (C) 2013 Noralf Tronnes
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later 

[PATCH 02/24] staging: vme: vme_user.c: remove redundant license text

2018-01-11 Thread Greg Kroah-Hartman
Now that the SPDX tag is in all drivers/staging/vme/ files, that
identifies the license in a specific and legally-defined manner.  So the
extra GPL text wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Martyn Welch 
Cc: Manohar Vanga 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/vme/devices/vme_user.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c 
b/drivers/staging/vme/devices/vme_user.c
index e4be16c5f726..954bd435f679 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -8,12 +8,6 @@
  * Based on work by:
  *   Tom Armistead and Ajit Prem
  * Copyright 2004 Motorola Inc.
- *
- *
- * This program is free software; you can redistribute  it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-- 
2.15.1

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


[PATCH 10/24] staging: speakup: remove redundant license text

2018-01-11 Thread Greg Kroah-Hartman
Now that the SPDX tag is in all drivers/staging/speakup/ files, that
identifies the license in a specific and legally-defined manner.  So the
extra GPL text wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: William Hubbs 
Cc: Chris Brannon 
Cc: Kirk Reiser 
Cc: Samuel Thibault 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/speakup/fakekey.c  | 10 --
 drivers/staging/speakup/keyhelp.c  | 10 --
 drivers/staging/speakup/main.c | 10 --
 drivers/staging/speakup/speakup_acntpc.c   |  9 -
 drivers/staging/speakup/speakup_acntsa.c   | 10 --
 drivers/staging/speakup/speakup_apollo.c   | 10 --
 drivers/staging/speakup/speakup_audptr.c   | 10 --
 drivers/staging/speakup/speakup_bns.c  | 10 --
 drivers/staging/speakup/speakup_decext.c   | 10 --
 drivers/staging/speakup/speakup_decpc.c| 10 --
 drivers/staging/speakup/speakup_dectlk.c   | 10 --
 drivers/staging/speakup/speakup_dtlk.c | 10 --
 drivers/staging/speakup/speakup_dummy.c| 10 --
 drivers/staging/speakup/speakup_keypc.c| 10 --
 drivers/staging/speakup/speakup_ltlk.c | 10 --
 drivers/staging/speakup/speakup_soft.c | 11 ---
 drivers/staging/speakup/speakup_spkout.c   | 10 --
 drivers/staging/speakup/speakup_txprt.c| 10 --
 drivers/staging/speakup/spk_priv.h | 10 --
 drivers/staging/speakup/spk_priv_keyinfo.h | 10 --
 20 files changed, 200 deletions(-)

diff --git a/drivers/staging/speakup/fakekey.c 
b/drivers/staging/speakup/fakekey.c
index 6a6ff3512943..cd029968462f 100644
--- a/drivers/staging/speakup/fakekey.c
+++ b/drivers/staging/speakup/fakekey.c
@@ -3,16 +3,6 @@
  * Functions for simulating keypresses.
  *
  * Copyright (C) 2010 the Speakup Team
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 #include 
 #include 
diff --git a/drivers/staging/speakup/keyhelp.c 
b/drivers/staging/speakup/keyhelp.c
index a1f650543056..5f1bda37f86d 100644
--- a/drivers/staging/speakup/keyhelp.c
+++ b/drivers/staging/speakup/keyhelp.c
@@ -5,16 +5,6 @@
  *written by David Borowski.
  *
  *  Copyright (C) 2003  David Borowski.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
  */
 
 #include 
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index 600221aac324..cf1259059776 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -7,16 +7,6 @@
  *
  ** Copyright (C) 1998  Kirk Reiser.
  *  Copyright (C) 2003  David Borowski.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
  */
 
 #include 
diff --git a/drivers/staging/speakup/speakup_acntpc.c 
b/drivers/staging/speakup/speakup_acntpc.c
index 442ae84e3128..28519754b2f0 100644
--- a/drivers/staging/speakup/speakup_acntpc.c
+++ b/drivers/staging/speakup/speakup_acntpc.c
@@ -6,15 +6,6 @@
  * Copyright (C) 1998-99  Kirk Reiser.
  * Copyright (C) 2003 David Borowski.
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software 

[PATCH 20/24] staging: clocking-wizard: remove redundant license text

2018-01-11 Thread Greg Kroah-Hartman
Now that the SPDX tag is in the clocking-wizard driver files, that
identifies the license in a specific and legally-defined manner.  So the
extra GPL text wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c | 12 
 1 file changed, 12 deletions(-)

diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c 
b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
index d8f536057750..cae7e6e695b0 100644
--- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
+++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
@@ -5,18 +5,6 @@
  *  Copyright (C) 2013 - 2014 Xilinx
  *
  *  Sören Brinkmann 
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License v2 as published by
- * the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see .
  */
 
 #include 
-- 
2.15.1

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


[PATCH 19/24] staging: clocking-wizard: add SPDX identifier.

2018-01-11 Thread Greg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the staging clocking-wizard driver to have a proper SPDX
identifier, based on the license text in the file itself.  The SPDX
identifier is a legally binding shorthand, which can be used instead of
the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner 
Cc: Kate Stewart 
Cc: Philippe Ombredanne 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c 
b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
index bf3fe7c61be5..d8f536057750 100644
--- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
+++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Xilinx 'Clocking Wizard' driver
  *
-- 
2.15.1

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


[PATCH 08/24] staging: vc04_services: bcm2835-camera: remove redundant license text

2018-01-11 Thread Greg Kroah-Hartman
Now that the SPDX tag is in all
drivers/staging/vc04_services/bcm2835-camera/ files, that identifies the
license in a specific and legally-defined manner.  So the extra GPL text
wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Eric Anholt 
Cc: Stefan Wahren 
Cc: Florian Fainelli 
Cc: Ray Jui 
Cc: Scott Branden 
Cc: 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c  | 4 
 drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h  | 4 
 drivers/staging/vc04_services/bcm2835-camera/controls.c| 4 
 drivers/staging/vc04_services/bcm2835-camera/mmal-common.h | 4 
 drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h  | 4 
 drivers/staging/vc04_services/bcm2835-camera/mmal-msg-common.h | 4 
 drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h | 4 
 drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h   | 4 
 drivers/staging/vc04_services/bcm2835-camera/mmal-msg.h| 4 
 drivers/staging/vc04_services/bcm2835-camera/mmal-parameters.h | 4 
 drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c  | 4 
 drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h  | 4 
 12 files changed, 48 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c 
b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
index 36b9a3188900..d2262275a870 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -4,10 +4,6 @@
  *
  * Copyright © 2013 Raspberry Pi (Trading) Ltd.
  *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file COPYING in the main directory of this archive
- * for more details.
- *
  * Authors: Vincent Sanders 
  *  Dave Stevenson 
  *  Simon Mellor 
diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h 
b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h
index ce7dcab7dfd9..2b5679eb5b4a 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h
@@ -4,10 +4,6 @@
  *
  * Copyright © 2013 Raspberry Pi (Trading) Ltd.
  *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file COPYING in the main directory of this archive
- * for more details.
- *
  * Authors: Vincent Sanders 
  *  Dave Stevenson 
  *  Simon Mellor 
diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c 
b/drivers/staging/vc04_services/bcm2835-camera/controls.c
index d0e8ff8a655a..0736214e1422 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/controls.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c
@@ -4,10 +4,6 @@
  *
  * Copyright © 2013 Raspberry Pi (Trading) Ltd.
  *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file COPYING in the main directory of this archive
- * for more details.
- *
  * Authors: Vincent Sanders 
  *  Dave Stevenson 
  *  Simon Mellor 
diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-common.h 
b/drivers/staging/vc04_services/bcm2835-camera/mmal-common.h
index c42dca74a5af..800e4e7e5f96 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-common.h
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-common.h
@@ -4,10 +4,6 @@
  *
  * Copyright © 2013 Raspberry Pi (Trading) Ltd.
  *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file COPYING in the main directory of this archive
- * for more details.
- *
  * Authors: Vincent Sanders 
  *  Dave Stevenson 
  *  Simon Mellor 
diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h 
b/drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h
index 832507f5cb50..129203597f91 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h
@@ -4,10 +4,6 @@
  *
  * Copyright © 2013 

[PATCH 15/24] staging: fwserial: add SPDX identifier.

2018-01-11 Thread Greg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the staging fwserial driver to have a proper SPDX identifier,
based on the license text in the file itself.  The SPDX identifier is a
legally binding shorthand, which can be used instead of the full boiler
plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner 
Cc: Kate Stewart 
Cc: Philippe Ombredanne 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/fwserial/dma_fifo.c | 1 +
 drivers/staging/fwserial/dma_fifo.h | 1 +
 drivers/staging/fwserial/fwserial.c | 1 +
 3 files changed, 3 insertions(+)

diff --git a/drivers/staging/fwserial/dma_fifo.c 
b/drivers/staging/fwserial/dma_fifo.c
index 8b23a553fd4a..45b947afcf9f 100644
--- a/drivers/staging/fwserial/dma_fifo.c
+++ b/drivers/staging/fwserial/dma_fifo.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * DMA-able FIFO implementation
  *
diff --git a/drivers/staging/fwserial/dma_fifo.h 
b/drivers/staging/fwserial/dma_fifo.h
index 37a91c6a1709..826c82f7f42c 100644
--- a/drivers/staging/fwserial/dma_fifo.h
+++ b/drivers/staging/fwserial/dma_fifo.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * DMA-able FIFO interface
  *
diff --git a/drivers/staging/fwserial/fwserial.c 
b/drivers/staging/fwserial/fwserial.c
index bba7e9c888b3..57f0bc11099a 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * FireWire Serial driver
  *
-- 
2.15.1

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


[PATCH 16/24] staging: fwserial: remove redundant license text

2018-01-11 Thread Greg Kroah-Hartman
Now that the SPDX tag is in all drivers/staging/fwserial/ files, that
identifies the license in a specific and legally-defined manner.  So the
extra GPL text wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/fwserial/dma_fifo.c | 10 --
 drivers/staging/fwserial/dma_fifo.h | 10 --
 drivers/staging/fwserial/fwserial.c | 10 --
 3 files changed, 30 deletions(-)

diff --git a/drivers/staging/fwserial/dma_fifo.c 
b/drivers/staging/fwserial/dma_fifo.c
index 45b947afcf9f..5dcbab6fd622 100644
--- a/drivers/staging/fwserial/dma_fifo.c
+++ b/drivers/staging/fwserial/dma_fifo.c
@@ -3,16 +3,6 @@
  * DMA-able FIFO implementation
  *
  * Copyright (C) 2012 Peter Hurley 
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 
 #include 
diff --git a/drivers/staging/fwserial/dma_fifo.h 
b/drivers/staging/fwserial/dma_fifo.h
index 826c82f7f42c..c46a06336975 100644
--- a/drivers/staging/fwserial/dma_fifo.h
+++ b/drivers/staging/fwserial/dma_fifo.h
@@ -3,16 +3,6 @@
  * DMA-able FIFO interface
  *
  * Copyright (C) 2012 Peter Hurley 
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 
 #ifndef _DMA_FIFO_H_
diff --git a/drivers/staging/fwserial/fwserial.c 
b/drivers/staging/fwserial/fwserial.c
index 57f0bc11099a..1993b03a6f2d 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -3,16 +3,6 @@
  * FireWire Serial driver
  *
  * Copyright (C) 2012 Peter Hurley 
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-- 
2.15.1

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


[PATCH 14/24] staging: octeon: remove redundant license text

2018-01-11 Thread Greg Kroah-Hartman
Now that the SPDX tag is in all drivers/staging/octeon/ files, that
identifies the license in a specific and legally-defined manner.  So the
extra GPL text wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/octeon/Makefile   | 3 ---
 drivers/staging/octeon/ethernet-defines.h | 4 
 drivers/staging/octeon/ethernet-mdio.c| 4 
 drivers/staging/octeon/ethernet-mdio.h| 4 
 drivers/staging/octeon/ethernet-mem.c | 4 
 drivers/staging/octeon/ethernet-mem.h | 4 
 drivers/staging/octeon/ethernet-rgmii.c   | 4 
 drivers/staging/octeon/ethernet-rx.c  | 4 
 drivers/staging/octeon/ethernet-rx.h  | 4 
 drivers/staging/octeon/ethernet-sgmii.c   | 4 
 drivers/staging/octeon/ethernet-spi.c | 4 
 drivers/staging/octeon/ethernet-tx.c  | 4 
 drivers/staging/octeon/ethernet-tx.h  | 4 
 drivers/staging/octeon/ethernet-util.h| 4 
 drivers/staging/octeon/ethernet.c | 4 
 drivers/staging/octeon/octeon-ethernet.h  | 4 
 16 files changed, 63 deletions(-)

diff --git a/drivers/staging/octeon/Makefile b/drivers/staging/octeon/Makefile
index 84de1f9c5598..3887cf5f1e84 100644
--- a/drivers/staging/octeon/Makefile
+++ b/drivers/staging/octeon/Makefile
@@ -1,7 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-# This file is subject to the terms and conditions of the GNU General Public
-# License.  See the file "COPYING" in the main directory of this archive
-# for more details.
 #
 # Copyright (C) 2005-2009 Cavium Networks
 #
diff --git a/drivers/staging/octeon/ethernet-defines.h 
b/drivers/staging/octeon/ethernet-defines.h
index 1a366d71d044..1e114422993a 100644
--- a/drivers/staging/octeon/ethernet-defines.h
+++ b/drivers/staging/octeon/ethernet-defines.h
@@ -3,10 +3,6 @@
  * This file is based on code from OCTEON SDK by Cavium Networks.
  *
  * Copyright (c) 2003-2007 Cavium Networks
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, Version 2, as
- * published by the Free Software Foundation.
  */
 
 /*
diff --git a/drivers/staging/octeon/ethernet-mdio.c 
b/drivers/staging/octeon/ethernet-mdio.c
index c70f17386a24..f67f95043887 100644
--- a/drivers/staging/octeon/ethernet-mdio.c
+++ b/drivers/staging/octeon/ethernet-mdio.c
@@ -3,10 +3,6 @@
  * This file is based on code from OCTEON SDK by Cavium Networks.
  *
  * Copyright (c) 2003-2007 Cavium Networks
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, Version 2, as
- * published by the Free Software Foundation.
  */
 
 #include 
diff --git a/drivers/staging/octeon/ethernet-mdio.h 
b/drivers/staging/octeon/ethernet-mdio.h
index 52cae2d2dacc..e3771d48c49b 100644
--- a/drivers/staging/octeon/ethernet-mdio.h
+++ b/drivers/staging/octeon/ethernet-mdio.h
@@ -3,10 +3,6 @@
  * This file is based on code from OCTEON SDK by Cavium Networks.
  *
  * Copyright (c) 2003-2007 Cavium Networks
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, Version 2, as
- * published by the Free Software Foundation.
  */
 
 #include 
diff --git a/drivers/staging/octeon/ethernet-mem.c 
b/drivers/staging/octeon/ethernet-mem.c
index 5f2077c4b86e..0d26c4a93ec1 100644
--- a/drivers/staging/octeon/ethernet-mem.c
+++ b/drivers/staging/octeon/ethernet-mem.c
@@ -3,10 +3,6 @@
  * This file is based on code from OCTEON SDK by Cavium Networks.
  *
  * Copyright (c) 2003-2010 Cavium Networks
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, Version 2, as
- * published by the Free Software Foundation.
  */
 
 #include 
diff --git a/drivers/staging/octeon/ethernet-mem.h 
b/drivers/staging/octeon/ethernet-mem.h
index 225b29726185..692dcdb7154d 100644
--- a/drivers/staging/octeon/ethernet-mem.h
+++ b/drivers/staging/octeon/ethernet-mem.h
@@ -3,10 +3,6 @@
  * This file is based on code from OCTEON SDK by Cavium Networks.
  *
  * Copyright (c) 2003-2007 Cavium Networks
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, Version 2, as
- * published by the Free Software Foundation.
  */
 
 int cvm_oct_mem_fill_fpa(int pool, int size, int elements);
diff --git a/drivers/staging/octeon/ethernet-rgmii.c 
b/drivers/staging/octeon/ethernet-rgmii.c
index 76309e30587b..c15376d33891 100644
--- a/drivers/staging/octeon/ethernet-rgmii.c
+++ 

[PATCH 18/24] staging: dgnc: remove redundant license text

2018-01-11 Thread Greg Kroah-Hartman
Now that the SPDX tag is in all drivers/staging/dgnc files, that
identifies the license in a specific and legally-defined manner.  So the
extra GPL text wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Lidza Louina 
Cc: Mark Hounschell 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/dgnc/dgnc_cls.c| 10 --
 drivers/staging/dgnc/dgnc_cls.h| 10 --
 drivers/staging/dgnc/dgnc_driver.c | 10 --
 drivers/staging/dgnc/dgnc_driver.h | 10 --
 drivers/staging/dgnc/dgnc_mgmt.c   | 10 --
 drivers/staging/dgnc/dgnc_mgmt.h   | 10 --
 drivers/staging/dgnc/dgnc_neo.c| 10 --
 drivers/staging/dgnc/dgnc_neo.h| 10 --
 drivers/staging/dgnc/dgnc_pci.h| 10 --
 drivers/staging/dgnc/dgnc_tty.c| 10 --
 drivers/staging/dgnc/dgnc_tty.h| 10 --
 drivers/staging/dgnc/digi.h| 10 --
 12 files changed, 120 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index d05186983d52..bbb3673618a9 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -2,16 +2,6 @@
 /*
  * Copyright 2003 Digi International (www.digi.com)
  * Scott H Kilau 
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
  */
 
 #include 
diff --git a/drivers/staging/dgnc/dgnc_cls.h b/drivers/staging/dgnc/dgnc_cls.h
index dc88d9be4f7d..d31508542261 100644
--- a/drivers/staging/dgnc/dgnc_cls.h
+++ b/drivers/staging/dgnc/dgnc_cls.h
@@ -2,16 +2,6 @@
 /*
  * Copyright 2003 Digi International (www.digi.com)
  * Scott H Kilau 
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
  */
 
 #ifndef _DGNC_CLS_H
diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index 6e70c6afde8d..3e49a4ed24fd 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -2,16 +2,6 @@
 /*
  * Copyright 2003 Digi International (www.digi.com)
  * Scott H Kilau 
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
  */
 
 #include 
diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index 126441dc0d72..8389b6cf5317 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -2,16 +2,6 @@
 /*
  * Copyright 2003 Digi International (www.digi.com)
  *  Scott H Kilau 
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
  */
 
 #ifndef _DGNC_DRIVER_H
diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c
index dc3d038e04e8..47b10168560d 100644
--- a/drivers/staging/dgnc/dgnc_mgmt.c
+++ b/drivers/staging/dgnc/dgnc_mgmt.c
@@ -2,16 +2,6 @@
 /*
  * Copyright 2003 Digi International (www.digi.com)
  * Scott H Kilau 
- *
- * This program is 

[PATCH 21/24] staging: emxx_udc: add SPDX identifier.

2018-01-11 Thread Greg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the staging emxx_udc driver to have a proper SPDX identifier,
based on the license text in the file itself.  The SPDX identifier is a
legally binding shorthand, which can be used instead of the full boiler
plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner 
Cc: Kate Stewart 
Cc: Philippe Ombredanne 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/emxx_udc/emxx_udc.c | 1 +
 drivers/staging/emxx_udc/emxx_udc.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index bb010cb98a1c..7f80c9e32bde 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  *  drivers/usb/gadget/emxx_udc.c
  * EMXX FCD (Function Controller Driver) for USB.
diff --git a/drivers/staging/emxx_udc/emxx_udc.h 
b/drivers/staging/emxx_udc/emxx_udc.h
index 928d531a5115..9b40d6687ee3 100644
--- a/drivers/staging/emxx_udc/emxx_udc.h
+++ b/drivers/staging/emxx_udc/emxx_udc.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  *  EMXX FCD (Function Controller Driver) for USB.
  *
-- 
2.15.1

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


[PATCH 22/24] staging: emxx_udc: remove redundant license text

2018-01-11 Thread Greg Kroah-Hartman
Now that the SPDX tag is in the emxx_udc driver files, that identifies
the license in a specific and legally-defined manner.  So the extra GPL
text wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/emxx_udc/emxx_udc.c | 9 -
 drivers/staging/emxx_udc/emxx_udc.h | 9 -
 2 files changed, 18 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index 7f80c9e32bde..7517001fb8f0 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -4,15 +4,6 @@
  * EMXX FCD (Function Controller Driver) for USB.
  *
  *  Copyright (C) 2010 Renesas Electronics Corporation
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2
- *  as published by the Free Software Foundation.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- *  GNU General Public License for more details.
  */
 
 #include 
diff --git a/drivers/staging/emxx_udc/emxx_udc.h 
b/drivers/staging/emxx_udc/emxx_udc.h
index 9b40d6687ee3..8337e38c238a 100644
--- a/drivers/staging/emxx_udc/emxx_udc.h
+++ b/drivers/staging/emxx_udc/emxx_udc.h
@@ -3,15 +3,6 @@
  *  EMXX FCD (Function Controller Driver) for USB.
  *
  *  Copyright (C) 2010 Renesas Electronics Corporation
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2
- *  as published by the Free Software Foundation.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- *  GNU General Public License for more details.
  */
 
 #ifndef _LINUX_EMXX_H
-- 
2.15.1

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


[PATCH 13/24] staging: octeon: add SPDX identifiers.

2018-01-11 Thread Greg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the staging octeon driver to have a proper SPDX identifier, based
on the license text in the file itself.  The SPDX identifier is a
legally binding shorthand, which can be used instead of the full boiler
plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner 
Cc: Kate Stewart 
Cc: Philippe Ombredanne 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/octeon/Makefile   | 1 +
 drivers/staging/octeon/ethernet-defines.h | 1 +
 drivers/staging/octeon/ethernet-mdio.c| 1 +
 drivers/staging/octeon/ethernet-mdio.h| 1 +
 drivers/staging/octeon/ethernet-mem.c | 1 +
 drivers/staging/octeon/ethernet-mem.h | 1 +
 drivers/staging/octeon/ethernet-rgmii.c   | 1 +
 drivers/staging/octeon/ethernet-rx.c  | 1 +
 drivers/staging/octeon/ethernet-rx.h  | 1 +
 drivers/staging/octeon/ethernet-sgmii.c   | 1 +
 drivers/staging/octeon/ethernet-spi.c | 1 +
 drivers/staging/octeon/ethernet-tx.c  | 1 +
 drivers/staging/octeon/ethernet-tx.h  | 1 +
 drivers/staging/octeon/ethernet-util.h| 1 +
 drivers/staging/octeon/ethernet.c | 1 +
 drivers/staging/octeon/octeon-ethernet.h  | 1 +
 16 files changed, 16 insertions(+)

diff --git a/drivers/staging/octeon/Makefile b/drivers/staging/octeon/Makefile
index 8ca17210d917..84de1f9c5598 100644
--- a/drivers/staging/octeon/Makefile
+++ b/drivers/staging/octeon/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
 # This file is subject to the terms and conditions of the GNU General Public
 # License.  See the file "COPYING" in the main directory of this archive
 # for more details.
diff --git a/drivers/staging/octeon/ethernet-defines.h 
b/drivers/staging/octeon/ethernet-defines.h
index 07bd2b87f6a0..1a366d71d044 100644
--- a/drivers/staging/octeon/ethernet-defines.h
+++ b/drivers/staging/octeon/ethernet-defines.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * This file is based on code from OCTEON SDK by Cavium Networks.
  *
diff --git a/drivers/staging/octeon/ethernet-mdio.c 
b/drivers/staging/octeon/ethernet-mdio.c
index 691e4a51ace4..c70f17386a24 100644
--- a/drivers/staging/octeon/ethernet-mdio.c
+++ b/drivers/staging/octeon/ethernet-mdio.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * This file is based on code from OCTEON SDK by Cavium Networks.
  *
diff --git a/drivers/staging/octeon/ethernet-mdio.h 
b/drivers/staging/octeon/ethernet-mdio.h
index 5ed8483fc24d..52cae2d2dacc 100644
--- a/drivers/staging/octeon/ethernet-mdio.h
+++ b/drivers/staging/octeon/ethernet-mdio.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * This file is based on code from OCTEON SDK by Cavium Networks.
  *
diff --git a/drivers/staging/octeon/ethernet-mem.c 
b/drivers/staging/octeon/ethernet-mem.c
index d6172e4dace5..5f2077c4b86e 100644
--- a/drivers/staging/octeon/ethernet-mem.c
+++ b/drivers/staging/octeon/ethernet-mem.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * This file is based on code from OCTEON SDK by Cavium Networks.
  *
diff --git a/drivers/staging/octeon/ethernet-mem.h 
b/drivers/staging/octeon/ethernet-mem.h
index 62d07c426f89..225b29726185 100644
--- a/drivers/staging/octeon/ethernet-mem.h
+++ b/drivers/staging/octeon/ethernet-mem.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * This file is based on code from OCTEON SDK by Cavium Networks.
  *
diff --git a/drivers/staging/octeon/ethernet-rgmii.c 
b/drivers/staging/octeon/ethernet-rgmii.c
index 4e7304210bb9..76309e30587b 100644
--- a/drivers/staging/octeon/ethernet-rgmii.c
+++ b/drivers/staging/octeon/ethernet-rgmii.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * This file is based on code from OCTEON SDK by Cavium Networks.
  *
diff --git a/drivers/staging/octeon/ethernet-rx.c 
b/drivers/staging/octeon/ethernet-rx.c
index 1a44291318ee..0f9895742079 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * This file is based on code from OCTEON SDK by Cavium Networks.
  *
diff --git a/drivers/staging/octeon/ethernet-rx.h 
b/drivers/staging/octeon/ethernet-rx.h
index 315a63d7094f..5674ae4328f1 100644
--- a/drivers/staging/octeon/ethernet-rx.h
+++ b/drivers/staging/octeon/ethernet-rx.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * This file is based on code from OCTEON SDK by Cavium Networks.
  *
diff --git a/drivers/staging/octeon/ethernet-sgmii.c 
b/drivers/staging/octeon/ethernet-sgmii.c
index 7424dc45ad39..75885db7c3a9 100644
--- a/drivers/staging/octeon/ethernet-sgmii.c
+++ b/drivers/staging/octeon/ethernet-sgmii.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * This 

[PATCH 23/24] staging: fbtft: add SPDX identifiers

2018-01-11 Thread Greg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the all of the staging fbtft drivers to have a proper SPDX
identifier, based on the license text in the file itself.  The SPDX
identifier is a legally binding shorthand, which can be used instead of
the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner 
Cc: Kate Stewart 
Cc: Philippe Ombredanne 
Cc: Thomas Petazzoni 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/fbtft/fb_agm1264k-fl.c | 1 +
 drivers/staging/fbtft/fb_bd663474.c| 1 +
 drivers/staging/fbtft/fb_hx8340bn.c| 1 +
 drivers/staging/fbtft/fb_hx8347d.c | 1 +
 drivers/staging/fbtft/fb_hx8353d.c | 1 +
 drivers/staging/fbtft/fb_hx8357d.c | 1 +
 drivers/staging/fbtft/fb_hx8357d.h | 1 +
 drivers/staging/fbtft/fb_ili9163.c | 1 +
 drivers/staging/fbtft/fb_ili9320.c | 1 +
 drivers/staging/fbtft/fb_ili9325.c | 1 +
 drivers/staging/fbtft/fb_ili9340.c | 1 +
 drivers/staging/fbtft/fb_ili9341.c | 1 +
 drivers/staging/fbtft/fb_ili9481.c | 1 +
 drivers/staging/fbtft/fb_ili9486.c | 1 +
 drivers/staging/fbtft/fb_pcd8544.c | 1 +
 drivers/staging/fbtft/fb_ra8875.c  | 1 +
 drivers/staging/fbtft/fb_s6d02a1.c | 1 +
 drivers/staging/fbtft/fb_s6d1121.c | 1 +
 drivers/staging/fbtft/fb_sh1106.c  | 1 +
 drivers/staging/fbtft/fb_ssd1289.c | 1 +
 drivers/staging/fbtft/fb_ssd1305.c | 1 +
 drivers/staging/fbtft/fb_ssd1306.c | 1 +
 drivers/staging/fbtft/fb_ssd1325.c | 1 +
 drivers/staging/fbtft/fb_ssd1331.c | 1 +
 drivers/staging/fbtft/fb_ssd1351.c | 1 +
 drivers/staging/fbtft/fb_st7735r.c | 1 +
 drivers/staging/fbtft/fb_st7789v.c | 1 +
 drivers/staging/fbtft/fb_tinylcd.c | 1 +
 drivers/staging/fbtft/fb_tls8204.c | 1 +
 drivers/staging/fbtft/fb_uc1611.c  | 1 +
 drivers/staging/fbtft/fb_uc1701.c  | 1 +
 drivers/staging/fbtft/fb_upd161704.c   | 1 +
 drivers/staging/fbtft/fb_watterott.c   | 1 +
 drivers/staging/fbtft/fbtft-core.c | 1 +
 drivers/staging/fbtft/fbtft.h  | 1 +
 drivers/staging/fbtft/fbtft_device.c   | 1 +
 drivers/staging/fbtft/flexfb.c | 1 +
 drivers/staging/fbtft/internal.h   | 1 +
 38 files changed, 38 insertions(+)

diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c 
b/drivers/staging/fbtft/fb_agm1264k-fl.c
index 456a8dd65caf..5f2136136202 100644
--- a/drivers/staging/fbtft/fb_agm1264k-fl.c
+++ b/drivers/staging/fbtft/fb_agm1264k-fl.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * FB driver for Two KS0108 LCD controllers in AGM1264K-FL display
  *
diff --git a/drivers/staging/fbtft/fb_bd663474.c 
b/drivers/staging/fbtft/fb_bd663474.c
index 6010e6cbbd72..7319b7fb36aa 100644
--- a/drivers/staging/fbtft/fb_bd663474.c
+++ b/drivers/staging/fbtft/fb_bd663474.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * FB driver for the uPD161704 LCD Controller
  *
diff --git a/drivers/staging/fbtft/fb_hx8340bn.c 
b/drivers/staging/fbtft/fb_hx8340bn.c
index fbd5ef525243..161acbbb7ac9 100644
--- a/drivers/staging/fbtft/fb_hx8340bn.c
+++ b/drivers/staging/fbtft/fb_hx8340bn.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * FB driver for the HX8340BN LCD Controller
  *
diff --git a/drivers/staging/fbtft/fb_hx8347d.c 
b/drivers/staging/fbtft/fb_hx8347d.c
index bbf78f8644a8..023a06461800 100644
--- a/drivers/staging/fbtft/fb_hx8347d.c
+++ b/drivers/staging/fbtft/fb_hx8347d.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * FB driver for the HX8347D LCD Controller
  *
diff --git a/drivers/staging/fbtft/fb_hx8353d.c 
b/drivers/staging/fbtft/fb_hx8353d.c
index 2c18051a44b3..27c5b616df7a 100644
--- a/drivers/staging/fbtft/fb_hx8353d.c
+++ b/drivers/staging/fbtft/fb_hx8353d.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * FB driver for the HX8353D LCD Controller
  *
diff --git a/drivers/staging/fbtft/fb_hx8357d.c 
b/drivers/staging/fbtft/fb_hx8357d.c
index 32e6efe1d0a7..548f6912db56 100644
--- a/drivers/staging/fbtft/fb_hx8357d.c
+++ b/drivers/staging/fbtft/fb_hx8357d.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * FB driver for the HX8357D LCD Controller
  * Copyright (C) 2015 Adafruit Industries
diff --git a/drivers/staging/fbtft/fb_hx8357d.h 
b/drivers/staging/fbtft/fb_hx8357d.h
index e281921d4a97..6180b093f94f 100644
--- a/drivers/staging/fbtft/fb_hx8357d.h
+++ b/drivers/staging/fbtft/fb_hx8357d.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: MIT */
 /*
  * This is our library for the Adafruit  ILI9341 Breakout and Shield
  * > http://www.adafruit.com/products/1651
diff --git a/drivers/staging/fbtft/fb_ili9163.c 
b/drivers/staging/fbtft/fb_ili9163.c
index 045cadc3bc65..f0a60b9c9a2b 100644
--- 

[PATCH 06/24] staging: vc04_services: bcm2835-audio: remove redundant license text

2018-01-11 Thread Greg Kroah-Hartman
Now that the SPDX tag is in all
drivers/staging/vc04_services/bcm2835-audio/ files, that identifies the
license in a specific and legally-defined manner.  So the extra GPL text
wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Eric Anholt 
Cc: Stefan Wahren 
Cc: Florian Fainelli 
Cc: Ray Jui 
Cc: Scott Branden 
Cc: 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c  | 14 +-
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c  | 14 +-
 .../staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c| 14 +-
 drivers/staging/vc04_services/bcm2835-audio/bcm2835.c  | 14 +-
 drivers/staging/vc04_services/bcm2835-audio/bcm2835.h  | 14 +-
 .../vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h   | 14 +-
 6 files changed, 6 insertions(+), 78 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c 
b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
index 4ad67e64e6b9..ec468d5719b1 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
@@ -1,17 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
-/*
- * Copyright 2011 Broadcom Corporation.  All rights reserved.
- *
- * Unless you and Broadcom execute a separate written software license
- * agreement governing use of this software, this software is licensed to you
- * under the terms of the GNU General Public License version 2, available at
- * http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
- *
- * Notwithstanding the above, under no circumstances may you combine this
- * software in any way with any other Broadcom software provided under a
- * license other than the GPL, without Broadcom's express prior written
- * consent.
- */
+/* Copyright 2011 Broadcom Corporation.  All rights reserved. */
 
 #include 
 #include 
diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c 
b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
index 121172d5398c..5f7551fbf5cf 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
@@ -1,17 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
-/*
- * Copyright 2011 Broadcom Corporation.  All rights reserved.
- *
- * Unless you and Broadcom execute a separate written software license
- * agreement governing use of this software, this software is licensed to you
- * under the terms of the GNU General Public License version 2, available at
- * http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
- *
- * Notwithstanding the above, under no circumstances may you combine this
- * software in any way with any other Broadcom software provided under a
- * license other than the GPL, without Broadcom's express prior written
- * consent.
- */
+/* Copyright 2011 Broadcom Corporation.  All rights reserved. */
 
 #include 
 #include 
diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c 
b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
index 16a084a82c2f..a4a48f31f1a3 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
@@ -1,17 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
-/*
- * Copyright 2011 Broadcom Corporation.  All rights reserved.
- *
- * Unless you and Broadcom execute a separate written software license
- * agreement governing use of this software, this software is licensed to you
- * under the terms of the GNU General Public License version 2, available at
- * http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
- *
- * Notwithstanding the above, under no circumstances may you combine this
- * software in any way with any other Broadcom software provided under a
- * license other than the GPL, without Broadcom's express prior written
- * consent.
- */
+/* Copyright 2011 Broadcom Corporation.  All rights reserved. */
 
 #include 
 #include 
diff --git 

[PATCH 12/24] staging: nvec: remove redundant license text

2018-01-11 Thread Greg Kroah-Hartman
Now that the SPDX tag is in all drivers/staging/nvec/ files, that
identifies the license in a specific and legally-defined manner.  So the
extra GPL text wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Marc Dietrich 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/nvec/nvec-keytable.h | 13 -
 drivers/staging/nvec/nvec.c  |  5 -
 drivers/staging/nvec/nvec.h  |  5 -
 drivers/staging/nvec/nvec_kbd.c  |  5 -
 drivers/staging/nvec/nvec_paz00.c|  5 -
 drivers/staging/nvec/nvec_power.c|  5 -
 drivers/staging/nvec/nvec_ps2.c  |  5 -
 7 files changed, 43 deletions(-)

diff --git a/drivers/staging/nvec/nvec-keytable.h 
b/drivers/staging/nvec/nvec-keytable.h
index fb1b15365c1e..ac58e87e6a4e 100644
--- a/drivers/staging/nvec/nvec-keytable.h
+++ b/drivers/staging/nvec/nvec-keytable.h
@@ -6,19 +6,6 @@
  * embedded controller
  *
  * Copyright (c) 2009, NVIDIA Corporation.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, see http://www.gnu.org/licenses
  */
 
 static unsigned short code_tab_102us[] = {
diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 55d71e768067..52054a528723 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -8,11 +8,6 @@
  *   Ilya Petrov 
  *   Marc Dietrich 
  *   Julian Andres Klode 
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
  */
 
 #include 
diff --git a/drivers/staging/nvec/nvec.h b/drivers/staging/nvec/nvec.h
index e8e952612604..25efcdfa4f20 100644
--- a/drivers/staging/nvec/nvec.h
+++ b/drivers/staging/nvec/nvec.h
@@ -8,11 +8,6 @@
  *   Ilya Petrov 
  *   Marc Dietrich 
  *   Julian Andres Klode 
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
  */
 
 #ifndef __LINUX_MFD_NVEC
diff --git a/drivers/staging/nvec/nvec_kbd.c b/drivers/staging/nvec/nvec_kbd.c
index fe17515a2f23..01dbb66f7e9a 100644
--- a/drivers/staging/nvec/nvec_kbd.c
+++ b/drivers/staging/nvec/nvec_kbd.c
@@ -6,11 +6,6 @@
  *
  * Authors:  Pierre-Hugues Husson 
  *   Marc Dietrich 
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
  */
 
 #include 
diff --git a/drivers/staging/nvec/nvec_paz00.c 
b/drivers/staging/nvec/nvec_paz00.c
index 33e8922b550d..8b4da95081c8 100644
--- a/drivers/staging/nvec/nvec_paz00.c
+++ b/drivers/staging/nvec/nvec_paz00.c
@@ -5,11 +5,6 @@
  * Copyright (C) 2011 The AC100 Kernel Team 
  *
  * Authors:  Ilya Petrov 
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
  */
 
 #include 
diff --git a/drivers/staging/nvec/nvec_power.c 
b/drivers/staging/nvec/nvec_power.c
index 94ac2c2def0a..0e861c4bfcbf 100644
--- a/drivers/staging/nvec/nvec_power.c
+++ b/drivers/staging/nvec/nvec_power.c
@@ -6,11 +6,6 @@
  *
  * Authors:  Ilya Petrov 
  *   Marc Dietrich 
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
  */
 
 #include 
diff --git a/drivers/staging/nvec/nvec_ps2.c b/drivers/staging/nvec/nvec_ps2.c
index 58f93b85ae1d..45db29262a9c 100644
--- a/drivers/staging/nvec/nvec_ps2.c
+++ b/drivers/staging/nvec/nvec_ps2.c
@@ -7,11 +7,6 @@
  * Authors:  Pierre-Hugues Husson 
  *   Ilya 

[PATCH 05/24] staging: vc04_services: bcm2835-audio: add SPDX identifiers

2018-01-11 Thread Greg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the bcm2835-audio driver to have a proper SPDX identifier, based
on the license text in the file itself.  The SPDX identifier is a
legally binding shorthand, which can be used instead of the full boiler
plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner 
Cc: Kate Stewart 
Cc: Philippe Ombredanne 
Cc: Eric Anholt 
Cc: Stefan Wahren 
Cc: Florian Fainelli 
Cc: Ray Jui 
Cc: Scott Branden 
Cc: 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c| 1 +
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c| 1 +
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c  | 1 +
 drivers/staging/vc04_services/bcm2835-audio/bcm2835.c| 1 +
 drivers/staging/vc04_services/bcm2835-audio/bcm2835.h| 1 +
 drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h | 1 +
 6 files changed, 6 insertions(+)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c 
b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
index f484bb055df7..4ad67e64e6b9 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright 2011 Broadcom Corporation.  All rights reserved.
  *
diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c 
b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
index 7e68b3e28246..121172d5398c 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright 2011 Broadcom Corporation.  All rights reserved.
  *
diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c 
b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
index 3c6f1d91d22d..16a084a82c2f 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright 2011 Broadcom Corporation.  All rights reserved.
  *
diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c 
b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
index 50a5f294c13f..f71ec30d6b51 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright 2011 Broadcom Corporation.  All rights reserved.
  *
diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h 
b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
index f1e43e45fd67..03feecb568bd 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright 2011 Broadcom Corporation.  All rights reserved.
  *
diff --git 
a/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h 
b/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h
index da96f1bc2516..9e05150d925d 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h
+++ b/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright 2011 Broadcom Corporation.  All rights reserved.
  *
-- 
2.15.1

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


[PATCH 03/24] staging: typec: add SPDX identifier.

2018-01-11 Thread Greg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the drivers/staging/typec/ files to have a proper SPDX
identifier, based on the license text in the file itself.  The SPDX
identifier is a legally binding shorthand, which can be used instead of
the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner 
Cc: Kate Stewart 
Cc: Philippe Ombredanne 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/typec/tcpci.c | 1 +
 drivers/staging/typec/tcpci.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c
index c6b5b0a3293f..8722dc1444f8 100644
--- a/drivers/staging/typec/tcpci.c
+++ b/drivers/staging/typec/tcpci.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2015-2017 Google, Inc
  *
diff --git a/drivers/staging/typec/tcpci.h b/drivers/staging/typec/tcpci.h
index 10b04c8723da..2a16dbf852a5 100644
--- a/drivers/staging/typec/tcpci.h
+++ b/drivers/staging/typec/tcpci.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2015-2017 Google, Inc
  *
-- 
2.15.1

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


[PATCH 11/24] staging: nvec: add SPDX identifier.

2018-01-11 Thread Greg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the staging nvec driver to have a proper SPDX identifiers, based
on the license text in the file itself.  The SPDX identifier is a
legally binding shorthand, which can be used instead of the full boiler
plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner 
Cc: Kate Stewart 
Cc: Philippe Ombredanne 
Cc: Marc Dietrich 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/nvec/nvec-keytable.h | 1 +
 drivers/staging/nvec/nvec.c  | 1 +
 drivers/staging/nvec/nvec.h  | 1 +
 drivers/staging/nvec/nvec_kbd.c  | 1 +
 drivers/staging/nvec/nvec_paz00.c| 1 +
 drivers/staging/nvec/nvec_power.c| 1 +
 drivers/staging/nvec/nvec_ps2.c  | 1 +
 7 files changed, 7 insertions(+)

diff --git a/drivers/staging/nvec/nvec-keytable.h 
b/drivers/staging/nvec/nvec-keytable.h
index 7008c96bdbbe..fb1b15365c1e 100644
--- a/drivers/staging/nvec/nvec-keytable.h
+++ b/drivers/staging/nvec/nvec-keytable.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * drivers/input/keyboard/tegra-nvec.c
  *
diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 4ff8f47385da..55d71e768067 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * NVEC: NVIDIA compliant embedded controller interface
  *
diff --git a/drivers/staging/nvec/nvec.h b/drivers/staging/nvec/nvec.h
index aa7c70ef94f5..e8e952612604 100644
--- a/drivers/staging/nvec/nvec.h
+++ b/drivers/staging/nvec/nvec.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * NVEC: NVIDIA compliant embedded controller interface
  *
diff --git a/drivers/staging/nvec/nvec_kbd.c b/drivers/staging/nvec/nvec_kbd.c
index a01f486621eb..fe17515a2f23 100644
--- a/drivers/staging/nvec/nvec_kbd.c
+++ b/drivers/staging/nvec/nvec_kbd.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * nvec_kbd: keyboard driver for a NVIDIA compliant embedded controller
  *
diff --git a/drivers/staging/nvec/nvec_paz00.c 
b/drivers/staging/nvec/nvec_paz00.c
index 51dbeeb3320e..33e8922b550d 100644
--- a/drivers/staging/nvec/nvec_paz00.c
+++ b/drivers/staging/nvec/nvec_paz00.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * nvec_paz00: OEM specific driver for Compal PAZ00 based devices
  *
diff --git a/drivers/staging/nvec/nvec_power.c 
b/drivers/staging/nvec/nvec_power.c
index 3b144a9ea055..94ac2c2def0a 100644
--- a/drivers/staging/nvec/nvec_power.c
+++ b/drivers/staging/nvec/nvec_power.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * nvec_power: power supply driver for a NVIDIA compliant embedded controller
  *
diff --git a/drivers/staging/nvec/nvec_ps2.c b/drivers/staging/nvec/nvec_ps2.c
index 3b7bce3ffd19..58f93b85ae1d 100644
--- a/drivers/staging/nvec/nvec_ps2.c
+++ b/drivers/staging/nvec/nvec_ps2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * nvec_ps2: mouse driver for a NVIDIA compliant embedded controller
  *
-- 
2.15.1

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


[PATCH 17/24] staging: dgnc: add SPDX identifier.

2018-01-11 Thread Greg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the staging dgnc driver to have a proper SPDX identifier, based
on the license text in the file itself.  The SPDX identifier is a
legally binding shorthand, which can be used instead of the full boiler
plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner 
Cc: Kate Stewart 
Cc: Philippe Ombredanne 
Cc: Lidza Louina 
Cc: Mark Hounschell 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/dgnc/dgnc_cls.c| 1 +
 drivers/staging/dgnc/dgnc_cls.h| 1 +
 drivers/staging/dgnc/dgnc_driver.c | 1 +
 drivers/staging/dgnc/dgnc_driver.h | 1 +
 drivers/staging/dgnc/dgnc_mgmt.c   | 1 +
 drivers/staging/dgnc/dgnc_mgmt.h   | 1 +
 drivers/staging/dgnc/dgnc_neo.c| 1 +
 drivers/staging/dgnc/dgnc_neo.h| 1 +
 drivers/staging/dgnc/dgnc_pci.h| 1 +
 drivers/staging/dgnc/dgnc_tty.c| 1 +
 drivers/staging/dgnc/dgnc_tty.h| 1 +
 drivers/staging/dgnc/digi.h| 1 +
 12 files changed, 12 insertions(+)

diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index e264fe11cba4..d05186983d52 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2003 Digi International (www.digi.com)
  * Scott H Kilau 
diff --git a/drivers/staging/dgnc/dgnc_cls.h b/drivers/staging/dgnc/dgnc_cls.h
index 9dfa9682a897..dc88d9be4f7d 100644
--- a/drivers/staging/dgnc/dgnc_cls.h
+++ b/drivers/staging/dgnc/dgnc_cls.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2003 Digi International (www.digi.com)
  * Scott H Kilau 
diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index d9bf5da1b8e5..6e70c6afde8d 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2003 Digi International (www.digi.com)
  * Scott H Kilau 
diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index 924357120b0c..126441dc0d72 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2003 Digi International (www.digi.com)
  *  Scott H Kilau 
diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c
index 3ca473b47daf..dc3d038e04e8 100644
--- a/drivers/staging/dgnc/dgnc_mgmt.c
+++ b/drivers/staging/dgnc/dgnc_mgmt.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2003 Digi International (www.digi.com)
  * Scott H Kilau 
diff --git a/drivers/staging/dgnc/dgnc_mgmt.h b/drivers/staging/dgnc/dgnc_mgmt.h
index a7a5770d7630..db16a576edda 100644
--- a/drivers/staging/dgnc/dgnc_mgmt.h
+++ b/drivers/staging/dgnc/dgnc_mgmt.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2003 Digi International (www.digi.com)
  * Scott H Kilau 
diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 0ae229c3..834fa75861aa 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2003 Digi International (www.digi.com)
  * Scott H Kilau 
diff --git a/drivers/staging/dgnc/dgnc_neo.h b/drivers/staging/dgnc/dgnc_neo.h
index c30a2c2b5eea..005fb422f79c 100644
--- a/drivers/staging/dgnc/dgnc_neo.h
+++ b/drivers/staging/dgnc/dgnc_neo.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2003 Digi International (www.digi.com)
  * Scott H Kilau 
diff --git a/drivers/staging/dgnc/dgnc_pci.h b/drivers/staging/dgnc/dgnc_pci.h
index 59845916d90c..478b69fbf06e 100644
--- a/drivers/staging/dgnc/dgnc_pci.h
+++ b/drivers/staging/dgnc/dgnc_pci.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2003 Digi International (www.digi.com)
  * Scott H Kilau 
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index d3736daf8cf2..c528b11663de 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2003 Digi International (www.digi.com)
  * Scott H Kilau 
diff --git a/drivers/staging/dgnc/dgnc_tty.h b/drivers/staging/dgnc/dgnc_tty.h
index 6c58f1b3461a..56c67b72e5db 100644
--- a/drivers/staging/dgnc/dgnc_tty.h
+++ b/drivers/staging/dgnc/dgnc_tty.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2003 Digi International (www.digi.com)
  * Scott H Kilau 
diff --git a/drivers/staging/dgnc/digi.h 

[PATCH 01/24] staging: vme: vme_user: add SPDX identifier.

2018-01-11 Thread Greg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the remaining staging vme driver to have a proper SPDX
identifier, based on the license text in the file itself.  The SPDX
identifier is a legally binding shorthand, which can be used instead of
the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner 
Cc: Kate Stewart 
Cc: Philippe Ombredanne 
Cc: Martyn Welch 
Cc: Manohar Vanga 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/vme/devices/vme_user.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/vme/devices/vme_user.c 
b/drivers/staging/vme/devices/vme_user.c
index 41a5b32e0d1c..e4be16c5f726 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * VMEbus User access driver
  *
-- 
2.15.1

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


Re: [PATCH 3/7] crypto: ccree: add ablkcipher support

2018-01-11 Thread Corentin Labbe
On Thu, Jan 11, 2018 at 09:17:10AM +, Gilad Ben-Yossef wrote:
> Add CryptoCell ablkcipher support
> 

Hello

I have some minor comments:

ablkcipher is deprecated, so you need to use skcipher instead.

> Signed-off-by: Gilad Ben-Yossef 
> ---
>  drivers/crypto/ccree/Makefile|2 +-
>  drivers/crypto/ccree/cc_buffer_mgr.c |  125 
>  drivers/crypto/ccree/cc_buffer_mgr.h |   10 +
>  drivers/crypto/ccree/cc_cipher.c | 1167 
> ++
>  drivers/crypto/ccree/cc_cipher.h |   74 +++
>  drivers/crypto/ccree/cc_driver.c |   11 +
>  drivers/crypto/ccree/cc_driver.h |2 +
>  7 files changed, 1390 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/crypto/ccree/cc_cipher.c
>  create mode 100644 drivers/crypto/ccree/cc_cipher.h
> 
[...]
> +
> +struct tdes_keys {
> + u8  key1[DES_KEY_SIZE];
> + u8  key2[DES_KEY_SIZE];
> + u8  key3[DES_KEY_SIZE];
> +};
> +
> +static const u8 zero_buff[] = {  0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
> + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
> + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
> + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
> +

This constant is used nowhere.

> +/* The function verifies that tdes keys are not weak.*/
> +static int cc_verify_3des_keys(const u8 *key, unsigned int keylen)
> +{
> + struct tdes_keys *tdes_key = (struct tdes_keys *)key;
> +
> + /* verify key1 != key2 and key3 != key2*/
> + if ((memcmp((u8 *)tdes_key->key1, (u8 *)tdes_key->key2,
> + sizeof(tdes_key->key1)) == 0) ||
> + (memcmp((u8 *)tdes_key->key3, (u8 *)tdes_key->key2,
> + sizeof(tdes_key->key3)) == 0)) {
> + return -ENOEXEC;
> + }
> +
> + return 0;
> +}

All driver testing 3des key also use des_ekey()

[...]
> +static void cc_cipher_complete(struct device *dev, void *cc_req, int err)
> +{
> + struct ablkcipher_request *areq = (struct ablkcipher_request *)cc_req;
> + struct scatterlist *dst = areq->dst;
> + struct scatterlist *src = areq->src;
> + struct blkcipher_req_ctx *req_ctx = ablkcipher_request_ctx(areq);
> + struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(areq);
> + unsigned int ivsize = crypto_ablkcipher_ivsize(tfm);
> + struct ablkcipher_request *req = (struct ablkcipher_request *)areq;
> +
> + cc_unmap_blkcipher_request(dev, req_ctx, ivsize, src, dst);
> + kfree(req_ctx->iv);

kzfree for all stuff with IV/key

[...]
> +
> +#ifdef CRYPTO_TFM_REQ_HW_KEY
> +
> +static inline bool cc_is_hw_key(struct crypto_tfm *tfm)
> +{
> + return (crypto_tfm_get_flags(tfm) & CRYPTO_TFM_REQ_HW_KEY);
> +}
> +
> +#else
> +
> +struct arm_hw_key_info {
> + int hw_key1;
> + int hw_key2;
> +};
> +
> +static inline bool cc_is_hw_key(struct crypto_tfm *tfm)
> +{
> + return false;
> +}
> +
> +#endif /* CRYPTO_TFM_REQ_HW_KEY */

I see nowhere any use/documentation of CRYPTO_TFM_REQ_HW_KEY, so a cleaning 
could be done

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


[PATCH 7/7] MAINTAINERS: update ccree entry

2018-01-11 Thread Gilad Ben-Yossef
Update Arm TrustZone CryptoCell driver entry move into drivers/crypto/

Signed-off-by: Gilad Ben-Yossef 
---
 MAINTAINERS | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 1082846..560e068 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3273,12 +3273,11 @@ F:  drivers/net/ieee802154/cc2520.c
 F: include/linux/spi/cc2520.h
 F: Documentation/devicetree/bindings/net/ieee802154/cc2520.txt
 
-CCREE ARM TRUSTZONE CRYPTOCELL 700 REE DRIVER
+CCREE ARM TRUSTZONE CRYPTOCELL REE DRIVER
 M: Gilad Ben-Yossef 
 L: linux-cry...@vger.kernel.org
-L: driverdev-devel@linuxdriverproject.org
 S: Supported
-F: drivers/staging/ccree/
+F: drivers/crypto/ccree/
 W: 
https://developer.arm.com/products/system-ip/trustzone-cryptocell/cryptocell-700-family
 
 CEC FRAMEWORK
-- 
2.7.4

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


[PATCH 5/7] crypto: ccree: add AEAD support

2018-01-11 Thread Gilad Ben-Yossef
Add CryptoCell AEAD support

Signed-off-by: Gilad Ben-Yossef 
---
 drivers/crypto/ccree/Makefile|2 +-
 drivers/crypto/ccree/cc_aead.c   | 2702 ++
 drivers/crypto/ccree/cc_aead.h   |  109 ++
 drivers/crypto/ccree/cc_buffer_mgr.c |  882 +++
 drivers/crypto/ccree/cc_buffer_mgr.h |4 +
 drivers/crypto/ccree/cc_driver.c |   10 +
 drivers/crypto/ccree/cc_driver.h |4 +
 7 files changed, 3712 insertions(+), 1 deletion(-)
 create mode 100644 drivers/crypto/ccree/cc_aead.c
 create mode 100644 drivers/crypto/ccree/cc_aead.h

diff --git a/drivers/crypto/ccree/Makefile b/drivers/crypto/ccree/Makefile
index 1109480..7cb3082 100644
--- a/drivers/crypto/ccree/Makefile
+++ b/drivers/crypto/ccree/Makefile
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 
 obj-$(CONFIG_CRYPTO_DEV_CCREE) := ccree.o
-ccree-y := cc_driver.o cc_buffer_mgr.o cc_request_mgr.o cc_cipher.o cc_hash.o 
cc_ivgen.o cc_sram_mgr.o
+ccree-y := cc_driver.o cc_buffer_mgr.o cc_request_mgr.o cc_cipher.o cc_hash.o 
cc_aead.o cc_ivgen.o cc_sram_mgr.o
 ccree-$(CONFIG_DEBUG_FS) += cc_debugfs.o
 ccree-$(CONFIG_PM) += cc_pm.o
diff --git a/drivers/crypto/ccree/cc_aead.c b/drivers/crypto/ccree/cc_aead.c
new file mode 100644
index 000..265adff
--- /dev/null
+++ b/drivers/crypto/ccree/cc_aead.c
@@ -0,0 +1,2702 @@
+// SPDX-License-Identifier: GPL-2.0
+/* Copyright (C) 2012-2018 ARM Limited or its affiliates. */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "cc_driver.h"
+#include "cc_buffer_mgr.h"
+#include "cc_aead.h"
+#include "cc_request_mgr.h"
+#include "cc_hash.h"
+#include "cc_sram_mgr.h"
+
+#define template_aead  template_u.aead
+
+#define MAX_AEAD_SETKEY_SEQ 12
+#define MAX_AEAD_PROCESS_SEQ 23
+
+#define MAX_HMAC_DIGEST_SIZE (SHA256_DIGEST_SIZE)
+#define MAX_HMAC_BLOCK_SIZE (SHA256_BLOCK_SIZE)
+
+#define AES_CCM_RFC4309_NONCE_SIZE 3
+#define MAX_NONCE_SIZE CTR_RFC3686_NONCE_SIZE
+
+/* Value of each ICV_CMP byte (of 8) in case of success */
+#define ICV_VERIF_OK 0x01
+
+struct cc_aead_handle {
+   cc_sram_addr_t sram_workspace_addr;
+   struct list_head aead_list;
+};
+
+struct cc_hmac_s {
+   u8 *padded_authkey;
+   u8 *ipad_opad; /* IPAD, OPAD*/
+   dma_addr_t padded_authkey_dma_addr;
+   dma_addr_t ipad_opad_dma_addr;
+};
+
+struct cc_xcbc_s {
+   u8 *xcbc_keys; /* K1,K2,K3 */
+   dma_addr_t xcbc_keys_dma_addr;
+};
+
+struct cc_aead_ctx {
+   struct cc_drvdata *drvdata;
+   u8 ctr_nonce[MAX_NONCE_SIZE]; /* used for ctr3686 iv and aes ccm */
+   u8 *enckey;
+   dma_addr_t enckey_dma_addr;
+   union {
+   struct cc_hmac_s hmac;
+   struct cc_xcbc_s xcbc;
+   } auth_state;
+   unsigned int enc_keylen;
+   unsigned int auth_keylen;
+   unsigned int authsize; /* Actual (reduced?) size of the MAC/ICv */
+   enum drv_cipher_mode cipher_mode;
+   enum cc_flow_mode flow_mode;
+   enum drv_hash_mode auth_mode;
+};
+
+static inline bool valid_assoclen(struct aead_request *req)
+{
+   return ((req->assoclen == 16) || (req->assoclen == 20));
+}
+
+static void cc_aead_exit(struct crypto_aead *tfm)
+{
+   struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm);
+   struct device *dev = drvdata_to_dev(ctx->drvdata);
+
+   dev_dbg(dev, "Clearing context @%p for %s\n", crypto_aead_ctx(tfm),
+   crypto_tfm_alg_name(>base));
+
+   /* Unmap enckey buffer */
+   if (ctx->enckey) {
+   dma_free_coherent(dev, AES_MAX_KEY_SIZE, ctx->enckey,
+ ctx->enckey_dma_addr);
+   dev_dbg(dev, "Freed enckey DMA buffer enckey_dma_addr=%pad\n",
+   >enckey_dma_addr);
+   ctx->enckey_dma_addr = 0;
+   ctx->enckey = NULL;
+   }
+
+   if (ctx->auth_mode == DRV_HASH_XCBC_MAC) { /* XCBC authetication */
+   struct cc_xcbc_s *xcbc = >auth_state.xcbc;
+
+   if (xcbc->xcbc_keys) {
+   dma_free_coherent(dev, CC_AES_128_BIT_KEY_SIZE * 3,
+ xcbc->xcbc_keys,
+ xcbc->xcbc_keys_dma_addr);
+   }
+   dev_dbg(dev, "Freed xcbc_keys DMA buffer 
xcbc_keys_dma_addr=%pad\n",
+   >xcbc_keys_dma_addr);
+   xcbc->xcbc_keys_dma_addr = 0;
+   xcbc->xcbc_keys = NULL;
+   } else if (ctx->auth_mode != DRV_HASH_NULL) { /* HMAC auth. */
+   struct cc_hmac_s *hmac = >auth_state.hmac;
+
+   if (hmac->ipad_opad) {
+   dma_free_coherent(dev, 2 * MAX_HMAC_DIGEST_SIZE,
+ hmac->ipad_opad,
+ hmac->ipad_opad_dma_addr);
+   dev_dbg(dev, "Freed ipad_opad DMA buffer 
ipad_opad_dma_addr=%pad\n",
+   

[PATCH 6/7] crypto: ccree: add FIPS support

2018-01-11 Thread Gilad Ben-Yossef
Add FIPS mode support to CryptoCell driver

Signed-off-by: Gilad Ben-Yossef 
---
 drivers/crypto/ccree/Makefile|   1 +
 drivers/crypto/ccree/cc_driver.c |  29 +-
 drivers/crypto/ccree/cc_driver.h |   1 +
 drivers/crypto/ccree/cc_fips.c   | 112 +++
 drivers/crypto/ccree/cc_fips.h   |  37 +
 5 files changed, 178 insertions(+), 2 deletions(-)
 create mode 100644 drivers/crypto/ccree/cc_fips.c
 create mode 100644 drivers/crypto/ccree/cc_fips.h

diff --git a/drivers/crypto/ccree/Makefile b/drivers/crypto/ccree/Makefile
index 7cb3082..bdc2797 100644
--- a/drivers/crypto/ccree/Makefile
+++ b/drivers/crypto/ccree/Makefile
@@ -2,5 +2,6 @@
 
 obj-$(CONFIG_CRYPTO_DEV_CCREE) := ccree.o
 ccree-y := cc_driver.o cc_buffer_mgr.o cc_request_mgr.o cc_cipher.o cc_hash.o 
cc_aead.o cc_ivgen.o cc_sram_mgr.o
+ccree-$(CONFIG_CRYPTO_FIPS) += cc_fips.o
 ccree-$(CONFIG_DEBUG_FS) += cc_debugfs.o
 ccree-$(CONFIG_PM) += cc_pm.o
diff --git a/drivers/crypto/ccree/cc_driver.c b/drivers/crypto/ccree/cc_driver.c
index 31140e3..b71dc70 100644
--- a/drivers/crypto/ccree/cc_driver.c
+++ b/drivers/crypto/ccree/cc_driver.c
@@ -25,6 +25,7 @@
 #include "cc_ivgen.h"
 #include "cc_sram_mgr.h"
 #include "cc_pm.h"
+#include "cc_fips.h"
 
 bool cc_dump_desc;
 module_param_named(dump_desc, cc_dump_desc, bool, 0600);
@@ -78,7 +79,17 @@ static irqreturn_t cc_isr(int irq, void *dev_id)
irr &= ~CC_COMP_IRQ_MASK;
complete_request(drvdata);
}
-
+#ifdef CONFIG_CRYPTO_FIPS
+   /* TEE FIPS interrupt */
+   if (irr & CC_GPR0_IRQ_MASK) {
+   /* Mask interrupt - will be unmasked in Deferred service
+* handler
+*/
+   cc_iowrite(drvdata, CC_REG(HOST_IMR), imr | CC_GPR0_IRQ_MASK);
+   irr &= ~CC_GPR0_IRQ_MASK;
+   fips_handler(drvdata);
+   }
+#endif
/* AXI error interrupt */
if (irr & CC_AXI_ERR_IRQ_MASK) {
u32 axi_err;
@@ -244,10 +255,15 @@ static int init_cc_resources(struct platform_device 
*plat_dev)
goto post_regs_err;
}
 
+   rc = cc_fips_init(new_drvdata);
+   if (rc) {
+   dev_err(dev, "CC_FIPS_INIT failed 0x%x\n", rc);
+   goto post_debugfs_err;
+   }
rc = cc_sram_mgr_init(new_drvdata);
if (rc) {
dev_err(dev, "cc_sram_mgr_init failed\n");
-   goto post_debugfs_err;
+   goto post_fips_init_err;
}
 
new_drvdata->mlli_sram_addr =
@@ -302,6 +318,12 @@ static int init_cc_resources(struct platform_device 
*plat_dev)
goto post_hash_err;
}
 
+   /* If we got here and FIPS mode is enabled
+* it means all FIPS test passed, so let TEE
+* know we're good.
+*/
+   cc_set_ree_fips_status(new_drvdata, true);
+
return 0;
 
 post_hash_err:
@@ -318,6 +340,8 @@ static int init_cc_resources(struct platform_device 
*plat_dev)
cc_req_mgr_fini(new_drvdata);
 post_sram_mgr_err:
cc_sram_mgr_fini(new_drvdata);
+post_fips_init_err:
+   cc_fips_fini(new_drvdata);
 post_debugfs_err:
cc_debugfs_fini(new_drvdata);
 post_regs_err:
@@ -346,6 +370,7 @@ static void cleanup_cc_resources(struct platform_device 
*plat_dev)
cc_buffer_mgr_fini(drvdata);
cc_req_mgr_fini(drvdata);
cc_sram_mgr_fini(drvdata);
+   cc_fips_fini(drvdata);
cc_debugfs_fini(drvdata);
fini_cc_regs(drvdata);
cc_clk_off(drvdata);
diff --git a/drivers/crypto/ccree/cc_driver.h b/drivers/crypto/ccree/cc_driver.h
index ab9a66f..12699f1 100644
--- a/drivers/crypto/ccree/cc_driver.h
+++ b/drivers/crypto/ccree/cc_driver.h
@@ -115,6 +115,7 @@ struct cc_drvdata {
void *aead_handle;
void *blkcipher_handle;
void *request_mgr_handle;
+   void *fips_handle;
void *ivgen_handle;
void *sram_mgr_handle;
void *debugfs;
diff --git a/drivers/crypto/ccree/cc_fips.c b/drivers/crypto/ccree/cc_fips.c
new file mode 100644
index 000..b25c34e
--- /dev/null
+++ b/drivers/crypto/ccree/cc_fips.c
@@ -0,0 +1,112 @@
+// SPDX-License-Identifier: GPL-2.0
+/* Copyright (C) 2012-2018 ARM Limited or its affiliates. */
+
+#include 
+#include 
+
+#include "cc_driver.h"
+#include "cc_fips.h"
+
+static void fips_dsr(unsigned long devarg);
+
+struct cc_fips_handle {
+   struct tasklet_struct tasklet;
+};
+
+/* The function called once at driver entry point to check
+ * whether TEE FIPS error occurred.
+ */
+static bool cc_get_tee_fips_status(struct cc_drvdata *drvdata)
+{
+   u32 reg;
+
+   reg = cc_ioread(drvdata, CC_REG(GPR_HOST));
+   return (reg == (CC_FIPS_SYNC_TEE_STATUS | CC_FIPS_SYNC_MODULE_OK));
+}
+
+/*
+ * This function should push the FIPS REE library status towards the TEE 
library
+ * by writing the error state to HOST_GPR0 register.
+ */
+void 

[PATCH 2/7] crypto: ccree: introduce CryptoCell driver

2018-01-11 Thread Gilad Ben-Yossef
Introduce basic low level Arm TrustZone CryptoCell HW support.
This first patch doesn't actually register any Crypto API
transformations, these will follow up in the next patch.

This first revision supports the CC 712 REE component.

Signed-off-by: Gilad Ben-Yossef 
---
 drivers/crypto/Kconfig  |  27 ++
 drivers/crypto/Makefile |   1 +
 drivers/crypto/ccree/Makefile   |   6 +
 drivers/crypto/ccree/cc_buffer_mgr.c| 387 +
 drivers/crypto/ccree/cc_buffer_mgr.h|  60 +++
 drivers/crypto/ccree/cc_crypto_ctx.h| 170 
 drivers/crypto/ccree/cc_debugfs.c   | 101 +
 drivers/crypto/ccree/cc_debugfs.h   |  32 ++
 drivers/crypto/ccree/cc_driver.c| 418 +++
 drivers/crypto/ccree/cc_driver.h| 186 +
 drivers/crypto/ccree/cc_host_regs.h | 142 +++
 drivers/crypto/ccree/cc_hw_queue_defs.h | 590 ++
 drivers/crypto/ccree/cc_ivgen.c | 280 +
 drivers/crypto/ccree/cc_ivgen.h |  55 +++
 drivers/crypto/ccree/cc_kernel_regs.h   | 167 
 drivers/crypto/ccree/cc_lli_defs.h  |  59 +++
 drivers/crypto/ccree/cc_pm.c| 119 ++
 drivers/crypto/ccree/cc_pm.h|  57 +++
 drivers/crypto/ccree/cc_request_mgr.c   | 714 
 drivers/crypto/ccree/cc_request_mgr.h   |  51 +++
 drivers/crypto/ccree/cc_sram_mgr.c  | 107 +
 drivers/crypto/ccree/cc_sram_mgr.h  |  65 +++
 22 files changed, 3794 insertions(+)
 create mode 100644 drivers/crypto/ccree/Makefile
 create mode 100644 drivers/crypto/ccree/cc_buffer_mgr.c
 create mode 100644 drivers/crypto/ccree/cc_buffer_mgr.h
 create mode 100644 drivers/crypto/ccree/cc_crypto_ctx.h
 create mode 100644 drivers/crypto/ccree/cc_debugfs.c
 create mode 100644 drivers/crypto/ccree/cc_debugfs.h
 create mode 100644 drivers/crypto/ccree/cc_driver.c
 create mode 100644 drivers/crypto/ccree/cc_driver.h
 create mode 100644 drivers/crypto/ccree/cc_host_regs.h
 create mode 100644 drivers/crypto/ccree/cc_hw_queue_defs.h
 create mode 100644 drivers/crypto/ccree/cc_ivgen.c
 create mode 100644 drivers/crypto/ccree/cc_ivgen.h
 create mode 100644 drivers/crypto/ccree/cc_kernel_regs.h
 create mode 100644 drivers/crypto/ccree/cc_lli_defs.h
 create mode 100644 drivers/crypto/ccree/cc_pm.c
 create mode 100644 drivers/crypto/ccree/cc_pm.h
 create mode 100644 drivers/crypto/ccree/cc_request_mgr.c
 create mode 100644 drivers/crypto/ccree/cc_request_mgr.h
 create mode 100644 drivers/crypto/ccree/cc_sram_mgr.c
 create mode 100644 drivers/crypto/ccree/cc_sram_mgr.h

diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index 47ec920..ed912bf 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -731,4 +731,31 @@ config CRYPTO_DEV_ARTPEC6
 
  To compile this driver as a module, choose M here.
 
+config CRYPTO_DEV_CCREE
+   tristate "Support for ARM TrustZone CryptoCell family of security 
processors"
+   depends on CRYPTO && CRYPTO_HW && OF && HAS_DMA
+   default n
+   select CRYPTO_HASH
+   select CRYPTO_BLKCIPHER
+   select CRYPTO_DES
+   select CRYPTO_AEAD
+   select CRYPTO_AUTHENC
+   select CRYPTO_SHA1
+   select CRYPTO_MD5
+   select CRYPTO_SHA256
+   select CRYPTO_SHA512
+   select CRYPTO_HMAC
+   select CRYPTO_AES
+   select CRYPTO_CBC
+   select CRYPTO_ECB
+   select CRYPTO_CTR
+   select CRYPTO_XTS
+   help
+ Say 'Y' to enable a driver for the Arm TrustZone CryptoCell
+ family of processors. Currently only the CryptoCell 712 REE
+ is supported.
+ Choose this if you wish to use hardware acceleration of
+ cryptographic operations on the system REE.
+ If unsure say Y.
+
 endif # CRYPTO_HW
diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile
index 2513d13..ee5ec5c9 100644
--- a/drivers/crypto/Makefile
+++ b/drivers/crypto/Makefile
@@ -6,6 +6,7 @@ obj-$(CONFIG_CRYPTO_DEV_ATMEL_ECC) += atmel-ecc.o
 obj-$(CONFIG_CRYPTO_DEV_BFIN_CRC) += bfin_crc.o
 obj-$(CONFIG_CRYPTO_DEV_CAVIUM_ZIP) += cavium/
 obj-$(CONFIG_CRYPTO_DEV_CCP) += ccp/
+obj-$(CONFIG_CRYPTO_DEV_CCREE) += ccree/
 obj-$(CONFIG_CRYPTO_DEV_CHELSIO) += chelsio/
 obj-$(CONFIG_CRYPTO_DEV_CPT) += cavium/cpt/
 obj-$(CONFIG_CRYPTO_DEV_NITROX) += cavium/nitrox/
diff --git a/drivers/crypto/ccree/Makefile b/drivers/crypto/ccree/Makefile
new file mode 100644
index 000..6b204ab
--- /dev/null
+++ b/drivers/crypto/ccree/Makefile
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0
+
+obj-$(CONFIG_CRYPTO_DEV_CCREE) := ccree.o
+ccree-y := cc_driver.o cc_buffer_mgr.o cc_request_mgr.o cc_ivgen.o 
cc_sram_mgr.o
+ccree-$(CONFIG_DEBUG_FS) += cc_debugfs.o
+ccree-$(CONFIG_PM) += cc_pm.o
diff --git a/drivers/crypto/ccree/cc_buffer_mgr.c 
b/drivers/crypto/ccree/cc_buffer_mgr.c
new file mode 100644
index 000..4c67579
--- /dev/null
+++ 

[PATCH 4/7] crypto: ccree: add ahash support

2018-01-11 Thread Gilad Ben-Yossef
Add CryptoCell async. hash and HMAC support.

Signed-off-by: Gilad Ben-Yossef 
---
 drivers/crypto/ccree/Makefile|2 +-
 drivers/crypto/ccree/cc_buffer_mgr.c |  257 
 drivers/crypto/ccree/cc_driver.c |   13 +
 drivers/crypto/ccree/cc_driver.h |1 +
 drivers/crypto/ccree/cc_hash.c   | 2297 ++
 drivers/crypto/ccree/cc_hash.h   |  114 ++
 drivers/crypto/ccree/cc_pm.c |4 +
 7 files changed, 2687 insertions(+), 1 deletion(-)
 create mode 100644 drivers/crypto/ccree/cc_hash.c
 create mode 100644 drivers/crypto/ccree/cc_hash.h

diff --git a/drivers/crypto/ccree/Makefile b/drivers/crypto/ccree/Makefile
index a7fecad..1109480 100644
--- a/drivers/crypto/ccree/Makefile
+++ b/drivers/crypto/ccree/Makefile
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 
 obj-$(CONFIG_CRYPTO_DEV_CCREE) := ccree.o
-ccree-y := cc_driver.o cc_buffer_mgr.o cc_request_mgr.o cc_cipher.o cc_ivgen.o 
cc_sram_mgr.o
+ccree-y := cc_driver.o cc_buffer_mgr.o cc_request_mgr.o cc_cipher.o cc_hash.o 
cc_ivgen.o cc_sram_mgr.o
 ccree-$(CONFIG_DEBUG_FS) += cc_debugfs.o
 ccree-$(CONFIG_PM) += cc_pm.o
diff --git a/drivers/crypto/ccree/cc_buffer_mgr.c 
b/drivers/crypto/ccree/cc_buffer_mgr.c
index 510993e..1ff379b 100644
--- a/drivers/crypto/ccree/cc_buffer_mgr.c
+++ b/drivers/crypto/ccree/cc_buffer_mgr.c
@@ -9,6 +9,7 @@
 #include "cc_buffer_mgr.h"
 #include "cc_lli_defs.h"
 #include "cc_cipher.h"
+#include "cc_hash.h"
 
 enum dma_buffer_type {
DMA_NULL_TYPE = -1,
@@ -348,6 +349,30 @@ static int cc_map_sg(struct device *dev, struct 
scatterlist *sg,
return 0;
 }
 
+static int cc_set_hash_buf(struct device *dev, struct ahash_req_ctx *areq_ctx,
+  u8 *curr_buff, u32 curr_buff_cnt,
+  struct buffer_array *sg_data)
+{
+   dev_dbg(dev, " handle curr buff %x set to   DLLI\n", curr_buff_cnt);
+   /* create sg for the current buffer */
+   sg_init_one(areq_ctx->buff_sg, curr_buff, curr_buff_cnt);
+   if (dma_map_sg(dev, areq_ctx->buff_sg, 1, DMA_TO_DEVICE) != 1) {
+   dev_err(dev, "dma_map_sg() src buffer failed\n");
+   return -ENOMEM;
+   }
+   dev_dbg(dev, "Mapped curr_buff: dma_address=%pad page=%p addr=%pK 
offset=%u length=%u\n",
+   _dma_address(areq_ctx->buff_sg), sg_page(areq_ctx->buff_sg),
+   sg_virt(areq_ctx->buff_sg), areq_ctx->buff_sg->offset,
+   areq_ctx->buff_sg->length);
+   areq_ctx->data_dma_buf_type = CC_DMA_BUF_DLLI;
+   areq_ctx->curr_sg = areq_ctx->buff_sg;
+   areq_ctx->in_nents = 0;
+   /* prepare for case of MLLI */
+   cc_add_sg_entry(dev, sg_data, 1, areq_ctx->buff_sg, curr_buff_cnt, 0,
+   false, NULL);
+   return 0;
+}
+
 void cc_unmap_blkcipher_request(struct device *dev, void *ctx,
unsigned int ivsize, struct scatterlist *src,
struct scatterlist *dst)
@@ -472,6 +497,238 @@ int cc_map_blkcipher_request(struct cc_drvdata *drvdata, 
void *ctx,
return rc;
 }
 
+int cc_map_hash_request_final(struct cc_drvdata *drvdata, void *ctx,
+ struct scatterlist *src, unsigned int nbytes,
+ bool do_update, gfp_t flags)
+{
+   struct ahash_req_ctx *areq_ctx = (struct ahash_req_ctx *)ctx;
+   struct device *dev = drvdata_to_dev(drvdata);
+   u8 *curr_buff = cc_hash_buf(areq_ctx);
+   u32 *curr_buff_cnt = cc_hash_buf_cnt(areq_ctx);
+   struct mlli_params *mlli_params = _ctx->mlli_params;
+   struct buffer_array sg_data;
+   struct buff_mgr_handle *buff_mgr = drvdata->buff_mgr_handle;
+   u32 dummy = 0;
+   u32 mapped_nents = 0;
+
+   dev_dbg(dev, "final params : curr_buff=%pK curr_buff_cnt=0x%X nbytes = 
0x%X src=%pK curr_index=%u\n",
+   curr_buff, *curr_buff_cnt, nbytes, src, areq_ctx->buff_index);
+   /* Init the type of the dma buffer */
+   areq_ctx->data_dma_buf_type = CC_DMA_BUF_NULL;
+   mlli_params->curr_pool = NULL;
+   sg_data.num_of_buffers = 0;
+   areq_ctx->in_nents = 0;
+
+   if (nbytes == 0 && *curr_buff_cnt == 0) {
+   /* nothing to do */
+   return 0;
+   }
+
+   /*TODO: copy data in case that buffer is enough for operation */
+   /* map the previous buffer */
+   if (*curr_buff_cnt) {
+   if (cc_set_hash_buf(dev, areq_ctx, curr_buff, *curr_buff_cnt,
+   _data)) {
+   return -ENOMEM;
+   }
+   }
+
+   if (src && nbytes > 0 && do_update) {
+   if (cc_map_sg(dev, src, nbytes, DMA_TO_DEVICE,
+ _ctx->in_nents, LLI_MAX_NUM_OF_DATA_ENTRIES,
+ , _nents)) {
+   goto unmap_curr_buff;
+   }
+   if (src && mapped_nents == 

[PATCH 3/7] crypto: ccree: add ablkcipher support

2018-01-11 Thread Gilad Ben-Yossef
Add CryptoCell ablkcipher support

Signed-off-by: Gilad Ben-Yossef 
---
 drivers/crypto/ccree/Makefile|2 +-
 drivers/crypto/ccree/cc_buffer_mgr.c |  125 
 drivers/crypto/ccree/cc_buffer_mgr.h |   10 +
 drivers/crypto/ccree/cc_cipher.c | 1167 ++
 drivers/crypto/ccree/cc_cipher.h |   74 +++
 drivers/crypto/ccree/cc_driver.c |   11 +
 drivers/crypto/ccree/cc_driver.h |2 +
 7 files changed, 1390 insertions(+), 1 deletion(-)
 create mode 100644 drivers/crypto/ccree/cc_cipher.c
 create mode 100644 drivers/crypto/ccree/cc_cipher.h

diff --git a/drivers/crypto/ccree/Makefile b/drivers/crypto/ccree/Makefile
index 6b204ab..a7fecad 100644
--- a/drivers/crypto/ccree/Makefile
+++ b/drivers/crypto/ccree/Makefile
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 
 obj-$(CONFIG_CRYPTO_DEV_CCREE) := ccree.o
-ccree-y := cc_driver.o cc_buffer_mgr.o cc_request_mgr.o cc_ivgen.o 
cc_sram_mgr.o
+ccree-y := cc_driver.o cc_buffer_mgr.o cc_request_mgr.o cc_cipher.o cc_ivgen.o 
cc_sram_mgr.o
 ccree-$(CONFIG_DEBUG_FS) += cc_debugfs.o
 ccree-$(CONFIG_PM) += cc_pm.o
diff --git a/drivers/crypto/ccree/cc_buffer_mgr.c 
b/drivers/crypto/ccree/cc_buffer_mgr.c
index 4c67579..510993e 100644
--- a/drivers/crypto/ccree/cc_buffer_mgr.c
+++ b/drivers/crypto/ccree/cc_buffer_mgr.c
@@ -8,6 +8,7 @@
 
 #include "cc_buffer_mgr.h"
 #include "cc_lli_defs.h"
+#include "cc_cipher.h"
 
 enum dma_buffer_type {
DMA_NULL_TYPE = -1,
@@ -347,6 +348,130 @@ static int cc_map_sg(struct device *dev, struct 
scatterlist *sg,
return 0;
 }
 
+void cc_unmap_blkcipher_request(struct device *dev, void *ctx,
+   unsigned int ivsize, struct scatterlist *src,
+   struct scatterlist *dst)
+{
+   struct blkcipher_req_ctx *req_ctx = (struct blkcipher_req_ctx *)ctx;
+
+   if (req_ctx->gen_ctx.iv_dma_addr) {
+   dev_dbg(dev, "Unmapped iv: iv_dma_addr=%pad iv_size=%u\n",
+   _ctx->gen_ctx.iv_dma_addr, ivsize);
+   dma_unmap_single(dev, req_ctx->gen_ctx.iv_dma_addr,
+ivsize,
+req_ctx->is_giv ? DMA_BIDIRECTIONAL :
+DMA_TO_DEVICE);
+   }
+   /* Release pool */
+   if (req_ctx->dma_buf_type == CC_DMA_BUF_MLLI &&
+   req_ctx->mlli_params.mlli_virt_addr) {
+   dma_pool_free(req_ctx->mlli_params.curr_pool,
+ req_ctx->mlli_params.mlli_virt_addr,
+ req_ctx->mlli_params.mlli_dma_addr);
+   }
+
+   dma_unmap_sg(dev, src, req_ctx->in_nents, DMA_BIDIRECTIONAL);
+   dev_dbg(dev, "Unmapped req->src=%pK\n", sg_virt(src));
+
+   if (src != dst) {
+   dma_unmap_sg(dev, dst, req_ctx->out_nents, DMA_BIDIRECTIONAL);
+   dev_dbg(dev, "Unmapped req->dst=%pK\n", sg_virt(dst));
+   }
+}
+
+int cc_map_blkcipher_request(struct cc_drvdata *drvdata, void *ctx,
+unsigned int ivsize, unsigned int nbytes,
+void *info, struct scatterlist *src,
+struct scatterlist *dst, gfp_t flags)
+{
+   struct blkcipher_req_ctx *req_ctx = (struct blkcipher_req_ctx *)ctx;
+   struct mlli_params *mlli_params = _ctx->mlli_params;
+   struct buff_mgr_handle *buff_mgr = drvdata->buff_mgr_handle;
+   struct device *dev = drvdata_to_dev(drvdata);
+   struct buffer_array sg_data;
+   u32 dummy = 0;
+   int rc = 0;
+   u32 mapped_nents = 0;
+
+   req_ctx->dma_buf_type = CC_DMA_BUF_DLLI;
+   mlli_params->curr_pool = NULL;
+   sg_data.num_of_buffers = 0;
+
+   /* Map IV buffer */
+   if (ivsize) {
+   dump_byte_array("iv", (u8 *)info, ivsize);
+   req_ctx->gen_ctx.iv_dma_addr =
+   dma_map_single(dev, (void *)info,
+  ivsize,
+  req_ctx->is_giv ? DMA_BIDIRECTIONAL :
+  DMA_TO_DEVICE);
+   if (dma_mapping_error(dev, req_ctx->gen_ctx.iv_dma_addr)) {
+   dev_err(dev, "Mapping iv %u B at va=%pK for DMA 
failed\n",
+   ivsize, info);
+   return -ENOMEM;
+   }
+   dev_dbg(dev, "Mapped iv %u B at va=%pK to dma=%pad\n",
+   ivsize, info, _ctx->gen_ctx.iv_dma_addr);
+   } else {
+   req_ctx->gen_ctx.iv_dma_addr = 0;
+   }
+
+   /* Map the src SGL */
+   rc = cc_map_sg(dev, src, nbytes, DMA_BIDIRECTIONAL, _ctx->in_nents,
+  LLI_MAX_NUM_OF_DATA_ENTRIES, , _nents);
+   if (rc) {
+   rc = -ENOMEM;
+   goto ablkcipher_exit;
+   }
+   if (mapped_nents > 1)
+   req_ctx->dma_buf_type = CC_DMA_BUF_MLLI;
+
+   if (src 

[PATCH 1/7] staging: ccree: remove ccree from staging tree

2018-01-11 Thread Gilad Ben-Yossef
Remove the ccree driver from the staging tree in preparation to
introducing it in the crypto tree.

Signed-off-by: Gilad Ben-Yossef 
---
 drivers/staging/Kconfig|2 -
 drivers/staging/Makefile   |1 -
 .../devicetree/bindings/crypto/arm-cryptocell.txt  |   27 -
 drivers/staging/ccree/Kconfig  |   25 -
 drivers/staging/ccree/Makefile |3 -
 drivers/staging/ccree/TODO |   30 -
 drivers/staging/ccree/cc_crypto_ctx.h  |  200 --
 drivers/staging/ccree/cc_hw_queue_defs.h   |  594 -
 drivers/staging/ccree/cc_lli_defs.h|   72 -
 drivers/staging/ccree/dx_crys_kernel.h |  180 --
 drivers/staging/ccree/dx_host.h|  155 --
 drivers/staging/ccree/dx_reg_common.h  |   26 -
 drivers/staging/ccree/hash_defs.h  |   36 -
 drivers/staging/ccree/ssi_aead.c   | 2794 
 drivers/staging/ccree/ssi_aead.h   |  117 -
 drivers/staging/ccree/ssi_buffer_mgr.c | 1776 -
 drivers/staging/ccree/ssi_buffer_mgr.h |   91 -
 drivers/staging/ccree/ssi_cipher.c | 1357 --
 drivers/staging/ccree/ssi_cipher.h |   84 -
 drivers/staging/ccree/ssi_config.h |   36 -
 drivers/staging/ccree/ssi_driver.c |  538 
 drivers/staging/ccree/ssi_driver.h |  206 --
 drivers/staging/ccree/ssi_fips.c   |  126 -
 drivers/staging/ccree/ssi_fips.h   |   49 -
 drivers/staging/ccree/ssi_hash.c   | 2549 --
 drivers/staging/ccree/ssi_hash.h   |  103 -
 drivers/staging/ccree/ssi_ivgen.c  |  299 ---
 drivers/staging/ccree/ssi_ivgen.h  |   71 -
 drivers/staging/ccree/ssi_pm.c |  145 -
 drivers/staging/ccree/ssi_pm.h |   43 -
 drivers/staging/ccree/ssi_request_mgr.c|  610 -
 drivers/staging/ccree/ssi_request_mgr.h|   60 -
 drivers/staging/ccree/ssi_sram_mgr.c   |  123 -
 drivers/staging/ccree/ssi_sram_mgr.h   |   79 -
 drivers/staging/ccree/ssi_sysfs.c  |  172 --
 drivers/staging/ccree/ssi_sysfs.h  |   55 -
 36 files changed, 12834 deletions(-)
 delete mode 100644 
drivers/staging/ccree/Documentation/devicetree/bindings/crypto/arm-cryptocell.txt
 delete mode 100644 drivers/staging/ccree/Kconfig
 delete mode 100644 drivers/staging/ccree/Makefile
 delete mode 100644 drivers/staging/ccree/TODO
 delete mode 100644 drivers/staging/ccree/cc_crypto_ctx.h
 delete mode 100644 drivers/staging/ccree/cc_hw_queue_defs.h
 delete mode 100644 drivers/staging/ccree/cc_lli_defs.h
 delete mode 100644 drivers/staging/ccree/dx_crys_kernel.h
 delete mode 100644 drivers/staging/ccree/dx_host.h
 delete mode 100644 drivers/staging/ccree/dx_reg_common.h
 delete mode 100644 drivers/staging/ccree/hash_defs.h
 delete mode 100644 drivers/staging/ccree/ssi_aead.c
 delete mode 100644 drivers/staging/ccree/ssi_aead.h
 delete mode 100644 drivers/staging/ccree/ssi_buffer_mgr.c
 delete mode 100644 drivers/staging/ccree/ssi_buffer_mgr.h
 delete mode 100644 drivers/staging/ccree/ssi_cipher.c
 delete mode 100644 drivers/staging/ccree/ssi_cipher.h
 delete mode 100644 drivers/staging/ccree/ssi_config.h
 delete mode 100644 drivers/staging/ccree/ssi_driver.c
 delete mode 100644 drivers/staging/ccree/ssi_driver.h
 delete mode 100644 drivers/staging/ccree/ssi_fips.c
 delete mode 100644 drivers/staging/ccree/ssi_fips.h
 delete mode 100644 drivers/staging/ccree/ssi_hash.c
 delete mode 100644 drivers/staging/ccree/ssi_hash.h
 delete mode 100644 drivers/staging/ccree/ssi_ivgen.c
 delete mode 100644 drivers/staging/ccree/ssi_ivgen.h
 delete mode 100644 drivers/staging/ccree/ssi_pm.c
 delete mode 100644 drivers/staging/ccree/ssi_pm.h
 delete mode 100644 drivers/staging/ccree/ssi_request_mgr.c
 delete mode 100644 drivers/staging/ccree/ssi_request_mgr.h
 delete mode 100644 drivers/staging/ccree/ssi_sram_mgr.c
 delete mode 100644 drivers/staging/ccree/ssi_sram_mgr.h
 delete mode 100644 drivers/staging/ccree/ssi_sysfs.c
 delete mode 100644 drivers/staging/ccree/ssi_sysfs.h

diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index 5546839..72946bf 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -110,8 +110,6 @@ source "drivers/staging/greybus/Kconfig"
 
 source "drivers/staging/vc04_services/Kconfig"
 
-source "drivers/staging/ccree/Kconfig"
-
 source "drivers/staging/typec/Kconfig"
 
 source "drivers/staging/vboxvideo/Kconfig"
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 6e53602..7612bee 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -47,6 +47,5 @@ obj-$(CONFIG_MOST)+= most/
 

[PATCH 0/7] Introduce Arm TrustZone CryptoCell

2018-01-11 Thread Gilad Ben-Yossef
Arm TrustZone CryptoCell is a security hardware IP that
includes support for hardware based hash, digest, cipher
and AEAD operations. This driver provides support for
these as part of the Linux Crypto sub-system.

The driver spent some time now in the staging tree being
cleaned up and is now submitted for review for the
purpose of moving into the crypto tree. The first patch
therefore delete it's copy in the staging directory
otherwise there is a build failure due to collisions
with it's other copy there.

Please note that the driver include some stubs for yet
unexposed functionality (ivgen and secure HW keys).

Signed-off-by: Gilad Ben-Yossef 

Gilad Ben-Yossef (7):
  staging: ccree: remove ccree from staging tree
  crypto: ccree: introduce CryptoCell driver
  crypto: ccree: add ablkcipher support
  crypto: ccree: add ahash support
  crypto: ccree: add AEAD support
  crypto: ccree: add FIPS support
  MAINTAINERS: update ccree entry

 MAINTAINERS|5 +-
 drivers/crypto/Kconfig |   27 +
 drivers/crypto/Makefile|1 +
 drivers/crypto/ccree/Makefile  |7 +
 .../ccree/ssi_aead.c => crypto/ccree/cc_aead.c}| 1120 ++--
 .../ccree/ssi_aead.h => crypto/ccree/cc_aead.h}|   56 +-
 .../ccree/cc_buffer_mgr.c} | 1085 ++--
 drivers/crypto/ccree/cc_buffer_mgr.h   |   74 +
 .../ssi_cipher.c => crypto/ccree/cc_cipher.c}  |  716 +++-
 drivers/crypto/ccree/cc_cipher.h   |   74 +
 drivers/{staging => crypto}/ccree/cc_crypto_ctx.h  |   38 +-
 drivers/crypto/ccree/cc_debugfs.c  |  101 ++
 drivers/crypto/ccree/cc_debugfs.h  |   32 +
 drivers/crypto/ccree/cc_driver.c   |  477 +
 drivers/crypto/ccree/cc_driver.h   |  194 +++
 .../ccree/ssi_fips.c => crypto/ccree/cc_fips.c}|   44 +-
 drivers/crypto/ccree/cc_fips.h |   37 +
 .../ccree/ssi_hash.c => crypto/ccree/cc_hash.c}| 1818 +---
 drivers/crypto/ccree/cc_hash.h |  114 ++
 drivers/crypto/ccree/cc_host_regs.h|  142 ++
 .../{staging => crypto}/ccree/cc_hw_queue_defs.h   |   40 +-
 .../ccree/ssi_ivgen.c => crypto/ccree/cc_ivgen.c}  |  141 +-
 drivers/crypto/ccree/cc_ivgen.h|   55 +
 drivers/crypto/ccree/cc_kernel_regs.h  |  167 ++
 drivers/{staging => crypto}/ccree/cc_lli_defs.h|   19 +-
 drivers/crypto/ccree/cc_pm.c   |  123 ++
 drivers/crypto/ccree/cc_pm.h   |   57 +
 drivers/crypto/ccree/cc_request_mgr.c  |  714 
 drivers/crypto/ccree/cc_request_mgr.h  |   51 +
 .../ssi_sram_mgr.c => crypto/ccree/cc_sram_mgr.c}  |   70 +-
 drivers/crypto/ccree/cc_sram_mgr.h |   65 +
 drivers/staging/Kconfig|2 -
 drivers/staging/Makefile   |1 -
 .../devicetree/bindings/crypto/arm-cryptocell.txt  |   27 -
 drivers/staging/ccree/Kconfig  |   25 -
 drivers/staging/ccree/Makefile |3 -
 drivers/staging/ccree/TODO |   30 -
 drivers/staging/ccree/dx_crys_kernel.h |  180 --
 drivers/staging/ccree/dx_host.h|  155 --
 drivers/staging/ccree/dx_reg_common.h  |   26 -
 drivers/staging/ccree/hash_defs.h  |   36 -
 drivers/staging/ccree/ssi_buffer_mgr.h |   91 -
 drivers/staging/ccree/ssi_cipher.h |   84 -
 drivers/staging/ccree/ssi_config.h |   36 -
 drivers/staging/ccree/ssi_driver.c |  538 --
 drivers/staging/ccree/ssi_driver.h |  206 ---
 drivers/staging/ccree/ssi_fips.h   |   49 -
 drivers/staging/ccree/ssi_hash.h   |  103 --
 drivers/staging/ccree/ssi_ivgen.h  |   71 -
 drivers/staging/ccree/ssi_pm.c |  145 --
 drivers/staging/ccree/ssi_pm.h |   43 -
 drivers/staging/ccree/ssi_request_mgr.c|  610 ---
 drivers/staging/ccree/ssi_request_mgr.h|   60 -
 drivers/staging/ccree/ssi_sram_mgr.h   |   79 -
 drivers/staging/ccree/ssi_sysfs.c  |  172 --
 drivers/staging/ccree/ssi_sysfs.h  |   55 -
 56 files changed, 4706 insertions(+), 5785 deletions(-)
 create mode 100644 drivers/crypto/ccree/Makefile
 rename drivers/{staging/ccree/ssi_aead.c => crypto/ccree/cc_aead.c} (70%)
 rename drivers/{staging/ccree/ssi_aead.h => crypto/ccree/cc_aead.h} (64%)
 rename drivers/{staging/ccree/ssi_buffer_mgr.c => 
crypto/ccree/cc_buffer_mgr.c} (56%)
 create mode 100644 drivers/crypto/ccree/cc_buffer_mgr.h
 rename drivers/{staging/ccree/ssi_cipher.c => crypto/ccree/cc_cipher.c} (58%)
 create mode 100644 

Re: Getting the ccree driver out of staging

2018-01-11 Thread Dan Carpenter
Here are my remaining Smatch warnings:

drivers/staging/ccree/cc_driver.c:219 init_cc_resources()
error: '%pa' can only be followed by one of [dp]

drivers/staging/ccree/cc_driver.c
   217  
   218  if (rc) {
   219  dev_err(dev, "Failed in dma_set_mask, mask=%par\n",
  ^
This 'r' is is treated as a 'p'.  Not sure what was intended.

   220  _mask);
   221  return rc;
   222  }
   223  


drivers/staging/ccree/cc_buffer_mgr.c:1067 cc_aead_chain_data()
warn: inconsistent indenting

drivers/staging/ccree/cc_buffer_mgr.c
  1064  if (src_mapped_nents > LLI_MAX_NUM_OF_DATA_ENTRIES) {
  1065  dev_err(dev, "Too many fragments. current %d max %d\n",
  1066  src_mapped_nents, LLI_MAX_NUM_OF_DATA_ENTRIES);
  1067  return -ENOMEM;
^^
  1068  }

drivers/staging/ccree/cc_cipher.c:373 cc_cipher_setkey()
warn: inconsistent indenting

drivers/staging/ccree/cc_cipher.c
   369  dma_sync_single_for_device(dev, ctx_p->user.key_dma_addr,
   370 max_key_buf_size, DMA_TO_DEVICE);
   371  ctx_p->keylen = keylen;
   372  
   373   dev_dbg(dev, "return safely");
^
One extra space.

   374  return 0;
   375  }

regards,
dan carpenter

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


[PATCH v5 0/2] staging: ccree: fixed sparse pointer signedness warnings.

2018-01-11 Thread Jeremy Sowden
The driver uses a mixture of signed and unsigned integer variables for
holding arrays lengths and indices, which gives rise to sparse warnings
when the addresses of signed variables are passed to functions expecting
pointers to unsigned integers.  This patch-set fixes those warnings by
converting those signed variables to unsigned.

In v5:

 * White-space errors fixed.

In v4:

 * Split the removal of the hard-coded index values into a separate
   patch.

In v3:

 * removed hard-coded index values.
 * more detailed change-log.
 * fixed formatting.

In v2:

 * more detailed change-log.

Jeremy Sowden (2):
  staging: ccree: removed some hard-coded array indices.
  staging: ccree: fixed sparse pointer signedness warnings.

 drivers/staging/ccree/cc_aead.c   | 61 ---
 drivers/staging/ccree/cc_buffer_mgr.c |  2 +-
 drivers/staging/ccree/cc_cipher.c |  3 +-
 drivers/staging/ccree/cc_hash.c   | 17 +-
 4 files changed, 47 insertions(+), 36 deletions(-)


base-commit: a66a4e8e01f3b607a9aa5b5ed9ca588b4c3a962e
-- 
2.15.1

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


[PATCH v5 1/2] staging: ccree: removed some hard-coded array indices.

2018-01-11 Thread Jeremy Sowden
Replaced hard-coded indices used during initialization of array elements
with a variable which is incremented once initialization of each element
is complete.

Signed-off-by: Jeremy Sowden 
---
 drivers/staging/ccree/cc_aead.c | 48 +++--
 1 file changed, 27 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/ccree/cc_aead.c b/drivers/staging/ccree/cc_aead.c
index 265adffdab41..c29a509041e8 100644
--- a/drivers/staging/ccree/cc_aead.c
+++ b/drivers/staging/ccree/cc_aead.c
@@ -259,42 +259,48 @@ static void cc_aead_complete(struct device *dev, void 
*cc_req, int err)
 
 static int xcbc_setkey(struct cc_hw_desc *desc, struct cc_aead_ctx *ctx)
 {
+   int idx = 0;
+
/* Load the AES key */
-   hw_desc_init([0]);
+   hw_desc_init([idx]);
/* We are using for the source/user key the same buffer
 * as for the output keys, * because after this key loading it
 * is not needed anymore
 */
-   set_din_type([0], DMA_DLLI,
+   set_din_type([idx], DMA_DLLI,
 ctx->auth_state.xcbc.xcbc_keys_dma_addr, ctx->auth_keylen,
 NS_BIT);
-   set_cipher_mode([0], DRV_CIPHER_ECB);
-   set_cipher_config0([0], DRV_CRYPTO_DIRECTION_ENCRYPT);
-   set_key_size_aes([0], ctx->auth_keylen);
-   set_flow_mode([0], S_DIN_to_AES);
-   set_setup_mode([0], SETUP_LOAD_KEY0);
-
-   hw_desc_init([1]);
-   set_din_const([1], 0x01010101, CC_AES_128_BIT_KEY_SIZE);
-   set_flow_mode([1], DIN_AES_DOUT);
-   set_dout_dlli([1], ctx->auth_state.xcbc.xcbc_keys_dma_addr,
+   set_cipher_mode([idx], DRV_CIPHER_ECB);
+   set_cipher_config0([idx], DRV_CRYPTO_DIRECTION_ENCRYPT);
+   set_key_size_aes([idx], ctx->auth_keylen);
+   set_flow_mode([idx], S_DIN_to_AES);
+   set_setup_mode([idx], SETUP_LOAD_KEY0);
+   idx++;
+
+   hw_desc_init([idx]);
+   set_din_const([idx], 0x01010101, CC_AES_128_BIT_KEY_SIZE);
+   set_flow_mode([idx], DIN_AES_DOUT);
+   set_dout_dlli([idx], ctx->auth_state.xcbc.xcbc_keys_dma_addr,
  AES_KEYSIZE_128, NS_BIT, 0);
+   idx++;
 
-   hw_desc_init([2]);
-   set_din_const([2], 0x02020202, CC_AES_128_BIT_KEY_SIZE);
-   set_flow_mode([2], DIN_AES_DOUT);
-   set_dout_dlli([2], (ctx->auth_state.xcbc.xcbc_keys_dma_addr
+   hw_desc_init([idx]);
+   set_din_const([idx], 0x02020202, CC_AES_128_BIT_KEY_SIZE);
+   set_flow_mode([idx], DIN_AES_DOUT);
+   set_dout_dlli([idx], (ctx->auth_state.xcbc.xcbc_keys_dma_addr
 + AES_KEYSIZE_128),
  AES_KEYSIZE_128, NS_BIT, 0);
+   idx++;
 
-   hw_desc_init([3]);
-   set_din_const([3], 0x03030303, CC_AES_128_BIT_KEY_SIZE);
-   set_flow_mode([3], DIN_AES_DOUT);
-   set_dout_dlli([3], (ctx->auth_state.xcbc.xcbc_keys_dma_addr
+   hw_desc_init([idx]);
+   set_din_const([idx], 0x03030303, CC_AES_128_BIT_KEY_SIZE);
+   set_flow_mode([idx], DIN_AES_DOUT);
+   set_dout_dlli([idx], (ctx->auth_state.xcbc.xcbc_keys_dma_addr
  + 2 * AES_KEYSIZE_128),
  AES_KEYSIZE_128, NS_BIT, 0);
+   idx++;
 
-   return 4;
+   return idx;
 }
 
 static int hmac_setkey(struct cc_hw_desc *desc, struct cc_aead_ctx *ctx)

base-commit: a66a4e8e01f3b607a9aa5b5ed9ca588b4c3a962e
-- 
2.15.1

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


[PATCH v5 2/2] staging: ccree: fixed pointer signedness warnings.

2018-01-11 Thread Jeremy Sowden
This patch fixes sparse warnings arising when the addresses of signed
variables are passed to functions expecting pointers to unsigned
integers by converting those signed variables to unsigned as follows:

  * changed the types of a number of index and length variables from
signed to unsigned integer types.

  * changed the return-types of a couple of functions that return length
values which are assigned to one of these variables from signed to
unsigned integer types.

Signed-off-by: Jeremy Sowden 
---
 drivers/staging/ccree/cc_aead.c   | 15 +--
 drivers/staging/ccree/cc_buffer_mgr.c |  2 +-
 drivers/staging/ccree/cc_cipher.c |  3 ++-
 drivers/staging/ccree/cc_hash.c   | 17 +
 4 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/ccree/cc_aead.c b/drivers/staging/ccree/cc_aead.c
index c29a509041e8..c2d813a6ffda 100644
--- a/drivers/staging/ccree/cc_aead.c
+++ b/drivers/staging/ccree/cc_aead.c
@@ -257,9 +257,10 @@ static void cc_aead_complete(struct device *dev, void 
*cc_req, int err)
aead_request_complete(areq, err);
 }
 
-static int xcbc_setkey(struct cc_hw_desc *desc, struct cc_aead_ctx *ctx)
+static unsigned int xcbc_setkey(struct cc_hw_desc *desc,
+   struct cc_aead_ctx *ctx)
 {
-   int idx = 0;
+   unsigned int idx = 0;
 
/* Load the AES key */
hw_desc_init([idx]);
@@ -303,7 +304,8 @@ static int xcbc_setkey(struct cc_hw_desc *desc, struct 
cc_aead_ctx *ctx)
return idx;
 }
 
-static int hmac_setkey(struct cc_hw_desc *desc, struct cc_aead_ctx *ctx)
+static unsigned int hmac_setkey(struct cc_hw_desc *desc,
+   struct cc_aead_ctx *ctx)
 {
unsigned int hmac_pad_const[2] = { HMAC_IPAD_CONST, HMAC_OPAD_CONST };
unsigned int digest_ofs = 0;
@@ -313,7 +315,7 @@ static int hmac_setkey(struct cc_hw_desc *desc, struct 
cc_aead_ctx *ctx)
CC_SHA1_DIGEST_SIZE : CC_SHA256_DIGEST_SIZE;
struct cc_hmac_s *hmac = >auth_state.hmac;
 
-   int idx = 0;
+   unsigned int idx = 0;
int i;
 
/* calc derived HMAC key */
@@ -550,7 +552,8 @@ cc_aead_setkey(struct crypto_aead *tfm, const u8 *key, 
unsigned int keylen)
struct cc_crypto_req cc_req = {};
struct crypto_authenc_key_param *param;
struct cc_hw_desc desc[MAX_AEAD_SETKEY_SEQ];
-   int seq_len = 0, rc = -EINVAL;
+   unsigned int seq_len = 0;
+   int rc = -EINVAL;
struct device *dev = drvdata_to_dev(ctx->drvdata);
 
dev_dbg(dev, "Setting key in context @%p for %s. key=%p keylen=%u\n",
@@ -1889,7 +1892,7 @@ static int cc_proc_aead(struct aead_request *req,
enum drv_crypto_direction direct)
 {
int rc = 0;
-   int seq_len = 0;
+   unsigned int seq_len = 0;
struct cc_hw_desc desc[MAX_AEAD_PROCESS_SEQ];
struct crypto_aead *tfm = crypto_aead_reqtfm(req);
struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm);
diff --git a/drivers/staging/ccree/cc_buffer_mgr.c 
b/drivers/staging/ccree/cc_buffer_mgr.c
index 14b2eabbf70a..6dbc9b4d6eb8 100644
--- a/drivers/staging/ccree/cc_buffer_mgr.c
+++ b/drivers/staging/ccree/cc_buffer_mgr.c
@@ -1018,7 +1018,7 @@ static int cc_aead_chain_data(struct cc_drvdata *drvdata,
struct device *dev = drvdata_to_dev(drvdata);
enum drv_crypto_direction direct = areq_ctx->gen_ctx.op_type;
unsigned int authsize = areq_ctx->req_authsize;
-   int src_last_bytes = 0, dst_last_bytes = 0;
+   u32 src_last_bytes = 0, dst_last_bytes = 0;
int rc = 0;
u32 src_mapped_nents = 0, dst_mapped_nents = 0;
u32 offset = 0;
diff --git a/drivers/staging/ccree/cc_cipher.c 
b/drivers/staging/ccree/cc_cipher.c
index 8afdbc120b13..56a8064e7519 100644
--- a/drivers/staging/ccree/cc_cipher.c
+++ b/drivers/staging/ccree/cc_cipher.c
@@ -633,7 +633,8 @@ static int cc_cipher_process(struct ablkcipher_request *req,
struct device *dev = drvdata_to_dev(ctx_p->drvdata);
struct cc_hw_desc desc[MAX_ABLKCIPHER_SEQ_LEN];
struct cc_crypto_req cc_req = {};
-   int rc, seq_len = 0, cts_restore_flag = 0;
+   int rc, cts_restore_flag = 0;
+   unsigned int seq_len = 0;
gfp_t flags = cc_gfp_flags(>base);
 
dev_dbg(dev, "%s req=%p info=%p nbytes=%d\n",
diff --git a/drivers/staging/ccree/cc_hash.c b/drivers/staging/ccree/cc_hash.c
index 86f9ec711edc..24692e079abc 100644
--- a/drivers/staging/ccree/cc_hash.c
+++ b/drivers/staging/ccree/cc_hash.c
@@ -410,7 +410,7 @@ static int cc_hash_digest(struct ahash_request *req)
struct cc_hw_desc desc[CC_MAX_HASH_SEQ_LEN];
cc_sram_addr_t larval_digest_addr =
cc_larval_digest_addr(ctx->drvdata, ctx->hash_mode);
-   int idx = 0;
+   unsigned int idx = 0;
int rc = 0;
gfp_t flags = cc_gfp_flags(>base);
 
@@ -506,7 +506,7 @@ static int 

Re: [PATCH v4 2/2] staging: ccree: fixed sparse pointer signedness warnings.

2018-01-11 Thread Jeremy Sowden
On 2018-01-11, at 08:25:20 +0200, Gilad Ben-Yossef wrote:
> On Wed, Jan 10, 2018 at 3:33 PM, Jeremy Sowden  wrote:
> > This patch fixes sparse warnings arising when the addresses of signed
> > variables are passed to functions expecting pointers to unsigned
> > integers by converting those signed variables to unsigned as follows:
> >
> >   * changed the types of a number of index and length variables from
> > signed to unsigned integer types.
> >
> >   * changed the return-types of a couple of functions that return length
> > values which are assigned to one of these variables from signed to
> > unsigned integer types.
> >
> > Signed-off-by: Jeremy Sowden 
> > ---
>
> Please run scripts/checkpatch.pl on patches before submission.
> They have multiple coding style errors.

Apologies.  v3 was fine and I got complacent. :-/

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