[PATCH] Staging: rtlwifi: Remove unused variable and the code

2017-12-21 Thread Shreeya Patel
Remove unused variable and also remove unused code
associated with initializing the unused variable.

Unused variable was detected using the following
semantic patch by coccinelle.

@@
type T;
identifier i;
constant C;
@@

(
extern T i;
|
- T i;
  <+... when != i
- i = C;
  ...+>
)

Signed-off-by: Shreeya Patel 
---
 drivers/staging/rtlwifi/btcoexist/halbtcoutsrc.c | 20 +---
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/drivers/staging/rtlwifi/btcoexist/halbtcoutsrc.c 
b/drivers/staging/rtlwifi/btcoexist/halbtcoutsrc.c
index 52620b7..493011a 100644
--- a/drivers/staging/rtlwifi/btcoexist/halbtcoutsrc.c
+++ b/drivers/staging/rtlwifi/btcoexist/halbtcoutsrc.c
@@ -800,7 +800,7 @@ static void halbtc_display_wifi_status(struct btc_coexist 
*btcoexist,
u32 wifi_link_status = 0x0;
bool bt_hs_on = false, under_ips = false, under_lps = false;
bool low_power = false, dc_mode = false;
-   u8 wifi_chnl = 0, wifi_hs_chnl = 0, fw_ps_state;
+   u8 wifi_chnl = 0, wifi_hs_chnl = 0;
u8 ap_num = 0;
 
wifi_link_status = halbtc_get_wifi_link_status(btcoexist);
@@ -856,7 +856,6 @@ static void halbtc_display_wifi_status(struct btc_coexist 
*btcoexist,
dc_mode = true; /*TODO*/
under_ips = rtlpriv->psc.inactive_pwrstate == ERFOFF ? 1 : 0;
under_lps = rtlpriv->psc.dot11_psmode == EACTIVE ? 0 : 1;
-   fw_ps_state = 0;
low_power = 0; /*TODO*/
seq_printf(m, "\n %-35s = %s%s%s%s",
   "Power Status",
@@ -1644,26 +1643,9 @@ void exhalbtc_rf_status_notify(struct btc_coexist 
*btcoexist, u8 type)
 
 void exhalbtc_stack_operation_notify(struct btc_coexist *btcoexist, u8 type)
 {
-   u8 stack_op_type;
-
if (!halbtc_is_bt_coexist_available(btcoexist))
return;
btcoexist->statistics.cnt_stack_operation_notify++;
-   if (btcoexist->manual_control)
-   return;
-
-   if ((type == HCI_BT_OP_INQUIRY_START) ||
-   (type == HCI_BT_OP_PAGING_START) ||
-   (type == HCI_BT_OP_PAIRING_START)) {
-   stack_op_type = BTC_STACK_OP_INQ_PAGE_PAIR_START;
-   } else if ((type == HCI_BT_OP_INQUIRY_FINISH) ||
-  (type == HCI_BT_OP_PAGING_SUCCESS) ||
-  (type == HCI_BT_OP_PAGING_UNSUCCESS) ||
-  (type == HCI_BT_OP_PAIRING_FINISH)) {
-   stack_op_type = BTC_STACK_OP_INQ_PAGE_PAIR_FINISH;
-   } else {
-   stack_op_type = BTC_STACK_OP_NONE;
-   }
 }
 
 void exhalbtc_halt_notify(struct btc_coexist *btcoexist)
-- 
2.7.4

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


Re: [PATCH v1 05/10] staging: atomisp: Remove non-ACPI leftovers

2017-12-21 Thread Sakari Ailus
Hi Andy and Dan,

On Wed, Dec 20, 2017 at 12:24:36PM +0200, Andy Shevchenko wrote:
> On Wed, Dec 20, 2017 at 6:54 AM, Dan Carpenter  
> wrote:
> > On Tue, Dec 19, 2017 at 10:59:52PM +0200, Andy Shevchenko wrote:
> >> @@ -1147,10 +1145,8 @@ static int gc2235_probe(struct i2c_client *client)
> >>   if (ret)
> >>   gc2235_remove(client);
> >
> > This error handling is probably wrong...
> >
> 
> Thanks for pointing to this, but I'm not going to fix this by the
> following reasons:
> 1. I admit the driver's code is ugly
> 2. It's staging code
> 3. My patch does not touch those lines
> 4. My purpose is to get it working first.
> 
> Feel free to send a followup with a good clean up which I agree with.

Yeah, there's a lot of ugly stuff in this driver... I understand Andy's
patches address problems with functionality, let's make error handling
fixes separately.

So I'm applying these now.

Thanks!

-- 
Kind regards,

Sakari Ailus
sakari.ai...@linux.intel.com
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 2/2] staging: pi433: remove unused rf69_reset_flag function

2017-12-21 Thread Marcin Ciupak
Function rf69_reset_flag is unused and should be removed.

Signed-off-by: Marcin Ciupak 
---
Changes in v2:
- rebase against staging-testing

 drivers/staging/pi433/rf69.c | 12 
 drivers/staging/pi433/rf69.h |  1 -
 2 files changed, 13 deletions(-)

diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index 7a64ef065a2e..9ad358c30225 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -516,18 +516,6 @@ bool rf69_get_flag(struct spi_device *spi, enum flag flag)
}
 }
 
-int rf69_reset_flag(struct spi_device *spi, enum flag flag)
-{
-   switch (flag) {
-   case rssiExceededThreshold: return rf69_write_reg(spi, REG_IRQFLAGS1, 
MASK_IRQFLAGS1_RSSI);
-   case syncAddressMatch:  return rf69_write_reg(spi, REG_IRQFLAGS1, 
MASK_IRQFLAGS1_SYNC_ADDRESS_MATCH);
-   case fifo_overrun:  return rf69_write_reg(spi, REG_IRQFLAGS2, 
MASK_IRQFLAGS2_FIFO_OVERRUN);
-   default:
-   dev_dbg(>dev, "set: illegal input param");
-   return -EINVAL;
-   }
-}
-
 int rf69_set_rssi_threshold(struct spi_device *spi, u8 threshold)
 {
/* no value check needed - u8 exactly matches register size */
diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h
index d3b0f576b5f4..503372a07b4c 100644
--- a/drivers/staging/pi433/rf69.h
+++ b/drivers/staging/pi433/rf69.h
@@ -43,7 +43,6 @@ int rf69_set_bandwidth_during_afc(struct spi_device *spi, 
enum mantisse mantisse
 int rf69_set_ook_threshold_dec(struct spi_device *spi, enum thresholdDecrement 
thresholdDecrement);
 int rf69_set_dio_mapping(struct spi_device *spi, u8 DIONumber, u8 value);
 bool rf69_get_flag(struct spi_device *spi, enum flag flag);
-int rf69_reset_flag(struct spi_device *spi, enum flag flag);
 int rf69_set_rssi_threshold(struct spi_device *spi, u8 threshold);
 int rf69_set_preamble_length(struct spi_device *spi, u16 preambleLength);
 int rf69_enable_sync(struct spi_device *spi);
-- 
2.15.0

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


[PATCH v2 1/2] staging: pi433: remove unused rf69_set_sync_tolerance function

2017-12-21 Thread Marcin Ciupak
Function rf69_set_sync_tolerance is unused and should be removed.

Signed-off-by: Marcin Ciupak 
---
Changes in v2:
- rebase against staging-testing

 drivers/staging/pi433/rf69.c | 12 
 drivers/staging/pi433/rf69.h |  1 -
 2 files changed, 13 deletions(-)

diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index 8bc09e10a582..7a64ef065a2e 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -588,18 +588,6 @@ int rf69_set_sync_size(struct spi_device *spi, u8 syncSize)
return rf69_read_mod_write(spi, REG_SYNC_CONFIG, 
MASK_SYNC_CONFIG_SYNC_SIZE, (syncSize << 3));
 }
 
-int rf69_set_sync_tolerance(struct spi_device *spi, u8 syncTolerance)
-{
-   // check input value
-   if (syncTolerance > 0x07) {
-   dev_dbg(>dev, "set: illegal input param");
-   return -EINVAL;
-   }
-
-   // write value
-   return rf69_read_mod_write(spi, REG_SYNC_CONFIG, 
MASK_SYNC_CONFIG_SYNC_SIZE, syncTolerance);
-}
-
 int rf69_set_sync_values(struct spi_device *spi, u8 syncValues[8])
 {
int retval = 0;
diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h
index f8c015ab3ff3..d3b0f576b5f4 100644
--- a/drivers/staging/pi433/rf69.h
+++ b/drivers/staging/pi433/rf69.h
@@ -50,7 +50,6 @@ int rf69_enable_sync(struct spi_device *spi);
 int rf69_disable_sync(struct spi_device *spi);
 int rf69_set_fifo_fill_condition(struct spi_device *spi, enum 
fifo_fill_condition fifo_fill_condition);
 int rf69_set_sync_size(struct spi_device *spi, u8 sync_size);
-int rf69_set_sync_tolerance(struct spi_device *spi, u8 syncTolerance);
 int rf69_set_sync_values(struct spi_device *spi, u8 syncValues[8]);
 int rf69_set_packet_format(struct spi_device *spi, enum packetFormat 
packetFormat);
 int rf69_enable_crc(struct spi_device *spi);
-- 
2.15.0

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


[PATCH v2 0/2] staging: pi433: unused functions cleanup rebased

2017-12-21 Thread Marcin Ciupak
Remaining patches of unused functions cleanup patchset rebased against
staging-testing.

Marcin Ciupak (2):
  staging: pi433: remove unused rf69_set_sync_tolerance function
  staging: pi433: remove unused rf69_reset_flag function

 drivers/staging/pi433/rf69.c | 24 
 drivers/staging/pi433/rf69.h |  2 --
 2 files changed, 26 deletions(-)

-- 
2.15.0

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


Re: [PATCH v4 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers.

2017-12-21 Thread Jeremy Sowden
On 2017-12-19, at 14:07:49 +0200, Sakari Ailus wrote:
> On Sat, Dec 02, 2017 at 10:11:59PM +, Jeremy Sowden wrote:
> > The CSS API uses a lot of nested anonymous structs defined in object
> > macros to assign default values to its data-structures.  These have
> > been changed to use compound-literals and designated initializers to
> > make them more comprehensible and less fragile.
> >
> > The compound-literals can also be used in assignment, which means we
> > can get rid of some temporary variables whose only purpose is to be
> > initialized by one of these anonymous structs and then serve as the
> > rvalue in an assignment expression.
> >
> > Signed-off-by: Jeremy Sowden 
>
> I don't think it's useful to change the struct definition macros only
> to remove a large number of assigned fields in the next patch. How
> about merging the two patches?

I squashed all three, as you suggested.

> Please also start a new thread when re-posting a set.

Done.

J.


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


Re: [PATCH v2] staging: ccree: fixed pointer signedness warnings.

2017-12-21 Thread Jeremy Sowden
On 2017-12-21, at 18:51:09 +0100, Greg KH wrote:
> On Thu, Dec 21, 2017 at 05:28:00PM +, Jeremy Sowden wrote:
> > Changed the types of a number of index and length variables and the
> > return-types of a couple of functions that return values which are
> > assigned to a couple of these variables from signed to unsigned integer
> > types.
> >
> > Fixes a number of warnings arising from the variables' addresses being
> > passed to functions expecting pointers to unsigned integers.
> >
> > Signed-off-by: Jeremy Sowden 
> > ---
> >  drivers/staging/ccree/ssi_aead.c   | 13 -
> >  drivers/staging/ccree/ssi_buffer_mgr.c |  2 +-
> >  drivers/staging/ccree/ssi_cipher.c |  3 ++-
> >  drivers/staging/ccree/ssi_hash.c   | 15 ---
> >  4 files changed, 19 insertions(+), 14 deletions(-)
>
> What changed from v1?
>
> Always put that below the --- line, like the documentation says to do.

Apologies.  Time to re-read the doc's.

I amended the change-log to include an explanation of the changes to the
function prototypes.

> Also, why are you not cc:ing the maintainer of this driver?

Cc'ed.

> > diff --git a/drivers/staging/ccree/ssi_aead.c 
> > b/drivers/staging/ccree/ssi_aead.c
> > index 1522b00e08cf..638e3b515a1f 100644
> > --- a/drivers/staging/ccree/ssi_aead.c
> > +++ b/drivers/staging/ccree/ssi_aead.c
> > @@ -275,7 +275,8 @@ static void cc_aead_complete(struct device *dev, void 
> > *cc_req)
> > 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)
>
> Why reformat so horridly?

Will fix.

> And why change this function at all?  It can only return '4' (which is
> crazy for other reasons...)  changeing the return value type makes no
> sense to me, why did you make it?

For consistency.  This is one of two similar functions; in this func-
tion, the return-value is hard-coded, in other one it is not, but in
both cases the return-value indicates the number of array elements that
were set in the function, and both return-values are assigned to the
same unsigned integer variable, which was itself changed from signed to
unsigned in this patch.

J.


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


Re: [PATCH v2] staging: ccree: fixed pointer signedness warnings.

2017-12-21 Thread Greg KH
On Thu, Dec 21, 2017 at 05:28:00PM +, Jeremy Sowden wrote:
> Changed the types of a number of index and length variables and the
> return-types of a couple of functions that return values which are
> assigned to a couple of these variables from signed to unsigned integer
> types.
> 
> Fixes a number of warnings arising from the variables' addresses being
> passed to functions expecting pointers to unsigned integers.
> 
> Signed-off-by: Jeremy Sowden 
> ---
>  drivers/staging/ccree/ssi_aead.c   | 13 -
>  drivers/staging/ccree/ssi_buffer_mgr.c |  2 +-
>  drivers/staging/ccree/ssi_cipher.c |  3 ++-
>  drivers/staging/ccree/ssi_hash.c   | 15 ---
>  4 files changed, 19 insertions(+), 14 deletions(-)

What changed from v1?

Always put that below the --- line, like the documentation says to do.

Also, why are you not cc:ing the maintainer of this driver?

> 
> diff --git a/drivers/staging/ccree/ssi_aead.c 
> b/drivers/staging/ccree/ssi_aead.c
> index 1522b00e08cf..638e3b515a1f 100644
> --- a/drivers/staging/ccree/ssi_aead.c
> +++ b/drivers/staging/ccree/ssi_aead.c
> @@ -275,7 +275,8 @@ static void cc_aead_complete(struct device *dev, void 
> *cc_req)
>   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)

Why reformat so horridly?

And why change this function at all?  It can only return '4' (which is
crazy for other reasons...)  changeing the return value type makes no
sense to me, why did you make it?

thanks,

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


Re: [PATCH 0/9] staging: pi433: local and unused functions cleanup

2017-12-21 Thread GregKH
On Wed, Dec 20, 2017 at 04:12:48PM +, Marcin Ciupak wrote:
> These patches make local functions static and remove unused ones. Each
> function is removed by separate patch in order to make it easier to
> revert patch in future if the function will be needed in later version
> of the driver.
> 
> Marcin Ciupak (9):
>   staging: pi433: make local functions static
>   staging: pi433: remove unused rf69_get_payload_length function
>   staging: pi433: remove unused rf69_set_sync_tolerance function
>   staging: pi433: remove unused rf69_set_rssi_timeout function
>   staging: pi433: remove unused rf69_set_rx_start_timeout function
>   staging: pi433: remove unused rf69_reset_flag function
>   staging: pi433: remove unused rf69_set_ook_threshold_step function
>   staging: pi433: remove unused rf69_set_ook_threshold_type function
>   staging: pi433: remove unused rf69_set_dc_cut_off_frequency* functions

Not all of these would apply.  Please rebase against my staging-testing
branch and resend the remaining ones.

thanks,

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


Re: [PATCH v4 0/5] staging: rtl8712: fix several checkpatch style issues

2017-12-21 Thread Greg KH
On Tue, Dec 19, 2017 at 09:16:21PM +0100, Martin Homuth wrote:
> This patch series fixes some coding style issues reported by checkpatch.pl.
> 
> It is based on next-20171218

Only one patch in this series applied, please rebase and resend the
remaining ones.

thanks,

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


[PATCH v2] staging: ccree: fixed pointer signedness warnings.

2017-12-21 Thread Jeremy Sowden
Changed the types of a number of index and length variables and the
return-types of a couple of functions that return values which are
assigned to a couple of these variables from signed to unsigned integer
types.

Fixes a number of warnings arising from the variables' addresses being
passed to functions expecting pointers to unsigned integers.

Signed-off-by: Jeremy Sowden 
---
 drivers/staging/ccree/ssi_aead.c   | 13 -
 drivers/staging/ccree/ssi_buffer_mgr.c |  2 +-
 drivers/staging/ccree/ssi_cipher.c |  3 ++-
 drivers/staging/ccree/ssi_hash.c   | 15 ---
 4 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c
index 1522b00e08cf..638e3b515a1f 100644
--- a/drivers/staging/ccree/ssi_aead.c
+++ b/drivers/staging/ccree/ssi_aead.c
@@ -275,7 +275,8 @@ static void cc_aead_complete(struct device *dev, void 
*cc_req)
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)
 {
/* Load the AES key */
hw_desc_init([0]);
@@ -315,7 +316,8 @@ static int xcbc_setkey(struct cc_hw_desc *desc, struct 
cc_aead_ctx *ctx)
return 4;
 }
 
-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;
@@ -325,7 +327,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 */
@@ -562,7 +564,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",
@@ -1901,7 +1904,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/ssi_buffer_mgr.c 
b/drivers/staging/ccree/ssi_buffer_mgr.c
index 6846d93e22c4..6056a5d2a5b0 100644
--- a/drivers/staging/ccree/ssi_buffer_mgr.c
+++ b/drivers/staging/ccree/ssi_buffer_mgr.c
@@ -1036,7 +1036,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/ssi_cipher.c 
b/drivers/staging/ccree/ssi_cipher.c
index db21570a13a6..3885a50cc035 100644
--- a/drivers/staging/ccree/ssi_cipher.c
+++ b/drivers/staging/ccree/ssi_cipher.c
@@ -651,7 +651,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;
 
dev_dbg(dev, "%s req=%p info=%p nbytes=%d\n",
((direction == DRV_CRYPTO_DIRECTION_ENCRYPT) ?
diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c
index 882f1c12d85e..edf6b54fde31 100644
--- a/drivers/staging/ccree/ssi_hash.c
+++ b/drivers/staging/ccree/ssi_hash.c
@@ -429,7 +429,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;
 
dev_dbg(dev, "= %s-digest (%d) \n", is_hmac ? "hmac" : "hash",
@@ -667,7 +667,7 @@ static int cc_hash_finup(struct ahash_request *req)
bool is_hmac = ctx->is_hmac;
struct cc_crypto_req cc_req = {};
struct cc_hw_desc desc[CC_MAX_HASH_SEQ_LEN];
-   int idx = 

Re: [PATCH v4 1/5] staging: rtl8712: style fix over 80 characters warnings

2017-12-21 Thread Greg KH
On Tue, Dec 19, 2017 at 09:16:22PM +0100, Martin Homuth wrote:
> This patch fixes various coding style issues in the rtl8712 module as
> noted by checkpatch.pl by reducing the characters per line to under
> 80.
> 
> It fixes the following checkpatch.pl warning:
> 
> WARNING: line over 80 characters
> 
> Signed-off-by: Martin Homuth 
> ---
>  drivers/staging/rtl8712/ieee80211.c|  6 --
>  drivers/staging/rtl8712/os_intfs.c |  5 -
>  drivers/staging/rtl8712/rtl8712_cmd.c  | 18 ++
>  drivers/staging/rtl8712/rtl8712_xmit.c |  3 ++-
>  drivers/staging/rtl8712/rtl871x_mlme.c |  3 ++-
>  drivers/staging/rtl8712/rtl871x_mlme.h |  3 ++-
>  6 files changed, 24 insertions(+), 14 deletions(-)

This patch does not apply against my staging-next branch at all :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/4] staging: greybus: Cleanup checkpatch errors

2017-12-21 Thread Greg KH
On Thu, Dec 21, 2017 at 01:07:22AM +0200, Kamal Heib wrote:
> This patch set fixes multiple error found by checkpatch.pl in the
> greybus drivers.
> 
> Kamal Heib (4):
>   staging: greybus: authentication.c: Fix alignment should match open
> parenthesis
>   staging: greybus: bootrom.c: Fix alignment should match open
> parenthesis
>   staging: greybus: bundle.c: Fix multiple checkpatch.pl errors
>   staging: greybus: bundle.h: Use a blank line after struct declarations

Same comments here, please break it up more and properly cc: the needed
people.

thanks,

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


Re: [PATCH 3/3] staging: greybus: audio_codec.h: Fix multiple checkpatch errors

2017-12-21 Thread Greg KH
On Tue, Dec 19, 2017 at 09:55:06PM +0200, Kamal Heib wrote:
> This patch fixes the following errors found by checkpatch:
> 1- Prefer kernel type 'u32' over 'uint32_t'.
> 2- Alignment should match open parenthesis.

Same comment here.  Also please properly cc: the needed maintainers, the
get_maintainers.pl script will tell you who to cc:.

thanks,

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


Re: [PATCH 2/3] staging: greybus: audio_codec.c: Fix multiple checkpatch errors

2017-12-21 Thread Greg KH
On Tue, Dec 19, 2017 at 09:55:05PM +0200, Kamal Heib wrote:
> This patch fixes the following errors found by checkpatch:
> 1- Prefer kernel type 'u32' over 'uint32_t'.
> 2- Space required around that ':'.
> 3- Alignment should match open parenthesis.
> 4- Don't use multiple blank lines.

When you have to list the different things a patch does, that's a huge
sign that it needs to be broken up.

Yeah, this is a small file, but please break this up into a patch
series.

thanks,

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


Re: [PATCH] staging: ccree: fix type mismatch warning

2017-12-21 Thread Greg Kroah-Hartman
On Thu, Dec 21, 2017 at 02:31:20PM +0100, Arnd Bergmann wrote:
> __dump_byte_array used to be hidden, but is now visible to the compiler
> and causes a harmless warning:
> 
> drivers/staging/ccree/ssi_driver.c:82:6: error: conflicting types for 
> '__dump_byte_array'
> drivers/staging/ccree/ssi_driver.c: In function '__dump_byte_array':
> drivers/staging/ccree/ssi_driver.c:89:41: error: format '%lu' expects 
> argument of type 'long unsigned int', but argument 5 has type 'size_t {aka 
> unsigned int}' [-Werror=format=]
> 
> This changes the prototype in the header to match that of the actual
> function on all architectures, and the format string to match the
> argument.
> 
> Fixes: 3f268f5d6669 ("staging: ccree: turn compile time debug log to params")
> Signed-off-by: Arnd Bergmann 
> ---
>  drivers/staging/ccree/ssi_driver.c | 2 +-
>  drivers/staging/ccree/ssi_driver.h | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)

Should already be fixed, sorry.

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


Re: [PATCH] staging: ccree: fixed pointer signedness warnings.

2017-12-21 Thread Greg KH
On Thu, Dec 21, 2017 at 11:25:47AM +, Jeremy Sowden wrote:
> Changed the types of a number of index and length variables from int to
> unsigned int.  Fixes a number of warnings arising from their addresses
> being passed to functions expecting pointers to unsigned ints.
> 
> Signed-off-by: Jeremy Sowden 
> ---
>  drivers/staging/ccree/ssi_aead.c   | 13 -
>  drivers/staging/ccree/ssi_buffer_mgr.c |  2 +-
>  drivers/staging/ccree/ssi_cipher.c |  3 ++-
>  drivers/staging/ccree/ssi_hash.c   | 15 ---
>  4 files changed, 19 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/staging/ccree/ssi_aead.c 
> b/drivers/staging/ccree/ssi_aead.c
> index 1522b00e08cf..638e3b515a1f 100644
> --- a/drivers/staging/ccree/ssi_aead.c
> +++ b/drivers/staging/ccree/ssi_aead.c
> @@ -275,7 +275,8 @@ static void cc_aead_complete(struct device *dev, void 
> *cc_req)
>   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)

Your changelog text does not match up with what you are doing here at
all!

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


Re: [PATCH] staging: ccree: fix __dump_byte_array() declaration mismatch

2017-12-21 Thread Greg KH
On Wed, Dec 20, 2017 at 06:16:08PM +, Corentin Labbe wrote:
> This patch corrects the type of the size argument in __dump_byte_array()
> from unsigned long to size_t as done only in 
> drivers/staging/ccree/ssi_driver.c
> 
> This fix also a build error:
> drivers/staging/ccree/ssi_driver.c:82:6: error: conflicting types for 
> '__dump_byte_array'
> 
> Fixes: 3f268f5d6669 ("staging: ccree: turn compile time debug log to params")
> Signed-off-by: Corentin Labbe 
> ---
>  drivers/staging/ccree/ssi_driver.h | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

There's another warning here that Arnd's patches fixes, yet yours
didn't, so I'm going to take his patch, sorry.

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


[PATCH] staging: comedi: add identifiers to function parameters

2017-12-21 Thread Michael Gebhard
Fix these checkpatch.pl warnings in comedidev.h:
WARNING: function definition argument '' should also have an identifier 
name

Introduces this checkpatch.pl warning in lines 195 and 205:
WARNING: line over 80 characters
Breaking these lines would make the code less compact.

Signed-off-by: Michael Gebhard 
Signed-off-by: David Sauerwein 
---
 drivers/staging/comedi/comedidev.h | 36 ++--
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/comedi/comedidev.h 
b/drivers/staging/comedi/comedidev.h
index fb1f07fa..8f6d160 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -177,23 +177,23 @@ struct comedi_subdevice {
 
unsigned int *chanlist; /* driver-owned chanlist (not used) */
 
-   int (*insn_read)(struct comedi_device *, struct comedi_subdevice *,
-struct comedi_insn *, unsigned int *);
-   int (*insn_write)(struct comedi_device *, struct comedi_subdevice *,
- struct comedi_insn *, unsigned int *);
-   int (*insn_bits)(struct comedi_device *, struct comedi_subdevice *,
-struct comedi_insn *, unsigned int *);
-   int (*insn_config)(struct comedi_device *, struct comedi_subdevice *,
-  struct comedi_insn *, unsigned int *);
-
-   int (*do_cmd)(struct comedi_device *, struct comedi_subdevice *);
-   int (*do_cmdtest)(struct comedi_device *, struct comedi_subdevice *,
- struct comedi_cmd *);
-   int (*poll)(struct comedi_device *, struct comedi_subdevice *);
-   int (*cancel)(struct comedi_device *, struct comedi_subdevice *);
+   int (*insn_read)(struct comedi_device *dev, struct comedi_subdevice *s,
+struct comedi_insn *insn, unsigned int *data);
+   int (*insn_write)(struct comedi_device *dev, struct comedi_subdevice *s,
+ struct comedi_insn *insn, unsigned int *data);
+   int (*insn_bits)(struct comedi_device *dev, struct comedi_subdevice *s,
+struct comedi_insn *insn, unsigned int *data);
+   int (*insn_config)(struct comedi_device *dev, struct comedi_subdevice 
*s,
+  struct comedi_insn *insn, unsigned int *data);
+
+   int (*do_cmd)(struct comedi_device *dev, struct comedi_subdevice *s);
+   int (*do_cmdtest)(struct comedi_device *dev, struct comedi_subdevice *s,
+ struct comedi_cmd *cmd);
+   int (*poll)(struct comedi_device *dev, struct comedi_subdevice *s);
+   int (*cancel)(struct comedi_device *dev, struct comedi_subdevice *s);
 
/* called when the buffer changes */
-   int (*buf_change)(struct comedi_device *, struct comedi_subdevice *);
+   int (*buf_change)(struct comedi_device *dev, struct comedi_subdevice 
*s);
 
void (*munge)(struct comedi_device *dev, struct comedi_subdevice *s,
  void *data, unsigned int num_bytes,
@@ -436,9 +436,9 @@ struct comedi_driver {
/* public: */
const char *driver_name;
struct module *module;
-   int (*attach)(struct comedi_device *, struct comedi_devconfig *);
-   void (*detach)(struct comedi_device *);
-   int (*auto_attach)(struct comedi_device *, unsigned long);
+   int (*attach)(struct comedi_device *dev, struct comedi_devconfig *it);
+   void (*detach)(struct comedi_device *dev);
+   int (*auto_attach)(struct comedi_device *dev, unsigned long context);
unsigned int num_names;
const char *const *board_name;
int offset;
-- 
2.7.4

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


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

2017-12-21 Thread Christoph Volkert

This is a duplicate patch. We fixed a typo and this was still left as a
temporary file. (emacs…) Sorry. The patch with Message-Id
<1513869932-27407-3-git-send-email-fabian_hue...@web.de> is the right 
one.


We can provide a new patch series without the fix, if needed.

Thanks
Christoph


Checkpatch wants complex macros to be enclosed in parantheses, so we
put parantheses 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

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


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

2017-12-21 Thread Fabian Huegel
Checkpatch wants complex macros to be enclosed in parantheses, so we
put parantheses 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 5/8] staging: lustre: Add identifier names to function declarations

2017-12-21 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 6/8] staging: lustre: Fix overlong lines

2017-12-21 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) cfs_get_random_bytes(uuid_out, 
sizeof(class_uuid_t))
+#define ll_generate_random_uuid(uuid_out) \
+   cfs_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


staging: lustre: Cleanup of obd_class.h

2017-12-21 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 2/8] staging: lustre: Enclose complex macros in do-while loops

2017-12-21 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 3/8] staging: lustre: Remove DECLARE_LU_VARS macro

2017-12-21 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


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

2017-12-21 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 7/8] staging: lustre: Align struct member identifiers

2017-12-21 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 1/8] staging: lustre: Enclose complex macros in parentheses

2017-12-21 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


Re: [PATCH RFC 0/7] KVM: nVMX: enlightened VMCS initial implementation

2017-12-21 Thread Vitaly Kuznetsov
Paolo Bonzini  writes:

> On 21/12/2017 13:50, Vitaly Kuznetsov wrote:
>> I'm back with (somewhat frustrating) results (E5-2603):
>
> v4 (that would be Broadwell)?
>

Sorry, v3, actually. Haswell. (the first one supporting vmcs shadowing afaiu).

>> 1) Windows on Hyper-V (no nesting): 1350 cycles
>> 
>> 2) Windows on Hyper-V on Hyper-V: 8600
>> 
>> 3) Windows on KVM (no nesting): 1150  cycles
>> 
>> 4) Windows on Hyper-V on KVM (no enlightened VMCS): 18200
>> 
>> 5) Windows on Hyper-V on KVM (enlightened VMCS): 17100
>
> What version were you using for KVM?  There are quite a few nested virt
> optimizations in kvm/queue (which may make enlightened VMCS both more or
> less efficient).

This is kvm/queue and I rebased enlightened VMCS patches to it.

>
> In particular, with latest kvm/queue you could try tracing vmread and
> vmwrite vmexits, and see if you get any.  If you do, that might be an
> easy few hundred cycles savings.

Will do.

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


Re: [PATCH RFC 0/7] KVM: nVMX: enlightened VMCS initial implementation

2017-12-21 Thread Paolo Bonzini
On 21/12/2017 13:50, Vitaly Kuznetsov wrote:
> I'm back with (somewhat frustrating) results (E5-2603):

v4 (that would be Broadwell)?

> 1) Windows on Hyper-V (no nesting): 1350 cycles
> 
> 2) Windows on Hyper-V on Hyper-V: 8600
> 
> 3) Windows on KVM (no nesting): 1150  cycles
> 
> 4) Windows on Hyper-V on KVM (no enlightened VMCS): 18200
> 
> 5) Windows on Hyper-V on KVM (enlightened VMCS): 17100

What version were you using for KVM?  There are quite a few nested virt
optimizations in kvm/queue (which may make enlightened VMCS both more or
less efficient).

In particular, with latest kvm/queue you could try tracing vmread and
vmwrite vmexits, and see if you get any.  If you do, that might be an
easy few hundred cycles savings.

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


[PATCH] staging: ccree: fix type mismatch warning

2017-12-21 Thread Arnd Bergmann
__dump_byte_array used to be hidden, but is now visible to the compiler
and causes a harmless warning:

drivers/staging/ccree/ssi_driver.c:82:6: error: conflicting types for 
'__dump_byte_array'
drivers/staging/ccree/ssi_driver.c: In function '__dump_byte_array':
drivers/staging/ccree/ssi_driver.c:89:41: error: format '%lu' expects argument 
of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned 
int}' [-Werror=format=]

This changes the prototype in the header to match that of the actual
function on all architectures, and the format string to match the
argument.

Fixes: 3f268f5d6669 ("staging: ccree: turn compile time debug log to params")
Signed-off-by: Arnd Bergmann 
---
 drivers/staging/ccree/ssi_driver.c | 2 +-
 drivers/staging/ccree/ssi_driver.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/ccree/ssi_driver.c 
b/drivers/staging/ccree/ssi_driver.c
index 56b5d45a205c..1254c6922d50 100644
--- a/drivers/staging/ccree/ssi_driver.c
+++ b/drivers/staging/ccree/ssi_driver.c
@@ -86,7 +86,7 @@ void __dump_byte_array(const char *name, const u8 *buf, 
size_t len)
if (!buf)
return;
 
-   snprintf(prefix, sizeof(prefix), "%s[%lu]: ", name, len);
+   snprintf(prefix, sizeof(prefix), "%s[%zu]: ", name, len);
 
print_hex_dump(KERN_DEBUG, prefix, DUMP_PREFIX_ADDRESS, 16, 1, buf,
   len, false);
diff --git a/drivers/staging/ccree/ssi_driver.h 
b/drivers/staging/ccree/ssi_driver.h
index 5a56f7a76b71..e1406d6e1ab2 100644
--- a/drivers/staging/ccree/ssi_driver.h
+++ b/drivers/staging/ccree/ssi_driver.h
@@ -175,9 +175,9 @@ static inline struct device *drvdata_to_dev(struct 
cc_drvdata *drvdata)
 }
 
 void __dump_byte_array(const char *name, const u8 *the_array,
-  unsigned long size);
+  size_t size);
 static inline void dump_byte_array(const char *name, const u8 *the_array,
-  unsigned long size)
+  size_t size)
 {
if (cc_dump_bytes)
__dump_byte_array(name, the_array, size);
-- 
2.9.0

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


Re: [PATCH RFC 2/7] KVM: nVMX: modify vmcs12 fields to match Hyper-V enlightened VMCS

2017-12-21 Thread Vitaly Kuznetsov
Paolo Bonzini  writes:

> On 19/12/2017 13:25, Vitaly Kuznetsov wrote:
>> 
>>> At this point in time, I don't think you can just blithely change the
>>> virtual VMCS layout and revision number. Existing VMs using the old
>>> layout and revision number must continue to work on versions of kvm
>>> past this point. You could tie the layout and revision number changes
>>> to KVM_CAP_HYPERV_ENLIGHTENED_VMCS if you like, but kvm must be able
>>> to continue to service VMs using the previous layout and revision
>>> number in perpetuity.
>>>
>> I see what you mean. In case we need to keep migration of nested
>> workloads working between KVMs of different versions we can't (ever)
>> touch vmcs12.
>
> Actually we can, for two reasons.
>
> First, the active VMCS is stored in host RAM (not in guest RAM).  This
> means there are clear points where to do the translation, namely vmptrld
> and the (not yet upstream) ioctl to set VMX state.
>
> Therefore you only need to keep an (offset, type) map from old to new
> layout map; at those two points if you detect an old VMCS12_REVISION you
> copy the fields one by one instead of doing a memcpy.  The next vmclear
> or vmptrld or get-VMX-state ioctl will automatically update to the new
> VMCS12_REVISION.  Of course, this is a one-way street unless you also
> add support for writing old VMCS12_REVISIONs.
>
> But, second, VMX state migration is not upstream yet, so nested
> hypervisors are currently not migratable: the active VMCS12 state will
> not be migrated at all!  So in upstream KVM we wouldn't even need to
> upgrade the VMCS12_REVISION to make changes to vmcs12.
>
> That said...
>
>> The way to go in this case, I think, is to create a completely separate
>> enlightened_vmcs12 struct and use it when appropriate. We can't possibly
>> support migrating workloads which use enlightened VMCS to an old KVM
>> which doesn't support it.
>
> ... this is probably a good idea as well.
>

One other thing I was thinking about is the shared definition of
enlightened vmcs which we'll use for both KVM-on-Hyper-V and Hyper-V on
KVM and for that purpose I'd like it to be placed outside of struct
vmcs12. We can, of course, embed it at the beginning of vmcs12.

Thinking long term (and having in mind that Microsoft will be updating
enlightened VMCS on its own schedule) -- what would be the preferred way
to go? It seems that personally I'm leaning towards untangling and
keeping it separate from vmcs12 but I can't really find a convincing
argument...

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


Re: [PATCH RFC 0/7] KVM: nVMX: enlightened VMCS initial implementation

2017-12-21 Thread Vitaly Kuznetsov
Vitaly Kuznetsov  writes:

> Paolo Bonzini  writes:
>
>> On 18/12/2017 18:17, Vitaly Kuznetsov wrote:
>>> The original author of these patches does no longer work at Red Hat, I
>>> agreed to take this over and send upstream. Here is his original
>>> description:
>>> 
>>> "Makes KVM implement the enlightened VMCS feature per Hyper-V TLFS 5.0b.
>>> I've measured about %5 improvement in cost of a nested VM exit (Hyper-V
>>> enabled Windows Server 2016 nested in KVM)."
>>
>> Can you try reproducing this and see how much a simple CPUID loop costs in:
>>
>> * Hyper-V on Hyper-V (with enlightened VMCS, as a proxy for a full
>> implementation including the clean fields mask)
>>
>> * Hyper-V on KVM, with and without enlightened VMCS
>>
>> The latest kvm/queue branch already cut a lot of the cost of a nested VM
>> exit (from ~22000 to ~14000 clock cycles for KVM on KVM), so we could
>> also see if Hyper-V needs shadowing of more fields.
>
> I tested this series before sending out and was able to reproduce said
> 5% improvement with the feature (but didn't keep record of clock
> cycles). I'll try doing tests you mentioned on the same hardware and
> come back with the result. Hopefully I'll manage that before holidays.

I'm back with (somewhat frustrating) results (E5-2603):

1) Windows on Hyper-V (no nesting): 1350 cycles

2) Windows on Hyper-V on Hyper-V: 8600

3) Windows on KVM (no nesting): 1150  cycles

4) Windows on Hyper-V on KVM (no enlightened VMCS): 18200

5) Windows on Hyper-V on KVM (enlightened VMCS): 17100

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


[PATCH 1/2] staging: fsl-dpaa2/eth: Flow affinity for IP forwarding

2017-12-21 Thread Ioana Radulescu
The driver xmit function chooses an egress FQ based on the current
core id. The network stack itself sets a mapping field in the skb
based on many things - the default one being a hash on packet fields,
which the current driver ignores.

This patch saves the ingress frame flow affinity information in the
skb. In case of forwarded frames, this info will then be used for Tx
and Tx confirmation hardware queue selection, ensuring all processing
of the given frame is done on a single core.

Signed-off-by: Bogdan Purcareata 
Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 16 ++--
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h |  3 ++-
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index 7f3e4fa..b63ae09 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -230,7 +230,8 @@ static struct sk_buff *build_frag_skb(struct dpaa2_eth_priv 
*priv,
 static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
 struct dpaa2_eth_channel *ch,
 const struct dpaa2_fd *fd,
-struct napi_struct *napi)
+struct napi_struct *napi,
+u16 queue_id)
 {
dma_addr_t addr = dpaa2_fd_get_addr(fd);
u8 fd_format = dpaa2_fd_get_format(fd);
@@ -281,6 +282,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
}
 
skb->protocol = eth_type_trans(skb, priv->net_dev);
+   skb_record_rx_queue(skb, queue_id);
 
percpu_stats->rx_packets++;
percpu_stats->rx_bytes += dpaa2_fd_get_len(fd);
@@ -325,7 +327,7 @@ static int consume_frames(struct dpaa2_eth_channel *ch)
fq = (struct dpaa2_eth_fq *)dpaa2_dq_fqd_ctx(dq);
fq->stats.frames++;
 
-   fq->consume(priv, ch, fd, >napi);
+   fq->consume(priv, ch, fd, >napi, fq->flowid);
cleaned++;
} while (!is_last);
 
@@ -588,10 +590,11 @@ static netdev_tx_t dpaa2_eth_tx(struct sk_buff *skb, 
struct net_device *net_dev)
/* Tracing point */
trace_dpaa2_tx_fd(net_dev, );
 
-   /* TxConf FQ selection primarily based on cpu affinity; this is
-* non-migratable context, so it's safe to call smp_processor_id().
+   /* TxConf FQ selection relies on queue id from the stack.
+* In case of a forwarded frame from another DPNI interface, we choose
+* a queue affined to the same core that processed the Rx frame
 */
-   queue_mapping = smp_processor_id() % dpaa2_eth_queue_count(priv);
+   queue_mapping = skb_get_queue_mapping(skb);
fq = >fq[queue_mapping];
for (i = 0; i < DPAA2_ETH_ENQUEUE_RETRIES; i++) {
err = dpaa2_io_service_enqueue_qd(NULL, priv->tx_qdid, 0,
@@ -622,7 +625,8 @@ static netdev_tx_t dpaa2_eth_tx(struct sk_buff *skb, struct 
net_device *net_dev)
 static void dpaa2_eth_tx_conf(struct dpaa2_eth_priv *priv,
  struct dpaa2_eth_channel *ch,
  const struct dpaa2_fd *fd,
- struct napi_struct *napi __always_unused)
+ struct napi_struct *napi __always_unused,
+ u16 queue_id __always_unused)
 {
struct rtnl_link_stats64 *percpu_stats;
struct dpaa2_eth_drv_stats *percpu_extras;
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
index d68ac38..fb8fb5c 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
@@ -276,7 +276,8 @@ struct dpaa2_eth_fq {
void (*consume)(struct dpaa2_eth_priv *,
struct dpaa2_eth_channel *,
const struct dpaa2_fd *,
-   struct napi_struct *);
+   struct napi_struct *,
+   u16 queue_id);
struct dpaa2_eth_fq_stats stats;
 };
 
-- 
2.7.4

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


[PATCH 2/2] staging: fsl-dpaa2/eth: Flow affinity for non-forwarded traffic

2017-12-21 Thread Ioana Radulescu
The previous patch ensures Tx flow affinity for forwarded frames,
but for termination traffic the initial flow affinity is determined
based on the skb hash, which is expected to hit only a few Tx queues
when there is a small number of flows.

Instead, use XPS (transmit packet steering) to set netdevice queue
affinity to the sending core.

Signed-off-by: Bogdan Purcareata 
Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index b63ae09..824c4ad 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -1620,9 +1620,10 @@ static struct dpaa2_eth_channel 
*get_affine_channel(struct dpaa2_eth_priv *priv,
 static void set_fq_affinity(struct dpaa2_eth_priv *priv)
 {
struct device *dev = priv->net_dev->dev.parent;
+   struct cpumask xps_mask;
struct dpaa2_eth_fq *fq;
int rx_cpu, txc_cpu;
-   int i;
+   int i, err;
 
/* For each FQ, pick one channel/CPU to deliver frames to.
 * This may well change at runtime, either through irqbalance or
@@ -1641,6 +1642,17 @@ static void set_fq_affinity(struct dpaa2_eth_priv *priv)
break;
case DPAA2_TX_CONF_FQ:
fq->target_cpu = txc_cpu;
+
+   /* Tell the stack to affine to txc_cpu the Tx queue
+* associated with the confirmation one
+*/
+   cpumask_clear(_mask);
+   cpumask_set_cpu(txc_cpu, _mask);
+   err = netif_set_xps_queue(priv->net_dev, _mask,
+ fq->flowid);
+   if (err)
+   dev_err(dev, "Error setting XPS queue\n");
+
txc_cpu = cpumask_next(txc_cpu, >dpio_cpumask);
if (txc_cpu >= nr_cpu_ids)
txc_cpu = cpumask_first(>dpio_cpumask);
-- 
2.7.4

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


[PATCH] staging: ccree: fixed pointer signedness warnings.

2017-12-21 Thread Jeremy Sowden
Changed the types of a number of index and length variables from int to
unsigned int.  Fixes a number of warnings arising from their addresses
being passed to functions expecting pointers to unsigned ints.

Signed-off-by: Jeremy Sowden 
---
 drivers/staging/ccree/ssi_aead.c   | 13 -
 drivers/staging/ccree/ssi_buffer_mgr.c |  2 +-
 drivers/staging/ccree/ssi_cipher.c |  3 ++-
 drivers/staging/ccree/ssi_hash.c   | 15 ---
 4 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c
index 1522b00e08cf..638e3b515a1f 100644
--- a/drivers/staging/ccree/ssi_aead.c
+++ b/drivers/staging/ccree/ssi_aead.c
@@ -275,7 +275,8 @@ static void cc_aead_complete(struct device *dev, void 
*cc_req)
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)
 {
/* Load the AES key */
hw_desc_init([0]);
@@ -315,7 +316,8 @@ static int xcbc_setkey(struct cc_hw_desc *desc, struct 
cc_aead_ctx *ctx)
return 4;
 }
 
-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;
@@ -325,7 +327,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 */
@@ -562,7 +564,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",
@@ -1901,7 +1904,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/ssi_buffer_mgr.c 
b/drivers/staging/ccree/ssi_buffer_mgr.c
index 6846d93e22c4..6056a5d2a5b0 100644
--- a/drivers/staging/ccree/ssi_buffer_mgr.c
+++ b/drivers/staging/ccree/ssi_buffer_mgr.c
@@ -1036,7 +1036,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/ssi_cipher.c 
b/drivers/staging/ccree/ssi_cipher.c
index db21570a13a6..3885a50cc035 100644
--- a/drivers/staging/ccree/ssi_cipher.c
+++ b/drivers/staging/ccree/ssi_cipher.c
@@ -651,7 +651,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;
 
dev_dbg(dev, "%s req=%p info=%p nbytes=%d\n",
((direction == DRV_CRYPTO_DIRECTION_ENCRYPT) ?
diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c
index 882f1c12d85e..edf6b54fde31 100644
--- a/drivers/staging/ccree/ssi_hash.c
+++ b/drivers/staging/ccree/ssi_hash.c
@@ -429,7 +429,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;
 
dev_dbg(dev, "= %s-digest (%d) \n", is_hmac ? "hmac" : "hash",
@@ -667,7 +667,7 @@ static int cc_hash_finup(struct ahash_request *req)
bool is_hmac = ctx->is_hmac;
struct cc_crypto_req cc_req = {};
struct cc_hw_desc desc[CC_MAX_HASH_SEQ_LEN];
-   int idx = 0;
+   unsigned int idx = 0;
int rc;
 
dev_dbg(dev, "= %s-finup (%d) \n", is_hmac ? "hmac" : "hash",
@@ -787,7 

Re: [-next PATCH 3/4] treewide: Use DEVICE_ATTR_RO

2017-12-21 Thread Sakari Ailus
Hi Joe,

On Tue, Dec 19, 2017 at 10:15:08AM -0800, Joe Perches wrote:
> diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c 
> b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
> index a1c81c12718c..4338b8a1309f 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
> @@ -158,10 +158,10 @@ static ssize_t dynamic_pool_show(struct device *dev,
>   return ret;
>  };
>  
> -static DEVICE_ATTR(active_bo, 0444, active_bo_show, NULL);
> -static DEVICE_ATTR(free_bo, 0444, free_bo_show, NULL);
> -static DEVICE_ATTR(reserved_pool, 0444, reserved_pool_show, NULL);
> -static DEVICE_ATTR(dynamic_pool, 0444, dynamic_pool_show, NULL);
> +static DEVICE_ATTR_RO(active_bo);
> +static DEVICE_ATTR_RO(free_bo);
> +static DEVICE_ATTR_RO(reserved_pool);
> +static DEVICE_ATTR_RO(dynamic_pool);
>  
>  static struct attribute *sysfs_attrs_ctrl[] = {
>   _attr_active_bo.attr,

I have the exact same changes queued up in my tree. As there seem to be no
dependencies to other patches in your set, how about dropping this chunk?

Thanks.

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel