Re: [PATCH 09/14] staging: wilc1000: rename pstrHostIFconnectAttr argument to avoid camelCase

2018-01-21 Thread Ajay Singh
On Fri, 19 Jan 2018 16:50:29 +0530
Claudiu Beznea - M18063  wrote:

> On 18.01.2018 15:17, Ajay Singh wrote:
> > fix "Avoid camelCase" issue found by checkpatch.pl script.
> > 
> > Signed-off-by: Ajay Singh 
> > ---
> >  drivers/staging/wilc1000/host_interface.c | 104 
> > ++
> >  1 file changed, 49 insertions(+), 55 deletions(-)
> > 
> > diff --git a/drivers/staging/wilc1000/host_interface.c 
> > b/drivers/staging/wilc1000/host_interface.c
> > index e3931bc..4ddd1a8 100644
> > --- a/drivers/staging/wilc1000/host_interface.c
> > +++ b/drivers/staging/wilc1000/host_interface.c
> > @@ -903,7 +903,7 @@ static s32 Handle_ScanDone(struct wilc_vif *vif,
> >  
> >  u8 wilc_connected_ssid[6] = {0};
> >  static s32 Handle_Connect(struct wilc_vif *vif,
> > - struct connect_attr *pstrHostIFconnectAttr)
> > + struct connect_attr *attr)
> >  {
> > s32 result = 0;
> > struct wid wid_list[8];
> > @@ -912,45 +912,41 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > struct join_bss_param *ptstrJoinBssParam;
> > struct host_if_drv *hif_drv = vif->hif_drv;
> >  
> > -   if (memcmp(pstrHostIFconnectAttr->bssid, wilc_connected_ssid, ETH_ALEN) 
> > == 0) {
> > +   if (memcmp(attr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
> > result = 0;
> > netdev_err(vif->ndev, "Discard connect request\n");
> > return result;
> > }
> >  
> > -   ptstrJoinBssParam = pstrHostIFconnectAttr->params;
> > +   ptstrJoinBssParam = attr->params;
> > if (!ptstrJoinBssParam) {
> > netdev_err(vif->ndev, "Required BSSID not found\n");
> > result = -ENOENT;
> > goto ERRORHANDLER;
> > }
> >  
> > -   if (pstrHostIFconnectAttr->bssid) {
> > +   if (attr->bssid) {
> > hif_drv->usr_conn_req.bssid = kmalloc(6, GFP_KERNEL);
> > -   memcpy(hif_drv->usr_conn_req.bssid, 
> > pstrHostIFconnectAttr->bssid, 6);
> > +   memcpy(hif_drv->usr_conn_req.bssid, attr->bssid, 6);
> > }
> >  
> > -   hif_drv->usr_conn_req.ssid_len = pstrHostIFconnectAttr->ssid_len;
> > -   if (pstrHostIFconnectAttr->ssid) {
> > -   hif_drv->usr_conn_req.ssid = 
> > kmalloc(pstrHostIFconnectAttr->ssid_len + 1, GFP_KERNEL);
> > -   memcpy(hif_drv->usr_conn_req.ssid,
> > -  pstrHostIFconnectAttr->ssid,
> > -  pstrHostIFconnectAttr->ssid_len);
> > -   hif_drv->usr_conn_req.ssid[pstrHostIFconnectAttr->ssid_len] = 
> > '\0';
> > +   hif_drv->usr_conn_req.ssid_len = attr->ssid_len;
> > +   if (attr->ssid) {
> > +   hif_drv->usr_conn_req.ssid = kmalloc(attr->ssid_len + 1, 
> > GFP_KERNEL);
> > +   memcpy(hif_drv->usr_conn_req.ssid, attr->ssid, attr->ssid_len);
> > +   hif_drv->usr_conn_req.ssid[attr->ssid_len] = '\0';
> > }
> >  
> > -   hif_drv->usr_conn_req.ies_len = pstrHostIFconnectAttr->ies_len;
> > -   if (pstrHostIFconnectAttr->ies) {
> > -   hif_drv->usr_conn_req.ies = 
> > kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
> > -   memcpy(hif_drv->usr_conn_req.ies,
> > -  pstrHostIFconnectAttr->ies,
> > -  pstrHostIFconnectAttr->ies_len);
> > +   hif_drv->usr_conn_req.ies_len = attr->ies_len;
> > +   if (attr->ies) {
> > +   hif_drv->usr_conn_req.ies = kmalloc(attr->ies_len, GFP_KERNEL);
> > +   memcpy(hif_drv->usr_conn_req.ies, attr->ies, attr->ies_len);
> > }
> >  
> > -   hif_drv->usr_conn_req.security = pstrHostIFconnectAttr->security;
> > -   hif_drv->usr_conn_req.auth_type = pstrHostIFconnectAttr->auth_type;
> > -   hif_drv->usr_conn_req.conn_result = pstrHostIFconnectAttr->result;
> > -   hif_drv->usr_conn_req.arg = pstrHostIFconnectAttr->arg;
> > +   hif_drv->usr_conn_req.security = attr->security;
> > +   hif_drv->usr_conn_req.auth_type = attr->auth_type;
> > +   hif_drv->usr_conn_req.conn_result = attr->result;
> > +   hif_drv->usr_conn_req.arg = attr->arg;
> >  
> > wid_list[wid_cnt].id = WID_SUCCESS_FRAME_COUNT;
> > wid_list[wid_cnt].type = WID_INT;
> > @@ -977,7 +973,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > wid_list[wid_cnt].size = hif_drv->usr_conn_req.ies_len;
> > wid_cnt++;
> >  
> > -   if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
> > +   if (memcmp("DIRECT-", attr->ssid, 7)) {
> > info_element_size = hif_drv->usr_conn_req.ies_len;
> > info_element = kmalloc(info_element_size, GFP_KERNEL);
> > memcpy(info_element, hif_drv->usr_conn_req.ies,
> > @@ -990,7 +986,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > wid_list[wid_cnt].val = (s8 *)&hif_drv->usr_conn_req.security;
> > wid_cnt++;
> >  
> > -   if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
> > +   if (memcmp("DIRECT-", attr->ssid, 7))
> > mode_11i = hif_drv->usr_conn_req.security;
> >  
> > wid_

Re: [PATCH 10/14] staging: wilc1000: rename ptstrJoinBssParam variable to avoid camelCase

2018-01-21 Thread Ajay Singh

On Fri, 19 Jan 2018 16:50:18 +0530
Claudiu Beznea - M18063  wrote:

> On 18.01.2018 15:17, Ajay Singh wrote:
> > fix "Avoid camelCase" issue reported by checkpatch.pl script.
> > 
> > Signed-off-by: Ajay Singh 
> > ---
> >  drivers/staging/wilc1000/host_interface.c | 78 
> > +++
> >  1 file changed, 39 insertions(+), 39 deletions(-)
> > 
> > diff --git a/drivers/staging/wilc1000/host_interface.c 
> > b/drivers/staging/wilc1000/host_interface.c
> > index 4ddd1a8..cc27b5a 100644
> > --- a/drivers/staging/wilc1000/host_interface.c
> > +++ b/drivers/staging/wilc1000/host_interface.c
> > @@ -909,7 +909,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > struct wid wid_list[8];
> > u32 wid_cnt = 0, dummyval = 0;
> > u8 *cur_byte = NULL;
> > -   struct join_bss_param *ptstrJoinBssParam;
> > +   struct join_bss_param *j_bss_param;  
> I would choose either join_bss_param or bss_param for the name.
> 
Claudiu, Thanks for the code review comments.
I will change j_bss_param to bss_param as per the comments.

> > struct host_if_drv *hif_drv = vif->hif_drv;
> >  
> > if (memcmp(attr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
> > @@ -918,8 +918,8 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > return result;
> > }
> >  
> > -   ptstrJoinBssParam = attr->params;
> > -   if (!ptstrJoinBssParam) {
> > +   j_bss_param = attr->params;
> > +   if (!j_bss_param) {
> > netdev_err(vif->ndev, "Required BSSID not found\n");
> > result = -ENOENT;
> > goto ERRORHANDLER;
> > @@ -1027,8 +1027,8 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > netdev_err(vif->ndev, "Channel out of range\n");
> > *(cur_byte++) = 0xFF;
> > }
> > -   *(cur_byte++)  = (ptstrJoinBssParam->cap_info) & 0xFF;
> > -   *(cur_byte++)  = ((ptstrJoinBssParam->cap_info) >> 8) & 0xFF;
> > +   *(cur_byte++)  = (j_bss_param->cap_info) & 0xFF;
> > +   *(cur_byte++)  = ((j_bss_param->cap_info) >> 8) & 0xFF;
> >  
> > if (attr->bssid)
> > memcpy(cur_byte, attr->bssid, 6);
> > @@ -1038,57 +1038,57 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > memcpy(cur_byte, attr->bssid, 6);
> > cur_byte += 6;
> >  
> > -   *(cur_byte++)  = (ptstrJoinBssParam->beacon_period) & 0xFF;
> > -   *(cur_byte++)  = ((ptstrJoinBssParam->beacon_period) >> 8) & 0xFF;
> > -   *(cur_byte++)  =  ptstrJoinBssParam->dtim_period;
> > +   *(cur_byte++)  = (j_bss_param->beacon_period) & 0xFF;
> > +   *(cur_byte++)  = ((j_bss_param->beacon_period) >> 8) & 0xFF;
> > +   *(cur_byte++)  =  j_bss_param->dtim_period;
> >  
> > -   memcpy(cur_byte, ptstrJoinBssParam->supp_rates, MAX_RATES_SUPPORTED + 
> > 1);
> > +   memcpy(cur_byte, j_bss_param->supp_rates, MAX_RATES_SUPPORTED + 1);
> > cur_byte += (MAX_RATES_SUPPORTED + 1);
> >  
> > -   *(cur_byte++)  =  ptstrJoinBssParam->wmm_cap;
> > -   *(cur_byte++)  = ptstrJoinBssParam->uapsd_cap;
> > +   *(cur_byte++)  =  j_bss_param->wmm_cap;
> > +   *(cur_byte++)  = j_bss_param->uapsd_cap;
> >  
> > -   *(cur_byte++)  = ptstrJoinBssParam->ht_capable;
> > -   hif_drv->usr_conn_req.ht_capable = ptstrJoinBssParam->ht_capable;
> > +   *(cur_byte++)  = j_bss_param->ht_capable;
> > +   hif_drv->usr_conn_req.ht_capable = j_bss_param->ht_capable;
> >  
> > -   *(cur_byte++)  =  ptstrJoinBssParam->rsn_found;
> > -   *(cur_byte++)  =  ptstrJoinBssParam->rsn_grp_policy;
> > -   *(cur_byte++) =  ptstrJoinBssParam->mode_802_11i;
> > +   *(cur_byte++)  =  j_bss_param->rsn_found;
> > +   *(cur_byte++)  =  j_bss_param->rsn_grp_policy;
> > +   *(cur_byte++) =  j_bss_param->mode_802_11i;
> >  
> > -   memcpy(cur_byte, ptstrJoinBssParam->rsn_pcip_policy, 
> > sizeof(ptstrJoinBssParam->rsn_pcip_policy));
> > -   cur_byte += sizeof(ptstrJoinBssParam->rsn_pcip_policy);
> > +   memcpy(cur_byte, j_bss_param->rsn_pcip_policy, 
> > sizeof(j_bss_param->rsn_pcip_policy));> +cur_byte += 
> > sizeof(j_bss_param->rsn_pcip_policy);
> >  
> > -   memcpy(cur_byte, ptstrJoinBssParam->rsn_auth_policy, 
> > sizeof(ptstrJoinBssParam->rsn_auth_policy));
> > -   cur_byte += sizeof(ptstrJoinBssParam->rsn_auth_policy);
> > +   memcpy(cur_byte, j_bss_param->rsn_auth_policy, 
> > sizeof(j_bss_param->rsn_auth_policy));
> > +   cur_byte += sizeof(j_bss_param->rsn_auth_policy);
> >  
> > -   memcpy(cur_byte, ptstrJoinBssParam->rsn_cap, 
> > sizeof(ptstrJoinBssParam->rsn_cap));
> > -   cur_byte += sizeof(ptstrJoinBssParam->rsn_cap);
> > +   memcpy(cur_byte, j_bss_param->rsn_cap, sizeof(j_bss_param->rsn_cap));
> > +   cur_byte += sizeof(j_bss_param->rsn_cap);
> >  
> > *(cur_byte++) = REAL_JOIN_REQ;
> > -   *(cur_byte++) = ptstrJoinBssParam->noa_enabled;
> > +   *(cur_byte++) = j_bss_param->noa_enabled;
> >  
> > -   if (ptstrJoinBssParam->noa_enabled) {
> > -   *(cur_byte++) = (ptstrJoinBssParam->tsf) & 0xFF;
> > -   *(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 8) & 0xFF;
> > -   *(cur_byt

Re: [PATCH][next] staging: ccree: fix memory leaks in cc_ivgen_init

2018-01-21 Thread Gilad Ben-Yossef
On Fri, Jan 12, 2018 at 6:10 PM, Colin King  wrote:
> From: Colin Ian King 
>
> The current error exit path in function cc_ivgen_init via label
> 'out' free's resources from the drvdata->ivgen_handle context.
> However, drvdata->ivgen_handle has not been assigned to the
> context ivgen_ctx at this point, so the resources are not freed.
> Fix this by setting drvdata->ivgen_handle to ivgen_ctx as early
> as possible so that the clean up error exit return path can free
> the resources.
>
> Detected by CoveritScan, CID#1463795 ("Resource leak")
>
> Signed-off-by: Colin Ian King 
> ---
>  drivers/staging/ccree/cc_ivgen.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/ccree/cc_ivgen.c 
> b/drivers/staging/ccree/cc_ivgen.c
> index 25a3131a93ce..c47f419b277b 100644
> --- a/drivers/staging/ccree/cc_ivgen.c
> +++ b/drivers/staging/ccree/cc_ivgen.c
> @@ -178,6 +178,8 @@ int cc_ivgen_init(struct cc_drvdata *drvdata)
> if (!ivgen_ctx)
> return -ENOMEM;
>
> +   drvdata->ivgen_handle = ivgen_ctx;
> +
> /* Allocate pool's header for initial enc. key/IV */
> ivgen_ctx->pool_meta = dma_alloc_coherent(device, CC_IVPOOL_META_SIZE,
>   &ivgen_ctx->pool_meta_dma,
> @@ -196,8 +198,6 @@ int cc_ivgen_init(struct cc_drvdata *drvdata)
> goto out;
> }
>
> -   drvdata->ivgen_handle = ivgen_ctx;
> -
> return cc_init_iv_sram(drvdata);
>
>  out:
> --
> 2.15.1
>

Good catch!

Acked-by: Gilad Ben-Yossef 

Thanks,
Gilad

-- 
Gilad Ben-Yossef
Chief Coffee Drinker

"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
 -- Jean-Baptiste Queru
___
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-21 Thread Gilad Ben-Yossef
On Thu, Jan 11, 2018 at 12:03 PM, Stephan Mueller  wrote:
> 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.

I took your advise and did just that in v2.

Thanks for the review!

Gilad

-- 
Gilad Ben-Yossef
Chief Coffee Drinker

"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
 -- Jean-Baptiste Queru
___
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-21 Thread Gilad Ben-Yossef
Hi Corentin,


On Thu, Jan 11, 2018 at 12:01 PM, Corentin Labbe
 wrote:
> 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.

Fixed in v2.

>
>> 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.

Fixed in v2.

>
>> +/* 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()

Well, the weak key test which is part of des_ekey() are not needed
AFAIK for 3des
as per RFC2451 and the HW does 3des key expansion so that function is not useful
here.

>
> [...]
>> +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

Fixed in v2.
>
> [...]
>> +
>> +#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

You are right. It's a badly implemented stub function. I'll drop the
ifdef as it is useless right now.

Many thanks for the review!

Gilad

-- 
Gilad Ben-Yossef
Chief Coffee Drinker

"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
 -- Jean-Baptiste Queru
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH v3 3/7] x86/hyper-v: reenlightenment notifications support

2018-01-21 Thread Michael Kelley (EOSG)
On Fri, 19 Jan 2018, Thomas Gleixner wrote:

> -Original Message-
> From: Thomas Gleixner [mailto:t...@linutronix.de]
> Sent: Friday, January 19, 2018 11:48 PM
> To: Vitaly Kuznetsov 
> Cc: kbuild test robot ; kbuild-...@01.org; 
> k...@vger.kernel.org;
> x...@kernel.org; Stephen Hemminger ; Radim Krčmář
> ; Haiyang Zhang ; linux-
> ker...@vger.kernel.org; de...@linuxdriverproject.org; Michael Kelley (EOSG)
> ; Ingo Molnar ; Roman Kagan
> ; Andy Lutomirski ; H. Peter Anvin
> ; Paolo Bonzini ; Mohammed Gamal
> 
> Subject: Re: [PATCH v3 3/7] x86/hyper-v: reenlightenment notifications support
> 
> On Fri, 19 Jan 2018, Vitaly Kuznetsov wrote:
> > kbuild test robot  writes:
> >
> > > Hi Vitaly,
> > >
> > > Thank you for the patch! Perhaps something to improve:
> > >
> > > [auto build test WARNING on tip/auto-latest]
> > > [also build test WARNING on v4.15-rc8 next-20180118]
> > > [cannot apply to tip/x86/core kvm/linux-next]
> > > [if your patch is applied to the wrong git tree, please drop us a note to 
> > > help improve the
> system]
> > >
> > > url:
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2F0day-
> ci%2Flinux%2Fcommits%2FVitaly-Kuznetsov%2Fx86-kvm-hyperv-stable-clocksorce-for-L2-
> guests-when-running-nested-KVM-on-Hyper-V%2F20180119-
> 160814&data=02%7C01%7CMichael.H.Kelley%40microsoft.com%7Ce95c66107da6446826830
> 8d55fda2c2b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636520313062777623&s
> data=kAXl3mLVUdJi%2BsB4Ub0fmUHQfl6NuUDjW%2FAY9%2BFLZE4%3D&reserved=0
> > > config: x86_64-allmodconfig (attached as .config)
> > > compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025
> > > reproduce:
> > > # save the attached .config to linux build tree
> > > make ARCH=x86_64
> > >
> > > All warnings (new ones prefixed by >>):
> > >
> > >In file included from include/linux/kasan.h:17:0,
> > > from include/linux/slab.h:129,
> > > from include/linux/irq.h:26,
> > > from arch/x86/include/asm/hardirq.h:6,
> > > from include/linux/hardirq.h:9,
> > > from include/linux/interrupt.h:13,
> > > from arch/x86/include/asm/mshyperv.h:8,
> > > from 
> > > arch/x86//entry/vdso/vdso32/../vclock_gettime.c:20,
> > > from arch/x86//entry/vdso/vdso32/vclock_gettime.c:33:
> > >arch/x86/include/asm/pgtable.h: In function 'clone_pgd_range':
> > >arch/x86/include/asm/pgtable.h:1129:9: error: implicit declaration of 
> > > function
> 'kernel_to_user_pgdp'; did you mean 'u64_to_user_ptr'? 
> [-Werror=implicit-function-
> declaration]
> > >  memcpy(kernel_to_user_pgdp(dst), kernel_to_user_pgdp(src),
> > > ^~~
> >
> > Sorry but I'm failing to see how this (and all the rest) is related to
> > my patch ...
> 
> You added '#include ' to mshyperv.h which is included in
> vclock_gettime.c and pulls in other stuff which fails to expand

Is the declaration of hyperv_reenlightenment_intr() even needed in
mshyperv.h?  The '#include ' is there for the __irq_entry
annotation on that declaration.   There's a declaration of the parallel (and
unannotated) hyperv_vector_handler(), but that looks like a fossil that
isn't needed either.

Michael

> 
> Thanks,
> 
>   tglx

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


3.400,000.00 Eur

2018-01-21 Thread Mrs. Mavis L Wanczyk




Frau Mavis L Wanczyk wählen Sie zu erhalten, Cash Grant Kontakt  
mavislwanczyk...@gmail.com für Anspruch.




This message was sent using IMP, the Internet Messaging Program.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: most: replace function name to __func__

2018-01-21 Thread Sidong Yang
Fix checkpatch.pl warning message about logging code. Previous code
contains hard coded function name. Fix this code by using __func__
macro.

Signed-off-by: Sidong Yang 
---
 drivers/staging/most/dim2/dim2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/most/dim2/dim2.c b/drivers/staging/most/dim2/dim2.c
index 21e3fb48bdb4..f9bc7dea75b8 100644
--- a/drivers/staging/most/dim2/dim2.c
+++ b/drivers/staging/most/dim2/dim2.c
@@ -151,7 +151,7 @@ void dimcb_io_write(u32 __iomem *ptr32, u32 value)
  */
 void dimcb_on_error(u8 error_id, const char *error_message)
 {
-   pr_err("dimcb_on_error: error_id - %d, error_message - %s\n", error_id,
+   pr_err("%s: error_id - %d, error_message - %s\n", __func__, error_id,
   error_message);
 }
 
-- 
2.11.0

Greg, 

You're right that other source with tracing code should be removed.
I sended my patch that only contains replace function name in 'pr_err'.

Thanks.

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


Re: Getting the ccree driver out of staging

2018-01-21 Thread Gilad Ben-Yossef
On Thu, Jan 11, 2018 at 10:42 AM, Dan Carpenter
 wrote:
> 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  &dma_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  }
>

Will fix in v2.

Thanks!
Gilad

-- 
Gilad Ben-Yossef
Chief Coffee Drinker

"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
 -- Jean-Baptiste Queru
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: iio: ade7758: Replace mlock with buf_lock

2018-01-21 Thread Jonathan Cameron
On Sat, 20 Jan 2018 21:14:48 +0530
Shreeya Patel  wrote:

> iio_dev->mlock is to be used only by the IIO core for protecting
> device mode changes between INDIO_DIRECT and INDIO_BUFFER.
> 
> This patch replaces the use of mlock with the already established
> buf_lock mutex.
> 
> Signed-off-by: Shreeya Patel 

You can't do it this simply as it will cause deadlock due to nested
locking of the buf_lock.

To share the lock you will need to provide unlocked versions of
the read and write functions and use those if the lock has already been
taken.

Jonathan

> ---
>  drivers/staging/iio/meter/ade7758_core.c | 10 ++
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/iio/meter/ade7758_core.c 
> b/drivers/staging/iio/meter/ade7758_core.c
> index 7b7ffe5..1a866cc 100644
> --- a/drivers/staging/iio/meter/ade7758_core.c
> +++ b/drivers/staging/iio/meter/ade7758_core.c
> @@ -523,12 +523,13 @@ static int ade7758_read_raw(struct iio_dev *indio_dev,
>   long mask)
>  {
>   int ret;
> + struct ade7758_state *st = iio_priv(indio_dev);
>  
>   switch (mask) {
>   case IIO_CHAN_INFO_SAMP_FREQ:
> - mutex_lock(&indio_dev->mlock);
> + mutex_lock(&st->buf_lock);
>   ret = ade7758_read_samp_freq(&indio_dev->dev, val);
> - mutex_unlock(&indio_dev->mlock);
> + mutex_unlock(&st->buf_lock);
>   return ret;
>   default:
>   return -EINVAL;
> @@ -542,14 +543,15 @@ static int ade7758_write_raw(struct iio_dev *indio_dev,
>int val, int val2, long mask)
>  {
>   int ret;
> + struct ade7758_state *st = iio_priv(indio_dev);
>  
>   switch (mask) {
>   case IIO_CHAN_INFO_SAMP_FREQ:
>   if (val2)
>   return -EINVAL;
> - mutex_lock(&indio_dev->mlock);
> + mutex_lock(&st->buf_lock);
>   ret = ade7758_write_samp_freq(&indio_dev->dev, val);
> - mutex_unlock(&indio_dev->mlock);
> + mutex_unlock(&st->buf_lock);
>   return ret;
>   default:
>   return -EINVAL;

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