Re: [PATCH] staging: dgnc: replace DGNC_VERIFY_BOARD macro
On Mon, Oct 17, 2016 at 11:46:36PM +0200, Fernando Apesteguía wrote: > On Mon, Oct 17, 2016 at 10:29 AM, Greg KH wrote: > > On Fri, Oct 14, 2016 at 07:22:57PM +0200, Fernando Apesteguia wrote: > >> The patch replaces the macro with a function (dgnc_get_board) and > >> substitutes the macro statement with a call to that function and a > >> comparison on the returned value. > >> > >> This removes a checkpatch warning. > >> > >> Signed-off-by: Fernando Apesteguia > >> --- > >> drivers/staging/dgnc/dgnc_sysfs.c | 74 > >> +++ > >> 1 file changed, 51 insertions(+), 23 deletions(-) > >> > >> diff --git a/drivers/staging/dgnc/dgnc_sysfs.c > >> b/drivers/staging/dgnc/dgnc_sysfs.c > >> index 290bf6e..3ea23a9 100644 > >> --- a/drivers/staging/dgnc/dgnc_sysfs.c > >> +++ b/drivers/staging/dgnc/dgnc_sysfs.c > >> @@ -90,17 +90,21 @@ void dgnc_remove_driver_sysfiles(struct pci_driver > >> *dgnc_driver) > >> driver_remove_file(driverfs, &driver_attr_pollrate); > >> } > >> > >> -#define DGNC_VERIFY_BOARD(p, bd) \ > >> - do {\ > >> - if (!p) \ > >> - return 0; \ > >> - \ > >> - bd = dev_get_drvdata(p);\ > >> - if (!bd || bd->magic != DGNC_BOARD_MAGIC) \ > >> - return 0; \ > >> - if (bd->state != BOARD_READY) \ > >> - return 0; \ > >> - } while (0) > >> +static struct dgnc_board *dgnc_get_board(struct device *p) > >> +{ > >> + struct dgnc_board *bd; > >> + > >> + if (!p) > >> + return NULL; > >> + > >> + bd = dev_get_drvdata(p); > >> + if (!bd || bd->magic != DGNC_BOARD_MAGIC) > >> + return NULL; > >> + if (bd->state != BOARD_READY) > >> + return NULL; > >> + > >> + return bd; > >> +} > > > > No, this macro should be removed entirely as what it does is pointless > > in some parts, wrong in others, and not needed at all in the rest :( > > > > I've asked others to fix this up properly in the past, but it doesn't > > seem like anyone wants to do the work... > > > > I tried to find the discussion the relevant mails in lkml.org but > couldn't find them. Could you point me to them so I can have a look? Last time I mentioned this, it was on the outreachy-kernel mailing list. Just walk through the code for yourself and see which, if any, of these things could ever actually cause the function to "fail". I think you will find that none of them can ever happen... The first test is a huge proof that the original author didn't understand how sysfs or "container_of()" works, given that it is impossible to ever have happen. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: Replace CamelCase namings with underscores.
On Mon, Oct 17, 2016 at 1:16 PM, Greg KH wrote: > > On Mon, Oct 17, 2016 at 01:13:55AM +0530, Pankaj Bharadiya wrote: > > Replace CamelCase names with underscores to comply with the standard > > kernel coding style. > > > > Signed-off-by: Pankaj Bharadiya > > --- > > drivers/staging/dgnc/dgnc_tty.c | 20 ++-- > > 1 file changed, 10 insertions(+), 10 deletions(-) > > > > diff --git a/drivers/staging/dgnc/dgnc_tty.c > > b/drivers/staging/dgnc/dgnc_tty.c > > index ef9a45b..1a21902 100644 > > --- a/drivers/staging/dgnc/dgnc_tty.c > > +++ b/drivers/staging/dgnc/dgnc_tty.c > > @@ -45,7 +45,7 @@ > > /* > > * internal variables > > */ > > -static unsigned char *dgnc_TmpWriteBuf; > > +static unsigned char *dgnc_tmp_write_buf; > > Why not just fix the code to not have this variable at all? It's not > correct to have it from what I can tell... > > Also, you modify many different variables all at once, can you please > just modify one at a time (one per patch), to make it more obvious it is > correct? > > > /* > > * Default transparent print information. > > @@ -69,7 +69,7 @@ > > * This defines a raw port at 9600 baud, 8 data bits, no parity, > > * 1 stop bit. > > */ > > -static struct ktermios DgncDefaultTermios = { > > +static struct ktermios dgnc_default_termios = { > > rename to "default_termios"? > > No need to keep the driver name prefix on a static variable, right? > Hi Greg, Thank you for your comments. I have submitted v2 patchset. I hope that makes more sense now. Thanks, Pankaj > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH -next] staging: rts5208: rtsx.c: Fix invalid use of sizeof in rtsx_probe()
From: Wei Yongjun sizeof() when applied to a pointer typed expression gives the size of the pointer, not that of the pointed data. Fixes: 2eb9d8cbb3c3 ("staging: rts5208: rtsx.c: Alloc sizeof struct") Signed-off-by: Wei Yongjun --- drivers/staging/rts5208/rtsx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c index f3e5efd..68d75d0 100644 --- a/drivers/staging/rts5208/rtsx.c +++ b/drivers/staging/rts5208/rtsx.c @@ -884,7 +884,7 @@ static int rtsx_probe(struct pci_dev *pci, dev = host_to_rtsx(host); memset(dev, 0, sizeof(struct rtsx_dev)); - dev->chip = kzalloc(sizeof(dev->chip), GFP_KERNEL); + dev->chip = kzalloc(sizeof(*dev->chip), GFP_KERNEL); if (!dev->chip) { err = -ENOMEM; goto errout; ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [lustre-devel] [PATCH 08/28] staging: lustre: restore initialization of return code
On Monday, October 17, 2016 3:37:11 PM CEST Linus Torvalds wrote: > On Mon, Oct 17, 2016 at 3:29 PM, Arnd Bergmann wrote: > > > > Sorry, I pasted the wrong error message when writing the changelog. > > Not just the warning, the summary above it talks about the wrong > function too. And the commit it references doesn't actually exist > either. So apparently this is against something else than my tree. Right, it slipped in here together with the other lustre patch when I rebased my longer series (based on linux-next) onto v4.9-rc1. Both applied cleanly to v4.9-rc1 and they are required on linux-next (not the version with the wrong changelog of course) but have no effect in mainline so far. I'll double-check the rest of the series tomorrow, to see if some of the other patches also have the same problem and are only needed on linux-next. I meant to send those as part of the separate series for v4.10. For now, it would be good to know if you see any remaining warnings on your machine after applying the current series (with or without the lustre patches, doesn't matter) to a test branch. Some other patches in the series likely need to go through a second revision anyway. Arnd ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/28 v2] staging: lustre: restore initialization of return code
A recent rework dropped the initialization of the initialization of the successful return code in lov_getstripe: drivers/staging/lustre/lustre/lov/lov_pack.c: In function 'lov_getstripe': drivers/staging/lustre/lustre/lov/lov_pack.c:426:9: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/staging/lustre/lustre/lov/lov_pack.c:313:6: note: 'rc' was declared here This adds it back. Fixes: e10a431b3fd0 ("staging: lustre: lov: move LSM to LOV layer") Signed-off-by: Arnd Bergmann --- v2: fix embarrassing incorrect changelog diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c b/drivers/staging/lustre/lustre/lov/lov_pack.c index 17bceadd66f8..ccc1fae35791 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pack.c +++ b/drivers/staging/lustre/lustre/lov/lov_pack.c @@ -418,6 +418,8 @@ int lov_getstripe(struct lov_object *obj, struct lov_stripe_md *lsm, ((struct lov_user_md *)lmmk)->lmm_stripe_count = lum.lmm_stripe_count; if (copy_to_user(lump, lmmk, lmm_size)) rc = -EFAULT; + else + rc = 0; out_free: kvfree(lmmk); ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] staging: lustre: replace uses of class_devno_max by MAX_OBD_DEVICES
On Oct 17, 2016, at 15:46, Aya Mahfouz wrote: > > class_devno_max is an inline function that returns > MAX_OBD_DEVICES. Replace all calls to the function > by MAX_OBD_DEVICES. Thanks for your patch, but unfortunately it can't be accepted. This function was added in preparation of being able to tune the maximum number of storage devices dynamically, rather than having to hard code it to the maximum possible number of servers that a client can possibly connect to. While the current maximum of 8192 servers has been enough for current filesystems, I'd rather move in the direction of dynamically handling this limit rather than re-introducing a hard-coded constant throughout the code. One comment inline below, if you still want to submit a patch. > Signed-off-by: Aya Mahfouz > --- > drivers/staging/lustre/lustre/obdclass/class_obd.c | 6 +++--- > drivers/staging/lustre/lustre/obdclass/genops.c| 22 +++--- > .../lustre/lustre/obdclass/linux/linux-module.c| 6 +++--- > 3 files changed, 17 insertions(+), 17 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c > b/drivers/staging/lustre/lustre/obdclass/class_obd.c > index 2b21675..b775c74 100644 > --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c > +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c > @@ -345,7 +345,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long > arg) > goto out; > } > obd = class_name2obd(data->ioc_inlbuf4); > - } else if (data->ioc_dev < class_devno_max()) { > + } else if (data->ioc_dev < MAX_OBD_DEVICES) { > obd = class_num2obd(data->ioc_dev); > } else { > CERROR("OBD ioctl: No device\n"); > @@ -498,7 +498,7 @@ static int __init obdclass_init(void) > } > > /* This struct is already zeroed for us (static global) */ > - for (i = 0; i < class_devno_max(); i++) > + for (i = 0; i < MAX_OBD_DEVICES; i++) > obd_devs[i] = NULL; This block can just be removed entirely. It used to do something useful, but through a series of changes it has become useless. Cheers, Andreas > /* Default the dirty page cache cap to 1/2 of system memory. > @@ -548,7 +548,7 @@ static void obdclass_exit(void) > lustre_unregister_fs(); > > misc_deregister(&obd_psdev); > - for (i = 0; i < class_devno_max(); i++) { > + for (i = 0; i < MAX_OBD_DEVICES; i++) { > struct obd_device *obd = class_num2obd(i); > > if (obd && obd->obd_set_up && > diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c > b/drivers/staging/lustre/lustre/obdclass/genops.c > index 99c2da6..af4fc58 100644 > --- a/drivers/staging/lustre/lustre/obdclass/genops.c > +++ b/drivers/staging/lustre/lustre/obdclass/genops.c > @@ -290,7 +290,7 @@ struct obd_device *class_newdev(const char *type_name, > const char *name) > LASSERT(newdev->obd_magic == OBD_DEVICE_MAGIC); > > write_lock(&obd_dev_lock); > - for (i = 0; i < class_devno_max(); i++) { > + for (i = 0; i < MAX_OBD_DEVICES; i++) { > struct obd_device *obd = class_num2obd(i); > > if (obd && (strcmp(name, obd->obd_name) == 0)) { > @@ -322,9 +322,9 @@ struct obd_device *class_newdev(const char *type_name, > const char *name) > } > write_unlock(&obd_dev_lock); > > - if (!result && i >= class_devno_max()) { > + if (!result && i >= MAX_OBD_DEVICES) { > CERROR("all %u OBD devices used, increase MAX_OBD_DEVICES\n", > -class_devno_max()); > +MAX_OBD_DEVICES); > result = ERR_PTR(-EOVERFLOW); > goto out; > } > @@ -372,7 +372,7 @@ int class_name2dev(const char *name) > return -1; > > read_lock(&obd_dev_lock); > - for (i = 0; i < class_devno_max(); i++) { > + for (i = 0; i < MAX_OBD_DEVICES; i++) { > struct obd_device *obd = class_num2obd(i); > > if (obd && strcmp(name, obd->obd_name) == 0) { > @@ -397,7 +397,7 @@ struct obd_device *class_name2obd(const char *name) > { > int dev = class_name2dev(name); > > - if (dev < 0 || dev > class_devno_max()) > + if (dev < 0 || dev > MAX_OBD_DEVICES) > return NULL; > return class_num2obd(dev); > } > @@ -408,7 +408,7 @@ int class_uuid2dev(struct obd_uuid *uuid) > int i; > > read_lock(&obd_dev_lock); > - for (i = 0; i < class_devno_max(); i++) { > + for (i = 0; i < MAX_OBD_DEVICES; i++) { > struct obd_device *obd = class_num2obd(i); > > if (obd && obd_uuid_equals(uuid, &obd->obd_uuid)) { > @@ -435,7 +435,7 @@ struct obd_device *class_num2obd(int num) > { > struct obd_device *obd = NULL; > > - if (num < class_devno_max()) { > + if (num < MAX_OBD_DEVICES) { > obd = obd_devs[num]; > if (!obd) > return NULL;
Re: [lustre-devel] [PATCH 08/28] staging: lustre: restore initialization of return code
On Mon, Oct 17, 2016 at 3:29 PM, Arnd Bergmann wrote: > > Sorry, I pasted the wrong error message when writing the changelog. Not just the warning, the summary above it talks about the wrong function too. And the commit it references doesn't actually exist either. So apparently this is against something else than my tree. Linus ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [lustre-devel] [PATCH 08/28] staging: lustre: restore initialization of return code
On Monday, October 17, 2016 10:23:00 PM CEST Patrick Farrell wrote: > Arnd, > > > The description and the actual patch don't seem to match up. Am I missing > something? Sorry, I pasted the wrong error message when writing the changelog. > From: lustre-devel on behalf of Arnd > Bergmann > Sent: Monday, October 17, 2016 5:08:55 PM > To: Oleg Drokin > Cc: de...@driverdev.osuosl.org; Arnd Bergmann; Greg Kroah-Hartman; > linux-ker...@vger.kernel.org; Linus Torvalds; lustre-de...@lists.lustre.org > Subject: [lustre-devel] [PATCH 08/28] staging: lustre: restore initialization > of return code > > A recent rework removed the initialization of the successful return > code from lpfc_write_firmware: > > drivers/scsi/lpfc/lpfc_init.c: In function 'lpfc_write_firmware': > drivers/scsi/lpfc/lpfc_init.c:10333:214: error: format '%ld' expects argument > of type 'long int', but argument 9 has type 'size_t {aka const unsigned int}' > [-Werror=format=] > > This adds it back. It should have been this warning: drivers/staging/lustre/lustre/lov/lov_pack.c: In function 'lov_getstripe': drivers/staging/lustre/lustre/lov/lov_pack.c:426:9: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized] return rc; ^~ drivers/staging/lustre/lustre/lov/lov_pack.c:313:6: note: 'rc' was declared here Arnd ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/28] net/hyperv: avoid uninitialized variable
The hdr_offset variable is only if we deal with a TCP or UDP packet, but as the check surrounding its usage tests for skb_is_gso() instead, the compiler has no idea if the variable is initialized or not at that point: drivers/net/hyperv/netvsc_drv.c: In function ‘netvsc_start_xmit’: drivers/net/hyperv/netvsc_drv.c:494:42: error: ‘hdr_offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized] This adds an additional check for the transport type, which tells the compiler that this path cannot happen. Since the get_net_transport_info() function should always be inlined here, I don't expect this to result in additional runtime checks. Signed-off-by: Arnd Bergmann --- drivers/net/hyperv/netvsc_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index f0919bd..5d6e75a 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -447,7 +447,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) * Setup the sendside checksum offload only if this is not a * GSO packet. */ - if (skb_is_gso(skb)) { + if ((net_trans_info & (INFO_TCP | INFO_UDP)) && skb_is_gso(skb)) { struct ndis_tcp_lso_info *lso_info; rndis_msg_size += NDIS_LSO_PPI_SIZE; -- 2.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/28] iio: accel: sca3000_core: avoid potentially uninitialized variable
The newly added __sca3000_get_base_freq function handles all valid modes of the SCA3000_REG_ADDR_MODE register, but gcc notices that any other value (i.e. 0x00) causes the base_freq variable to not get initialized: drivers/staging/iio/accel/sca3000_core.c: In function 'sca3000_write_raw': drivers/staging/iio/accel/sca3000_core.c:527:23: error: 'base_freq' may be used uninitialized in this function [-Werror=maybe-uninitialized] This adds explicit error handling for unexpected register values, to ensure this cannot happen. Fixes: e0f3fc9b47e6 ("iio: accel: sca3000_core: implemented IIO_CHAN_INFO_SAMP_FREQ") Signed-off-by: Arnd Bergmann Cc: Ico Doornekamp Cc: Jonathan Cameron --- I submitted this on Sept 22, and Jonathan said he applied it to his 'togreg' tree, but it hasn't appeared in linux-next yet, presumably since this was not considered material for v4.9. If we enable the warning again by default, we may want to have the fix merged for v4.9 after all. drivers/staging/iio/accel/sca3000_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/iio/accel/sca3000_core.c b/drivers/staging/iio/accel/sca3000_core.c index d626125..564b36d 100644 --- a/drivers/staging/iio/accel/sca3000_core.c +++ b/drivers/staging/iio/accel/sca3000_core.c @@ -468,6 +468,8 @@ static inline int __sca3000_get_base_freq(struct sca3000_state *st, case SCA3000_MEAS_MODE_OP_2: *base_freq = info->option_mode_2_freq; break; + default: + ret = -EINVAL; } error_ret: return ret; -- 2.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/28] staging: lustre: remove broken dead code in cfs_cpt_table_create_pattern
After a recent bugfix, we get a warning about the use of an uninitialized variable: drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c: In function 'cfs_cpt_table_create_pattern': drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c:833:7: error: 'str' may be used uninitialized in this function [-Werror=maybe-uninitialized] This part of the function used to not do anything as we would reassign the 'str' pointer to something else right away, but now we pass an uninitialized pointer into 'strchr', which can cause a kernel page fault or worse. Fixes: 239fd5d41f9b ("staging: lustre: libcfs: shortcut to create CPT from NUMA topology") Cc: Liang Zhen Cc: James Simmons Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c index e8b1a61..1226cba 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c @@ -824,13 +824,6 @@ cfs_cpt_table_create_pattern(char *pattern) int ncpt; int c; - for (ncpt = 0;; ncpt++) { /* quick scan bracket */ - str = strchr(str, '['); - if (!str) - break; - str++; - } - str = cfs_trimwhite(pattern); if (*str == 'n' || *str == 'N') { pattern = str + 1; -- 2.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/28] staging: lustre: restore initialization of return code
A recent rework removed the initialization of the successful return code from lpfc_write_firmware: drivers/scsi/lpfc/lpfc_init.c: In function 'lpfc_write_firmware': drivers/scsi/lpfc/lpfc_init.c:10333:214: error: format '%ld' expects argument of type 'long int', but argument 9 has type 'size_t {aka const unsigned int}' [-Werror=format=] This adds it back. Fixes: e10a431b3fd0 ("staging: lustre: lov: move LSM to LOV layer") Cc: John L. Hammond Cc: Jinshan Xiong Cc: James Simmons Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/lov/lov_pack.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c b/drivers/staging/lustre/lustre/lov/lov_pack.c index be6e985..0439f54 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pack.c +++ b/drivers/staging/lustre/lustre/lov/lov_pack.c @@ -474,6 +474,8 @@ int lov_getstripe(struct lov_object *obj, struct lov_stripe_md *lsm, ((struct lov_user_md *)lmmk)->lmm_stripe_count = lum.lmm_stripe_count; if (copy_to_user(lump, lmmk, lmm_size)) rc = -EFAULT; + else + rc = 0; out_free: kfree(lmmk); -- 2.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: lustre: remove class_devno_max
class_devno_max is an inline function that is not used anymore. Hence, it is removed. Signed-off-by: Aya Mahfouz --- drivers/staging/lustre/lustre/include/obd_class.h | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index 6482a93..84f36b0 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -406,11 +406,6 @@ do { \ } \ } while (0) -static inline int class_devno_max(void) -{ - return MAX_OBD_DEVICES; -} - static inline int obd_get_info(const struct lu_env *env, struct obd_export *exp, __u32 keylen, void *key, __u32 *vallen, void *val, -- 2.5.0 -- Kind Regards, Aya Saif El-yazal Mahfouz ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: replace DGNC_VERIFY_BOARD macro
On Mon, Oct 17, 2016 at 10:29 AM, Greg KH wrote: > On Fri, Oct 14, 2016 at 07:22:57PM +0200, Fernando Apesteguia wrote: >> The patch replaces the macro with a function (dgnc_get_board) and >> substitutes the macro statement with a call to that function and a >> comparison on the returned value. >> >> This removes a checkpatch warning. >> >> Signed-off-by: Fernando Apesteguia >> --- >> drivers/staging/dgnc/dgnc_sysfs.c | 74 >> +++ >> 1 file changed, 51 insertions(+), 23 deletions(-) >> >> diff --git a/drivers/staging/dgnc/dgnc_sysfs.c >> b/drivers/staging/dgnc/dgnc_sysfs.c >> index 290bf6e..3ea23a9 100644 >> --- a/drivers/staging/dgnc/dgnc_sysfs.c >> +++ b/drivers/staging/dgnc/dgnc_sysfs.c >> @@ -90,17 +90,21 @@ void dgnc_remove_driver_sysfiles(struct pci_driver >> *dgnc_driver) >> driver_remove_file(driverfs, &driver_attr_pollrate); >> } >> >> -#define DGNC_VERIFY_BOARD(p, bd) \ >> - do {\ >> - if (!p) \ >> - return 0; \ >> - \ >> - bd = dev_get_drvdata(p);\ >> - if (!bd || bd->magic != DGNC_BOARD_MAGIC) \ >> - return 0; \ >> - if (bd->state != BOARD_READY) \ >> - return 0; \ >> - } while (0) >> +static struct dgnc_board *dgnc_get_board(struct device *p) >> +{ >> + struct dgnc_board *bd; >> + >> + if (!p) >> + return NULL; >> + >> + bd = dev_get_drvdata(p); >> + if (!bd || bd->magic != DGNC_BOARD_MAGIC) >> + return NULL; >> + if (bd->state != BOARD_READY) >> + return NULL; >> + >> + return bd; >> +} > > No, this macro should be removed entirely as what it does is pointless > in some parts, wrong in others, and not needed at all in the rest :( > > I've asked others to fix this up properly in the past, but it doesn't > seem like anyone wants to do the work... > I tried to find the discussion the relevant mails in lkml.org but couldn't find them. Could you point me to them so I can have a look? Thanks. > I don't want to take this patch as it will hide the real issues here. > > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: lustre: replace uses of class_devno_max by MAX_OBD_DEVICES
class_devno_max is an inline function that returns MAX_OBD_DEVICES. Replace all calls to the function by MAX_OBD_DEVICES. Signed-off-by: Aya Mahfouz --- drivers/staging/lustre/lustre/obdclass/class_obd.c | 6 +++--- drivers/staging/lustre/lustre/obdclass/genops.c| 22 +++--- .../lustre/lustre/obdclass/linux/linux-module.c| 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index 2b21675..b775c74 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -345,7 +345,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) goto out; } obd = class_name2obd(data->ioc_inlbuf4); - } else if (data->ioc_dev < class_devno_max()) { + } else if (data->ioc_dev < MAX_OBD_DEVICES) { obd = class_num2obd(data->ioc_dev); } else { CERROR("OBD ioctl: No device\n"); @@ -498,7 +498,7 @@ static int __init obdclass_init(void) } /* This struct is already zeroed for us (static global) */ - for (i = 0; i < class_devno_max(); i++) + for (i = 0; i < MAX_OBD_DEVICES; i++) obd_devs[i] = NULL; /* Default the dirty page cache cap to 1/2 of system memory. @@ -548,7 +548,7 @@ static void obdclass_exit(void) lustre_unregister_fs(); misc_deregister(&obd_psdev); - for (i = 0; i < class_devno_max(); i++) { + for (i = 0; i < MAX_OBD_DEVICES; i++) { struct obd_device *obd = class_num2obd(i); if (obd && obd->obd_set_up && diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index 99c2da6..af4fc58 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -290,7 +290,7 @@ struct obd_device *class_newdev(const char *type_name, const char *name) LASSERT(newdev->obd_magic == OBD_DEVICE_MAGIC); write_lock(&obd_dev_lock); - for (i = 0; i < class_devno_max(); i++) { + for (i = 0; i < MAX_OBD_DEVICES; i++) { struct obd_device *obd = class_num2obd(i); if (obd && (strcmp(name, obd->obd_name) == 0)) { @@ -322,9 +322,9 @@ struct obd_device *class_newdev(const char *type_name, const char *name) } write_unlock(&obd_dev_lock); - if (!result && i >= class_devno_max()) { + if (!result && i >= MAX_OBD_DEVICES) { CERROR("all %u OBD devices used, increase MAX_OBD_DEVICES\n", - class_devno_max()); + MAX_OBD_DEVICES); result = ERR_PTR(-EOVERFLOW); goto out; } @@ -372,7 +372,7 @@ int class_name2dev(const char *name) return -1; read_lock(&obd_dev_lock); - for (i = 0; i < class_devno_max(); i++) { + for (i = 0; i < MAX_OBD_DEVICES; i++) { struct obd_device *obd = class_num2obd(i); if (obd && strcmp(name, obd->obd_name) == 0) { @@ -397,7 +397,7 @@ struct obd_device *class_name2obd(const char *name) { int dev = class_name2dev(name); - if (dev < 0 || dev > class_devno_max()) + if (dev < 0 || dev > MAX_OBD_DEVICES) return NULL; return class_num2obd(dev); } @@ -408,7 +408,7 @@ int class_uuid2dev(struct obd_uuid *uuid) int i; read_lock(&obd_dev_lock); - for (i = 0; i < class_devno_max(); i++) { + for (i = 0; i < MAX_OBD_DEVICES; i++) { struct obd_device *obd = class_num2obd(i); if (obd && obd_uuid_equals(uuid, &obd->obd_uuid)) { @@ -435,7 +435,7 @@ struct obd_device *class_num2obd(int num) { struct obd_device *obd = NULL; - if (num < class_devno_max()) { + if (num < MAX_OBD_DEVICES) { obd = obd_devs[num]; if (!obd) return NULL; @@ -463,7 +463,7 @@ struct obd_device *class_find_client_obd(struct obd_uuid *tgt_uuid, int i; read_lock(&obd_dev_lock); - for (i = 0; i < class_devno_max(); i++) { + for (i = 0; i < MAX_OBD_DEVICES; i++) { struct obd_device *obd = class_num2obd(i); if (!obd) @@ -496,13 +496,13 @@ struct obd_device *class_devices_in_group(struct obd_uuid *grp_uuid, int *next) if (!next) i = 0; - else if (*next >= 0 && *next < class_devno_max()) + else if (*next >= 0 && *next < MAX_OBD_DEVICES) i = *next; else return NULL; read_lock(&obd_dev_lock); - for (; i < class_devno_max(); i++) { + for (; i < MAX_OBD_DEVICES; i++) { struct obd_device *obd = class_num2obd(i);
[PATCH 0/2] staging: lustre: replace and remove class_devno_max
class_devno_max is an inline function that is written with the sole purpose of returning the value of MAX_OBD_DEVICES. Since no computations are made by the class_devno_max, replace it with MAX_OBD_DEVICES. Aya Mahfouz (2): staging: lustre: replace uses of class_devno_max by MAX_OBD_DEVICES staging: lustre: remove class_devno_max drivers/staging/lustre/lustre/include/obd_class.h | 5 - drivers/staging/lustre/lustre/obdclass/class_obd.c | 6 +++--- drivers/staging/lustre/lustre/obdclass/genops.c| 22 +++--- .../lustre/lustre/obdclass/linux/linux-module.c| 6 +++--- 4 files changed, 17 insertions(+), 22 deletions(-) -- 2.5.0 -- Kind Regards, Aya Saif El-yazal Mahfouz ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [RFC PATCH v1 21/28] KVM: introduce KVM_SEV_ISSUE_CMD ioctl
> I am not sure if I fully understand this feedback. Let me summaries what > we have right now. > > At highest level SEV key management commands are divided into two sections: > > - platform management : commands used during platform provisioning. PSP > drv provides ioctl's for these commands. Qemu will not use these > ioctl's, i believe these ioctl will be used by other tools. > > - guest management: command used during guest life cycle. PSP drv > exports various function and KVM drv calls these function when it > receives the SEV_ISSUE_CMD ioctl from qemu. > > If I understanding correctly then you are recommending that instead of > exporting various functions from PSP drv we should expose one function > for the all the guest command handling (something like this). My understanding is that a user could exhaust the ASIDs for encrypted VMs if it was allowed to start an arbitrary number of KVM guests. So we would need some kind of control. Is this correct? If so, does /dev/psp provide any functionality that you believe is dangerous for the KVM userspace (which runs in a very confined environment)? Is this functionality blocked through capability checks? Thanks, Paolo > int psp_issue_cmd_external_user(struct file *filep, > int cmd, unsigned long addr, > int *psp_ret) > { > /* here we check to ensure that file->f_ops is a valid >* psp instance. > */ > if (filep->f_ops != &psp_fops) > return -EINVAL; > > /* handle the command */ > return psp_issue_cmd (cmd, addr, timeout, psp_ret); > } > > In KVM driver use something like this to invoke the PSP command handler. > > int kvm_sev_psp_cmd (struct kvm_sev_issue_cmd *input, >unsigned long data) > { > int ret; > struct fd f; > > f = fdget(input->psp_fd); > if (!f.file) > return -EBADF; > > > psp_issue_cmd_external_user(f.file, input->cmd, > data, &input->psp_ret); > > } > > Please let me know if I understood this correctly. > > >> Signed-off-by: Brijesh Singh > >> --- > >> arch/x86/include/asm/kvm_host.h |3 + > >> arch/x86/kvm/x86.c | 13 > >> include/uapi/linux/kvm.h| 125 > >> +++ > >> 3 files changed, 141 insertions(+) > >> > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lov.ko: lov_object.c: fix sparse warning setting function to static
On Mon, Oct 17, 2016 at 03:21:52PM -0400, Ryan Swan wrote: > Fixed: sparse WARNING: symbol 'lov_read_and_clear_async_rc' was not declared. > Should it be static? I don't believe you actually test-built this change :( > > Signed-off-by: Ryan Swan > --- > drivers/staging/lustre/lustre/lov/lov_object.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c > b/drivers/staging/lustre/lustre/lov/lov_object.c > index 82b99e0..c42eef6 100644 > --- a/drivers/staging/lustre/lustre/lov/lov_object.c > +++ b/drivers/staging/lustre/lustre/lov/lov_object.c > @@ -1532,7 +1532,7 @@ struct lov_stripe_md *lov_lsm_addref(struct lov_object > *lov) > return lsm; > } > > -int lov_read_and_clear_async_rc(struct cl_object *clob) > +static int lov_read_and_clear_async_rc(struct cl_object *clob) You are turning a symbol that is explicitly exported into a static one? How is the compiler supposed to figure out what to do when you do that? Again, always test-build your patches so you don't get a grumpy maintainer telling you to test-build your patches... greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: media: bcm2048: Use octal permissions '0444'
On Mon, Oct 17, 2016 at 10:10:08PM +0530, Shyam Saini wrote: > On Mon, 2016-10-17 at 18:07 +0200, Greg KH wrote: > > On Mon, Oct 17, 2016 at 09:24:19PM +0530, Shyam Saini wrote: > > > > > > Fixed following checkpatch warning > > > Symbolic permissions 'S_IRUGO' are not preferred. Consider using > > > octal > > > permissions '0444' > > > > > > Signed-off-by: Shyam Saini > > > --- > > > drivers/staging/media/bcm2048/radio-bcm2048.c | 18 + > > > - > > > 1 file changed, 9 insertions(+), 9 deletions(-) > > > > > > diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c > > > b/drivers/staging/media/bcm2048/radio-bcm2048.c > > > index 5d2b702..9c286c3 100644 > > > --- a/drivers/staging/media/bcm2048/radio-bcm2048.c > > > +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c > > > @@ -2103,21 +2103,21 @@ static struct device_attribute attrs[] = { > > > bcm2048_rds_pi_match_write), > > > __ATTR(rds_wline, 0644, bcm2048_rds_wline_read, > > > bcm2048_rds_wline_write), > > > - __ATTR(rds_pi, S_IRUGO, bcm2048_rds_pi_read, NULL), > > > - __ATTR(rds_rt, S_IRUGO, bcm2048_rds_rt_read, NULL), > > > - __ATTR(rds_ps, S_IRUGO, bcm2048_rds_ps_read, NULL), > > > - __ATTR(fm_rds_flags, S_IRUGO, bcm2048_fm_rds_flags_read, > > > NULL), > > > - __ATTR(region_bottom_frequency, S_IRUGO, > > > + __ATTR(rds_pi, 0444, bcm2048_rds_pi_read, NULL), > > > + __ATTR(rds_rt, 0444, bcm2048_rds_rt_read, NULL), > > > + __ATTR(rds_ps, 0444, bcm2048_rds_ps_read, NULL), > > > + __ATTR(fm_rds_flags, 0444, bcm2048_fm_rds_flags_read, > > > NULL), > > > + __ATTR(region_bottom_frequency, 0444, > > > bcm2048_region_bottom_frequency_read, NULL), > > > > Why not use __ATTR_RO() for all of these instead? > > I just used what checkpatch.pl suggested. Now I'll use __ATTR_RO(). > > Also shouldn't we change checkpatch.pl accordingly ? No, not all octal values should be converted that way. checkpatch is a "hint", not always the exact thing that needs to be done, and sometimes it should be ignored. Please always use your judgement. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/3] doc: add documentation for uio-hv-generic
From: Stephen Hemminger Update UIO documentation to include basic information about uio_hv_generic. Signed-off-by: Stephen Hemminger --- Documentation/DocBook/uio-howto.tmpl | 62 1 file changed, 62 insertions(+) diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl index cd0e452..5210f8a 100644 --- a/Documentation/DocBook/uio-howto.tmpl +++ b/Documentation/DocBook/uio-howto.tmpl @@ -46,6 +46,13 @@ GPL version 2. + 0.10 + 2016-10-17 + sch + Added generic hyperv driver + + + 0.9 2009-07-16 mst @@ -1033,6 +1040,61 @@ int main() + + +Generic Hyper-V UIO driver + + The generic driver is a kernel module named uio_hv_generic. + It supports devices on the Hyper-V VMBus similar to uio_pci_generic + on PCI bus. + + + +Making the driver recognize the device + +Since the driver does not declare any device GUID's, it will not get loaded +automatically and will not automatically bind to any devices, you must load it +and allocate id to the driver yourself. For example, to use the network device +GUID: + + modprobe uio_hv_generic + echo "f8615163-df3e-46c5-913f-f2d2f965ed0e" > /sys/bus/vmbus/drivers/uio_hv_generic/new_id + + + +If there already is a hardware specific kernel driver for the device, the +generic driver still won't bind to it, in this case if you want to use the +generic driver (why would you?) you'll have to manually unbind the hardware +specific driver and bind the generic driver, like this: + + echo -n vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3 > /sys/bus/vmbus/drivers/hv_netvsc/unbind + echo -n vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3 > /sys/bus/vmbus/drivers/uio_hv_generic/bind + + + +You can verify that the device has been bound to the driver +by looking for it in sysfs, for example like the following: + +ls -l /sys/bus/vmbus/devices/vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3/driver + +Which if successful should print + + .../vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3/driver -> ../../../bus/vmbus/drivers/uio_hv_generic + + + + + +Things to know about uio_hv_generic + +On each interrupt, uio_hv_generic sets the Interrupt Disable bit. +This prevents the device from generating further interrupts +until the bit is cleared. The userspace driver should clear this +bit before blocking and waiting for more interrupts. + + + + Further information -- 2.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/3] vmbus: add support for dynamic device id's
From: Stephen Hemminger This patch adds sysfs interface to dynamically bind new UUID values to existing VMBus device. This is useful for generic UIO driver to act similar to uio_pci_generic. Signed-off-by: Stephen Hemminger --- v2 - allow device driver to have empty id table, and fix bugs drivers/hv/vmbus_drv.c | 174 ++--- include/linux/hyperv.h | 6 ++ 2 files changed, 172 insertions(+), 8 deletions(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index a259e18..d8d34bf 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -45,6 +45,11 @@ #include #include "hyperv_vmbus.h" +struct vmbus_dynid { + struct list_head node; + struct hv_vmbus_device_id id; +}; + static struct acpi_device *hv_acpi_dev; static struct completion probe_event; @@ -500,7 +505,7 @@ static ssize_t device_show(struct device *dev, static DEVICE_ATTR_RO(device); /* Set up per device attributes in /sys/bus/vmbus/devices/ */ -static struct attribute *vmbus_attrs[] = { +static struct attribute *vmbus_dev_attrs[] = { &dev_attr_id.attr, &dev_attr_state.attr, &dev_attr_monitor_id.attr, @@ -528,7 +533,7 @@ static struct attribute *vmbus_attrs[] = { &dev_attr_device.attr, NULL, }; -ATTRIBUTE_GROUPS(vmbus); +ATTRIBUTE_GROUPS(vmbus_dev); /* * vmbus_uevent - add uevent for our device @@ -565,10 +570,29 @@ static inline bool is_null_guid(const uuid_le *guid) * Return a matching hv_vmbus_device_id pointer. * If there is no match, return NULL. */ -static const struct hv_vmbus_device_id *hv_vmbus_get_id( - const struct hv_vmbus_device_id *id, +static const struct hv_vmbus_device_id *hv_vmbus_get_id(struct hv_driver *drv, const uuid_le *guid) { + const struct hv_vmbus_device_id *id = NULL; + struct vmbus_dynid *dynid; + + /* Look at the dynamic ids first, before the static ones */ + spin_lock(&drv->dynids.lock); + list_for_each_entry(dynid, &drv->dynids.list, node) { + if (!uuid_le_cmp(dynid->id.guid, *guid)) { + id = &dynid->id; + break; + } + } + spin_unlock(&drv->dynids.lock); + + if (id) + return id; + + id = drv->id_table; + if (id == NULL) + return NULL; /* empty device table */ + for (; !is_null_guid(&id->guid); id++) if (!uuid_le_cmp(id->guid, *guid)) return id; @@ -576,6 +600,134 @@ static const struct hv_vmbus_device_id *hv_vmbus_get_id( return NULL; } +/* vmbus_add_dynid - add a new device ID to this driver and re-probe devices */ +static int vmbus_add_dynid(struct hv_driver *drv, uuid_le *guid) +{ + struct vmbus_dynid *dynid; + + dynid = kzalloc(sizeof(*dynid), GFP_KERNEL); + if (!dynid) + return -ENOMEM; + + dynid->id.guid = *guid; + + spin_lock(&drv->dynids.lock); + list_add_tail(&dynid->node, &drv->dynids.list); + spin_unlock(&drv->dynids.lock); + + return driver_attach(&drv->driver); +} + +static void vmbus_free_dynids(struct hv_driver *drv) +{ + struct vmbus_dynid *dynid, *n; + + spin_lock(&drv->dynids.lock); + list_for_each_entry_safe(dynid, n, &drv->dynids.list, node) { + list_del(&dynid->node); + kfree(dynid); + } + spin_unlock(&drv->dynids.lock); +} + +/* Parse string of form: 1b4e28ba-2fa1-11d2-883f-b9a761bde3f */ +static int get_uuid_le(const char *str, uuid_le *uu) +{ + unsigned int b[16]; + int i; + + if (strlen(str) < 37) + return -1; + + for (i = 0; i < 36; i++) { + switch (i) { + case 8: case 13: case 18: case 23: + if (str[i] != '-') + return -1; + break; + default: + if (!isxdigit(str[i])) + return -1; + } + } + + /* unparse little endian output byte order */ + if (sscanf(str, + "%2x%2x%2x%2x-%2x%2x-%2x%2x-%2x%2x-%2x%2x%2x%2x%2x%2x", + &b[3], &b[2], &b[1], &b[0], + &b[5], &b[4], &b[7], &b[6], &b[8], &b[9], + &b[10], &b[11], &b[12], &b[13], &b[14], &b[15]) != 16) + return -1; + + for (i = 0; i < 16; i++) + uu->b[i] = b[i]; + return 0; +} + +/* + * store_new_id - sysfs frontend to vmbus_add_dynid() + * + * Allow GUIDs to be added to an existing driver via sysfs. + */ +static ssize_t store_new_id(struct device_driver *driver, const char *buf, + size_t count) +{ + struct hv_driver *drv = drv_to_hv_drv(driver); + uuid_le guid = NULL_UUID_LE; + ssize_t retval; + + if (get_uu
[PATCH v2 2/3] uio-hv-generic: new userspace i/o driver for VMBus
From: Stephen Hemminger This is a new driver to enable userspace networking on VMBus. It is based largely on the similar driver that already exists for PCI, and earlier work done by Brocade to support DPDK. Signed-off-by: Stephen Hemminger --- v2 - put in UIO not staging rename to uio-hv-generic (since it is like uio-pci-generic) add example to comment drivers/hv/connection.c | 1 + drivers/uio/Kconfig | 9 ++ drivers/uio/Makefile | 1 + drivers/uio/uio_hv_generic.c | 216 +++ 4 files changed, 227 insertions(+) create mode 100644 drivers/uio/uio_hv_generic.c diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c index 78e6368..6ce8b87 100644 --- a/drivers/hv/connection.c +++ b/drivers/hv/connection.c @@ -39,6 +39,7 @@ struct vmbus_connection vmbus_connection = { .conn_state = DISCONNECTED, .next_gpadl_handle = ATOMIC_INIT(0xE1E10), }; +EXPORT_SYMBOL_GPL(vmbus_connection); /* * Negotiated protocol version with the host. diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig index 52c98ce..7e8dc78 100644 --- a/drivers/uio/Kconfig +++ b/drivers/uio/Kconfig @@ -155,4 +155,13 @@ config UIO_MF624 If you compile this as a module, it will be called uio_mf624. +config UIO_HV_GENERIC + tristate "Generic driver for Hyper-V VMBus" + depends on HYPERV + help + Generic driver that you can bind, dynamically, to any + Hyper-V VMBus device. It is useful to provide direct access + to network and storage devices from userspace. + + If you compile this as a module, it will be called uio_hv_generic. endif diff --git a/drivers/uio/Makefile b/drivers/uio/Makefile index 8560dad..e9663bb 100644 --- a/drivers/uio/Makefile +++ b/drivers/uio/Makefile @@ -9,3 +9,4 @@ obj-$(CONFIG_UIO_NETX) += uio_netx.o obj-$(CONFIG_UIO_PRUSS) += uio_pruss.o obj-$(CONFIG_UIO_MF624) += uio_mf624.o obj-$(CONFIG_UIO_FSL_ELBC_GPCM)+= uio_fsl_elbc_gpcm.o +obj-$(CONFIG_UIO_HV_GENERIC) += uio_hv_generic.o diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c new file mode 100644 index 000..66ea574 --- /dev/null +++ b/drivers/uio/uio_hv_generic.c @@ -0,0 +1,216 @@ +/* + * uio_hv_generic - generic UIO driver for VMBus + * + * Copyright (c) 2013-2016 Brocade Communications Systems, Inc. + * Copyright (c) 2016, Microsoft Corporation. + * + * + * This work is licensed under the terms of the GNU GPL, version 2. + * + * Since the driver does not declare any device ids, you must allocate + * id and bind the device to the driver yourself. For example: + * + * # echo "f8615163-df3e-46c5-913f-f2d2f965ed0e" \ + *> /sys/bus/vmbus/drivers/uio_hv_generic + * # echo -n vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3 \ + *> /sys/bus/vmbus/drivers/hv_netvsc/unbind + * # echo -n vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3 \ + *> /sys/bus/vmbus/drivers/uio_hv_generic/bind + */ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../hv/hyperv_vmbus.h" + +#define DRIVER_VERSION "0.02.0" +#define DRIVER_AUTHOR "Stephen Hemminger " +#define DRIVER_DESC"Generic UIO driver for VMBus devices" + +/* + * List of resources to be mapped to user space + * can be extended up to MAX_UIO_MAPS(5) items + */ +enum hv_uio_map { + TXRX_RING_MAP = 0, + INT_PAGE_MAP, + MON_PAGE_MAP, +}; + +#define HV_RING_SIZE 512 + +struct hv_uio_private_data { + struct uio_info info; + struct hv_device *device; +}; + +static int +hv_uio_mmap(struct uio_info *info, struct vm_area_struct *vma) +{ + int mi; + + if (vma->vm_pgoff >= MAX_UIO_MAPS) + return -EINVAL; + + if (info->mem[vma->vm_pgoff].size == 0) + return -EINVAL; + + mi = (int)vma->vm_pgoff; + + return remap_pfn_range(vma, vma->vm_start, + virt_to_phys((void *)info->mem[mi].addr) >> PAGE_SHIFT, + vma->vm_end - vma->vm_start, vma->vm_page_prot); +} + +/* + * This is the irqcontrol callback to be registered to uio_info. + * It can be used to disable/enable interrupt from user space processes. + * + * @param info + * pointer to uio_info. + * @param irq_state + * state value. 1 to enable interrupt, 0 to disable interrupt. + */ +static int +hv_uio_irqcontrol(struct uio_info *info, s32 irq_state) +{ + struct hv_uio_private_data *pdata = info->priv; + struct hv_device *dev = pdata->device; + + dev->channel->inbound.ring_buffer->interrupt_mask = !irq_state; + virt_mb(); + + return 0; +} + +/* + * Callback from vmbus_event when something is in inbound ring. + */ +static void hv_uio_channel_cb(void *context) +{ + struct hv_uio_private_data *pdata = context; + struct hv_device *dev = pdata->device; + +
[PATCH] staging: lov.ko: lov_object.c: fix sparse warning setting function to static
Fixed: sparse WARNING: symbol 'lov_read_and_clear_async_rc' was not declared. Should it be static? Signed-off-by: Ryan Swan --- drivers/staging/lustre/lustre/lov/lov_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c index 82b99e0..c42eef6 100644 --- a/drivers/staging/lustre/lustre/lov/lov_object.c +++ b/drivers/staging/lustre/lustre/lov/lov_object.c @@ -1532,7 +1532,7 @@ struct lov_stripe_md *lov_lsm_addref(struct lov_object *lov) return lsm; } -int lov_read_and_clear_async_rc(struct cl_object *clob) +static int lov_read_and_clear_async_rc(struct cl_object *clob) { struct lu_object *luobj; int rc = 0; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/14] staging: fsl-mc: update MAINTAINERS
-German has moved on to other things and wished to be removed as a maintainer -cleanup the driver description to use the proper name of the driver (i.e. the fsl-mc bus driver) and remove incorrect references to Freescale Signed-off-by: Stuart Yoder Acked-by: J. German Rivera --- MAINTAINERS | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 1cd38a7..797a08a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5091,8 +5091,7 @@ F:sound/soc/fsl/fsl* F: sound/soc/fsl/imx* F: sound/soc/fsl/mpc8610_hpcd.c -FREESCALE QORIQ MANAGEMENT COMPLEX DRIVER -M: "J. German Rivera" +QORIQ DPAA2 FSL-MC BUS DRIVER M: Stuart Yoder L: linux-ker...@vger.kernel.org S: Maintained -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: fbtft: Fix module autoload
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/staging/fbtft/flexfb.ko | grep alias $ After this patch: $ modinfo drivers/staging/fbtft/flexfb.ko | grep alias alias: platform:flexpfb Signed-off-by: Javier Martinez Canillas --- drivers/staging/fbtft/flexfb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/fbtft/flexfb.c b/drivers/staging/fbtft/flexfb.c index 2dc5f9b6b47e..ded10718712b 100644 --- a/drivers/staging/fbtft/flexfb.c +++ b/drivers/staging/fbtft/flexfb.c @@ -830,6 +830,7 @@ static const struct platform_device_id flexfb_platform_ids[] = { { "flexpfb", 0 }, { }, }; +MODULE_DEVICE_TABLE(platform, flexfb_platform_ids); static struct platform_driver flexfb_platform_driver = { .driver = { -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/14] staging: fsl-mc: uprev binary interface to match MC v10.x
From: Ioana Ciornei DPAA2 will not support MC firmware versions prior to MC v10.x. Update the MC interface code and drivers to reflect this. -update the object .h files and code that builds commands to include the new command version in the command header -object versions are no longer available in the object attributes, so remove references to them and instead get the version from the new get_api_version() command -create/destroy commands for all objects have new arguments -dpmng_get_container_id() is replaced by dprc_get_container_id() All MC firmware versions >= 10 will be supported going forward. Signed-off-by: Ioana Ciornei Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/dpbp-cmd.h| 57 +++- drivers/staging/fsl-mc/bus/dpbp.c| 67 ++-- drivers/staging/fsl-mc/bus/dpmcp-cmd.h | 45 ++-- drivers/staging/fsl-mc/bus/dpmcp.c | 66 +-- drivers/staging/fsl-mc/bus/dpmcp.h | 16 ++ drivers/staging/fsl-mc/bus/dpmng-cmd.h | 13 ++--- drivers/staging/fsl-mc/bus/dpmng.c | 33 drivers/staging/fsl-mc/bus/dprc-cmd.h| 89 +--- drivers/staging/fsl-mc/bus/dprc-driver.c | 19 +-- drivers/staging/fsl-mc/bus/dprc.c| 65 ++- drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 22 ++-- drivers/staging/fsl-mc/bus/mc-sys.c | 8 +-- drivers/staging/fsl-mc/include/dpbp.h| 21 drivers/staging/fsl-mc/include/dprc.h| 19 --- drivers/staging/fsl-mc/include/mc-cmd.h | 41 +++ 15 files changed, 355 insertions(+), 226 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/dpbp-cmd.h b/drivers/staging/fsl-mc/bus/dpbp-cmd.h index 4cc2918..7d86539 100644 --- a/drivers/staging/fsl-mc/bus/dpbp-cmd.h +++ b/drivers/staging/fsl-mc/bus/dpbp-cmd.h @@ -33,37 +33,48 @@ #define _FSL_DPBP_CMD_H /* DPBP Version */ -#define DPBP_VER_MAJOR 2 +#define DPBP_VER_MAJOR 3 #define DPBP_VER_MINOR 2 +/* Command versioning */ +#define DPBP_CMD_BASE_VERSION 1 +#define DPBP_CMD_ID_OFFSET 4 + +#define DPBP_CMD(id) ((id << DPBP_CMD_ID_OFFSET) | DPBP_CMD_BASE_VERSION) + /* Command IDs */ -#define DPBP_CMDID_CLOSE 0x800 -#define DPBP_CMDID_OPEN0x804 -#define DPBP_CMDID_CREATE 0x904 -#define DPBP_CMDID_DESTROY 0x900 - -#define DPBP_CMDID_ENABLE 0x002 -#define DPBP_CMDID_DISABLE 0x003 -#define DPBP_CMDID_GET_ATTR0x004 -#define DPBP_CMDID_RESET 0x005 -#define DPBP_CMDID_IS_ENABLED 0x006 - -#define DPBP_CMDID_SET_IRQ 0x010 -#define DPBP_CMDID_GET_IRQ 0x011 -#define DPBP_CMDID_SET_IRQ_ENABLE 0x012 -#define DPBP_CMDID_GET_IRQ_ENABLE 0x013 -#define DPBP_CMDID_SET_IRQ_MASK0x014 -#define DPBP_CMDID_GET_IRQ_MASK0x015 -#define DPBP_CMDID_GET_IRQ_STATUS 0x016 -#define DPBP_CMDID_CLEAR_IRQ_STATUS0x017 - -#define DPBP_CMDID_SET_NOTIFICATIONS 0x01b0 -#define DPBP_CMDID_GET_NOTIFICATIONS 0x01b1 +#define DPBP_CMDID_CLOSE DPBP_CMD(0x800) +#define DPBP_CMDID_OPENDPBP_CMD(0x804) +#define DPBP_CMDID_CREATE DPBP_CMD(0x904) +#define DPBP_CMDID_DESTROY DPBP_CMD(0x984) +#define DPBP_CMDID_GET_API_VERSION DPBP_CMD(0xa04) + +#define DPBP_CMDID_ENABLE DPBP_CMD(0x002) +#define DPBP_CMDID_DISABLE DPBP_CMD(0x003) +#define DPBP_CMDID_GET_ATTRDPBP_CMD(0x004) +#define DPBP_CMDID_RESET DPBP_CMD(0x005) +#define DPBP_CMDID_IS_ENABLED DPBP_CMD(0x006) + +#define DPBP_CMDID_SET_IRQ DPBP_CMD(0x010) +#define DPBP_CMDID_GET_IRQ DPBP_CMD(0x011) +#define DPBP_CMDID_SET_IRQ_ENABLE DPBP_CMD(0x012) +#define DPBP_CMDID_GET_IRQ_ENABLE DPBP_CMD(0x013) +#define DPBP_CMDID_SET_IRQ_MASKDPBP_CMD(0x014) +#define DPBP_CMDID_GET_IRQ_MASKDPBP_CMD(0x015) +#define DPBP_CMDID_GET_IRQ_STATUS DPBP_CMD(0x016) +#define DPBP_CMDID_CLEAR_IRQ_STATUSDPBP_CMD(0x017) + +#define DPBP_CMDID_SET_NOTIFICATIONS DPBP_CMD(0x01b0) +#define DPBP_CMDID_GET_NOTIFICATIONS DPBP_CMD(0x01b1) struct dpbp_cmd_open { __le32 dpbp_id; }; +struct dpbp_cmd_destroy { + __le32 object_id; +}; + #define DPBP_ENABLE0x1 struct dpbp_rsp_is_enabled { diff --git a/drivers/staging/fsl-mc/bus/dpbp.c b/drivers/staging/fsl-mc/bus/dpbp.c index 122c40d..cf4782f 100644 --- a/dri
[PATCH 13/14] staging: fsl-mc: update copyright dates
Many source files have evolved without copyright date updates. Update the dates to reflect work through 2016. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/dpcon-cmd.h | 2 +- drivers/staging/fsl-mc/bus/dpmcp.h | 2 +- drivers/staging/fsl-mc/bus/dprc-driver.c | 2 +- drivers/staging/fsl-mc/bus/fsl-mc-allocator.c | 2 +- drivers/staging/fsl-mc/bus/fsl-mc-bus.c| 2 +- drivers/staging/fsl-mc/bus/fsl-mc-msi.c| 2 +- drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c | 2 +- drivers/staging/fsl-mc/bus/mc-sys.c| 2 +- drivers/staging/fsl-mc/include/dpbp.h | 2 +- drivers/staging/fsl-mc/include/dpmng.h | 2 +- drivers/staging/fsl-mc/include/dprc.h | 2 +- drivers/staging/fsl-mc/include/mc-bus.h| 2 +- drivers/staging/fsl-mc/include/mc-cmd.h| 2 +- drivers/staging/fsl-mc/include/mc-sys.h| 2 +- drivers/staging/fsl-mc/include/mc.h| 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/dpcon-cmd.h b/drivers/staging/fsl-mc/bus/dpcon-cmd.h index 4ebb3fc..d0a5e19 100644 --- a/drivers/staging/fsl-mc/bus/dpcon-cmd.h +++ b/drivers/staging/fsl-mc/bus/dpcon-cmd.h @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 Freescale Semiconductor Inc. + * Copyright 2013-2016 Freescale Semiconductor Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/drivers/staging/fsl-mc/bus/dpmcp.h b/drivers/staging/fsl-mc/bus/dpmcp.h index 7e70d80..902cddf 100644 --- a/drivers/staging/fsl-mc/bus/dpmcp.h +++ b/drivers/staging/fsl-mc/bus/dpmcp.h @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 Freescale Semiconductor Inc. + * Copyright 2013-2016 Freescale Semiconductor Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c index 6aa2915..b4e46fb 100644 --- a/drivers/staging/fsl-mc/bus/dprc-driver.c +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c @@ -1,7 +1,7 @@ /* * Freescale data path resource container (DPRC) driver * - * Copyright (C) 2014 Freescale Semiconductor, Inc. + * Copyright (C) 2014-2016 Freescale Semiconductor, Inc. * Author: German Rivera * * This file is licensed under the terms of the GNU General Public diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c index 4a7ac97..ce07096 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c @@ -1,7 +1,7 @@ /* * fsl-mc object allocator driver * - * Copyright (C) 2013 Freescale Semiconductor, Inc. + * Copyright (C) 2013-2016 Freescale Semiconductor, Inc. * * This file is licensed under the terms of the GNU General Public * License version 2. This program is licensed "as is" without any diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c index 157d6dc..19a1935 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c @@ -1,7 +1,7 @@ /* * Freescale Management Complex (MC) bus driver * - * Copyright (C) 2014 Freescale Semiconductor, Inc. + * Copyright (C) 2014-2016 Freescale Semiconductor, Inc. * Author: German Rivera * * This file is licensed under the terms of the GNU General Public diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/fsl-mc-msi.c index 3d46b1b..7975c6e 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-msi.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-msi.c @@ -1,7 +1,7 @@ /* * Freescale Management Complex (MC) bus driver MSI support * - * Copyright (C) 2015 Freescale Semiconductor, Inc. + * Copyright (C) 2015-2016 Freescale Semiconductor, Inc. * Author: German Rivera * * This file is licensed under the terms of the GNU General Public diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c index 16b0d4a..6b1cd57 100644 --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c +++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c @@ -1,7 +1,7 @@ /* * Freescale Management Complex (MC) bus driver MSI support * - * Copyright (C) 2015 Freescale Semiconductor, Inc. + * Copyright (C) 2015-2016 Freescale Semiconductor, Inc. * Author: German Rivera * * This file is licensed under the terms of the GNU General Public diff --git a/drivers/staging/fsl-mc/bus/mc-sys.c b/drivers/staging/fsl-mc/bus/mc-sys.c index 7114064..e47bd23 100644 --- a/drivers/staging/fsl-mc/bus/mc-sys.c +++ b/drivers/staging/fsl-mc/bus/mc-sys.c @@ -1,5 +1,5 @@ /* - * Cop
[PATCH 08/14] staging: fsl-mc: cleanup: convert uintX_t types to uX
From: Ioana Ciornei Replace all uses of uintX_t types with uX types in order to comply with kernel coding style and resolve checkpatch warnings. Signed-off-by: Ioana Ciornei Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/dpmcp.h | 84 +++--- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/dpmcp.h b/drivers/staging/fsl-mc/bus/dpmcp.h index fe79d4d..5434e09 100644 --- a/drivers/staging/fsl-mc/bus/dpmcp.h +++ b/drivers/staging/fsl-mc/bus/dpmcp.h @@ -39,16 +39,16 @@ struct fsl_mc_io; int dpmcp_open(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, + u32 cmd_flags, int dpmcp_id, - uint16_t *token); + u16 *token); /* Get portal ID from pool */ #define DPMCP_GET_PORTAL_ID_FROM_POOL (-1) int dpmcp_close(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); + u32 cmd_flags, + u16 token); /** * struct dpmcp_cfg - Structure representing DPMCP configuration @@ -60,17 +60,17 @@ struct dpmcp_cfg { }; int dpmcp_create(struct fsl_mc_io *mc_io, -uint32_t cmd_flags, +u32cmd_flags, const struct dpmcp_cfg *cfg, - uint16_t*token); + u16 *token); int dpmcp_destroy(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); + u32 cmd_flags, + u16 token); int dpmcp_reset(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); + u32 cmd_flags, + u16 token); /* IRQ */ /* IRQ Index */ @@ -85,53 +85,53 @@ int dpmcp_reset(struct fsl_mc_io *mc_io, * @irq_num: A user defined number associated with this IRQ */ struct dpmcp_irq_cfg { -uint64_t paddr; -uint32_t val; +u64paddr; +u32val; intirq_num; }; int dpmcp_set_irq(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, -uint8_tirq_index, + u32 cmd_flags, + u16 token, +u8 irq_index, struct dpmcp_irq_cfg *irq_cfg); int dpmcp_get_irq(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, -uint8_tirq_index, + u32 cmd_flags, + u16 token, +u8 irq_index, int*type, struct dpmcp_irq_cfg *irq_cfg); int dpmcp_set_irq_enable(struct fsl_mc_io *mc_io, -uint32_t cmd_flags, -uint16_t token, - uint8_t irq_index, - uint8_t en); +u32cmd_flags, +u16token, + u8 irq_index, + u8 en); int dpmcp_get_irq_enable(struct fsl_mc_io *mc_io, -uint32_t cmd_flags, -uint16_t token, - uint8_t irq_index, - uint8_t *en); +u32cmd_flags, +u16token, + u8 irq_index, + u8 *en); int dpmcp_set_irq_mask(struct fsl_mc_io*mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t irq_index, - uint32_t mask); + u32 cmd_flags, + u16 token, + u8irq_index, + u32 mask); int dpmcp_get_irq_mask(struct fsl_mc_io*mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t irq_index, - uint32_t *mask); + u32 cmd_flags, + u16 token, + u8irq_index, + u32 *mask); int dpmcp_get_irq_status(struct fsl_mc_io *mc_io, -uint32_t cmd_flags, -uint16_t token, -
[PATCH 06/14] staging: fsl-mc: irq: shorten name of interrupt name
For /proc/interrupts readability, platform bus MSIs are named "ITS-pMSI" in the GIC ITS implementation for that bus. Follow a similar naming convention and call fsl-mc bus MSIs "ITS-fMSI". Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c index 7a6ac64..16b0d4a 100644 --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c +++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c @@ -19,7 +19,7 @@ #include "../include/mc-bus.h" static struct irq_chip its_msi_irq_chip = { - .name = "fsl-mc-bus-msi", + .name = "ITS-fMSI", .irq_mask = irq_chip_mask_parent, .irq_unmask = irq_chip_unmask_parent, .irq_eoi = irq_chip_eoi_parent, -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/14] staging: fsl-mc: improve comment wording
improve and clarify miscellaneous comments -when referring to the bus call it "fsl-mc" -reduce the verbosity of some comments for clarity -improve wording of the slightly confusing term "MC object device" Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/fsl-mc-allocator.c | 68 +-- drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 18 +++ 2 files changed, 42 insertions(+), 44 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c index e92c780..4a7ac97 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c @@ -1,5 +1,5 @@ /* - * Freescale MC object device allocator driver + * fsl-mc object allocator driver * * Copyright (C) 2013 Freescale Semiconductor, Inc. * @@ -23,15 +23,12 @@ strcmp(_obj_type, "dpcon") == 0) /** - * fsl_mc_resource_pool_add_device - add allocatable device to a resource - * pool of a given MC bus + * fsl_mc_resource_pool_add_device - add allocatable object to a resource + * pool of a given fsl-mc bus * - * @mc_bus: pointer to the MC bus - * @pool_type: MC bus pool type - * @mc_dev: Pointer to allocatable MC object device - * - * It adds an allocatable MC object device to a container's resource pool of - * the given resource type + * @mc_bus: pointer to the fsl-mc bus + * @pool_type: pool type + * @mc_dev: pointer to allocatable fsl-mc device */ static int __must_check fsl_mc_resource_pool_add_device(struct fsl_mc_bus *mc_bus, @@ -95,10 +92,10 @@ static int __must_check fsl_mc_resource_pool_add_device(struct fsl_mc_bus * fsl_mc_resource_pool_remove_device - remove an allocatable device from a * resource pool * - * @mc_dev: Pointer to allocatable MC object device + * @mc_dev: pointer to allocatable fsl-mc device * - * It permanently removes an allocatable MC object device from the resource - * pool, the device is currently in, as long as it is in the pool's free list. + * It permanently removes an allocatable fsl-mc device from the resource + * pool. It's an error if the device is in use. */ static int __must_check fsl_mc_resource_pool_remove_device(struct fsl_mc_device *mc_dev) @@ -255,17 +252,18 @@ void fsl_mc_resource_free(struct fsl_mc_resource *resource) EXPORT_SYMBOL_GPL(fsl_mc_resource_free); /** - * fsl_mc_object_allocate - Allocates a MC object device of the given - * pool type from a given MC bus + * fsl_mc_object_allocate - Allocates an fsl-mc object of the given + * pool type from a given fsl-mc bus instance * - * @mc_dev: MC device for which the MC object device is to be allocated - * @pool_type: MC bus resource pool type - * @new_mc_dev: Pointer to area where the pointer to the allocated - * MC object device is to be returned + * @mc_dev: fsl-mc device which is used in conjunction with the + * allocated object + * @pool_type: pool type + * @new_mc_dev: pointer to area where the pointer to the allocated device + * is to be returned * - * This function allocates a MC object device from the device's parent DPRC, - * from the corresponding MC bus' pool of allocatable MC object devices of - * the given resource type. mc_dev cannot be a DPRC itself. + * Allocatable objects are always used in conjunction with some functional + * device. This function allocates an object of the specified type from + * the DPRC containing the functional device. * * NOTE: pool_type must be different from FSL_MC_POOL_MCP, since MC * portals are allocated using fsl_mc_portal_allocate(), instead of @@ -312,10 +310,9 @@ int __must_check fsl_mc_object_allocate(struct fsl_mc_device *mc_dev, EXPORT_SYMBOL_GPL(fsl_mc_object_allocate); /** - * fsl_mc_object_free - Returns an allocatable MC object device to the - * corresponding resource pool of a given MC bus. - * - * @mc_adev: Pointer to the MC object device + * fsl_mc_object_free - Returns an fsl-mc object to the resource + * pool where it came from. + * @mc_adev: Pointer to the fsl-mc device */ void fsl_mc_object_free(struct fsl_mc_device *mc_adev) { @@ -332,8 +329,14 @@ void fsl_mc_object_free(struct fsl_mc_device *mc_adev) EXPORT_SYMBOL_GPL(fsl_mc_object_free); /* - * Initialize the interrupt pool associated with a MC bus. - * It allocates a block of IRQs from the GIC-ITS + * A DPRC and the devices in the DPRC all share the same GIC-ITS device + * ID. A block of IRQs is pre-allocated and maintained in a pool + * from which devices can allocate them when needed. + */ + +/* + * Initialize the interrupt pool associated with an fsl-mc bus. + * It allocates a block of IRQs from the GIC-ITS. */ int fsl_mc_populate_irq_pool(struct fsl_mc_bus *mc_bus, unsigned int irq_count) @@ -395,7 +398,7 @@ int fsl_mc_populate_irq_pool(struct fsl_mc_bus *mc_bus, EXPORT_SYMBOL_GPL(fsl_m
[PATCH 03/14] staging: fsl-mc: clean up Kconfig description
Except for copyrights we are avoiding all references to Freescale, which no longer exists as a brand. Cleanup Freescale references and simplify the Kconfig description of the fsl-mc bus. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/Kconfig | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/Kconfig b/drivers/staging/fsl-mc/bus/Kconfig index 1f95933..aa9c04c 100644 --- a/drivers/staging/fsl-mc/bus/Kconfig +++ b/drivers/staging/fsl-mc/bus/Kconfig @@ -1,25 +1,17 @@ # -# Freescale Management Complex (MC) bus drivers +# DPAA2 fsl-mc bus # -# Copyright (C) 2014 Freescale Semiconductor, Inc. +# Copyright (C) 2014-2016 Freescale Semiconductor, Inc. # # This file is released under the GPLv2 # config FSL_MC_BUS - bool "Freescale Management Complex (MC) bus driver" + bool "QorIQ DPAA2 fsl-mc bus driver" depends on OF && ARM64 select GENERIC_MSI_IRQ_DOMAIN help - Driver to enable the bus infrastructure for the Freescale - QorIQ Management Complex (fsl-mc). The fsl-mc is a hardware - module of the QorIQ LS2 SoCs, that does resource management - for hardware building-blocks in the SoC that can be used - to dynamically create networking hardware objects such as - network interfaces (NICs), crypto accelerator instances, - or L2 switches. - - Only enable this option when building the kernel for - Freescale QorQIQ LS2 SoCs. - - + Driver to enable the bus infrastructure for the QorIQ DPAA2 + architecture. The fsl-mc bus driver handles discovery of + DPAA2 objects (which are represented as Linux devices) and + binding objects to drivers. -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/14] staging: fsl-mc: cleanup and uprev to MC v10.x
This patch does miscellaneous minor cleanup and uprevs the supported MC firmware version to 10.x. I believe with this series the TODO items on our list are complete, with the exception of "Add at least one device driver for a DPAA2 object", which I expect to send a patch for very soon. I plan to do that in conjunction with a request to move the fsl-mc bus driver out of staging. Ioana Ciornei (3): staging: fsl-mc: cleanup: convert uintX_t types to uX staging: fsl-mc: misc whitespace cleanup staging: fsl-mc: uprev binary interface to match MC v10.x Stuart Yoder (11): staging: fsl-mc: cleanup: move dpbp and dpcon cmd headers staging: fsl-mc: add missing includes to fsl-mc-private.h staging: fsl-mc: clean up Kconfig description staging: fsl-mc: update Kconfig dependency staging: fsl-mc: update MAINTAINERS staging: fsl-mc: irq: shorten name of interrupt name staging: fsl-mc: dprc: shorten DPRC interrupt name staging: fsl-mc: cleanup comment style staging: fsl-mc: message cleanup staging: fsl-mc: improve comment wording staging: fsl-mc: update copyright dates MAINTAINERS| 3 +- drivers/staging/fsl-mc/bus/Kconfig | 24 +- drivers/staging/fsl-mc/{include => bus}/dpbp-cmd.h | 61 ++-- drivers/staging/fsl-mc/bus/dpbp.c | 74 ++-- .../staging/fsl-mc/{include => bus}/dpcon-cmd.h| 4 +- drivers/staging/fsl-mc/bus/dpmcp-cmd.h | 49 ++- drivers/staging/fsl-mc/bus/dpmcp.c | 70 +++- drivers/staging/fsl-mc/bus/dpmcp.h | 141 drivers/staging/fsl-mc/bus/dpmng-cmd.h | 14 +- drivers/staging/fsl-mc/bus/dpmng.c | 37 +- drivers/staging/fsl-mc/bus/dprc-cmd.h | 90 ++--- drivers/staging/fsl-mc/bus/dprc-driver.c | 23 +- drivers/staging/fsl-mc/bus/dprc.c | 69 +++- drivers/staging/fsl-mc/bus/fsl-mc-allocator.c | 78 ++-- drivers/staging/fsl-mc/bus/fsl-mc-bus.c| 72 ++-- drivers/staging/fsl-mc/bus/fsl-mc-msi.c| 2 +- drivers/staging/fsl-mc/bus/fsl-mc-private.h| 3 + .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c | 4 +- drivers/staging/fsl-mc/bus/mc-io.c | 4 +- drivers/staging/fsl-mc/bus/mc-sys.c| 12 +- drivers/staging/fsl-mc/include/dpbp.h | 173 + drivers/staging/fsl-mc/include/dpmng.h | 22 +- drivers/staging/fsl-mc/include/dprc.h | 392 +++-- drivers/staging/fsl-mc/include/mc-bus.h| 2 +- drivers/staging/fsl-mc/include/mc-cmd.h| 44 ++- drivers/staging/fsl-mc/include/mc-sys.h| 3 +- drivers/staging/fsl-mc/include/mc.h| 2 +- 27 files changed, 802 insertions(+), 670 deletions(-) rename drivers/staging/fsl-mc/{include => bus}/dpbp-cmd.h (75%) rename drivers/staging/fsl-mc/{include => bus}/dpcon-cmd.h (97%) -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/14] staging: fsl-mc: cleanup: move dpbp and dpcon cmd headers
The dpbp and dpcon cmd header files should not be in the public include directory but should be private to the bus driver. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/{include => bus}/dpbp-cmd.h | 0 drivers/staging/fsl-mc/bus/dpbp.c | 3 ++- drivers/staging/fsl-mc/{include => bus}/dpcon-cmd.h | 0 drivers/staging/fsl-mc/bus/fsl-mc-allocator.c | 4 ++-- 4 files changed, 4 insertions(+), 3 deletions(-) rename drivers/staging/fsl-mc/{include => bus}/dpbp-cmd.h (100%) rename drivers/staging/fsl-mc/{include => bus}/dpcon-cmd.h (100%) diff --git a/drivers/staging/fsl-mc/include/dpbp-cmd.h b/drivers/staging/fsl-mc/bus/dpbp-cmd.h similarity index 100% rename from drivers/staging/fsl-mc/include/dpbp-cmd.h rename to drivers/staging/fsl-mc/bus/dpbp-cmd.h diff --git a/drivers/staging/fsl-mc/bus/dpbp.c b/drivers/staging/fsl-mc/bus/dpbp.c index 5d4cd81..b392745 100644 --- a/drivers/staging/fsl-mc/bus/dpbp.c +++ b/drivers/staging/fsl-mc/bus/dpbp.c @@ -32,7 +32,8 @@ #include "../include/mc-sys.h" #include "../include/mc-cmd.h" #include "../include/dpbp.h" -#include "../include/dpbp-cmd.h" + +#include "dpbp-cmd.h" /** * dpbp_open() - Open a control session for the specified object. diff --git a/drivers/staging/fsl-mc/include/dpcon-cmd.h b/drivers/staging/fsl-mc/bus/dpcon-cmd.h similarity index 100% rename from drivers/staging/fsl-mc/include/dpcon-cmd.h rename to drivers/staging/fsl-mc/bus/dpcon-cmd.h diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c index e93ab53..cf10148 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c @@ -12,9 +12,9 @@ #include #include "../include/mc-bus.h" #include "../include/mc-sys.h" -#include "../include/dpbp-cmd.h" -#include "../include/dpcon-cmd.h" +#include "dpbp-cmd.h" +#include "dpcon-cmd.h" #include "fsl-mc-private.h" #define FSL_MC_IS_ALLOCATABLE(_obj_type) \ -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/14] staging: fsl-mc: misc whitespace cleanup
From: Ioana Ciornei Make whitespace consistent with other fsl-mc source files. -delete extraneous tabs -align start of function arguments properly -for structs and function definitions, separate type and variable name by a single space -remove multiple blank lines in comments Signed-off-by: Ioana Ciornei Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/dpbp-cmd.h | 1 - drivers/staging/fsl-mc/bus/dpbp.c | 1 - drivers/staging/fsl-mc/bus/dpcon-cmd.h | 1 - drivers/staging/fsl-mc/bus/dpmcp-cmd.h | 1 - drivers/staging/fsl-mc/bus/dpmcp.c | 1 - drivers/staging/fsl-mc/bus/dpmcp.h | 107 +-- drivers/staging/fsl-mc/bus/dpmng-cmd.h | 1 - drivers/staging/fsl-mc/bus/dpmng.c | 1 - drivers/staging/fsl-mc/bus/dprc-cmd.h | 1 - drivers/staging/fsl-mc/bus/dprc.c | 1 - drivers/staging/fsl-mc/bus/mc-io.c | 1 - drivers/staging/fsl-mc/bus/mc-sys.c| 1 - drivers/staging/fsl-mc/include/dpbp.h | 148 +++--- drivers/staging/fsl-mc/include/dpmng.h | 16 +- drivers/staging/fsl-mc/include/dprc.h | 342 - 15 files changed, 306 insertions(+), 318 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/dpbp-cmd.h b/drivers/staging/fsl-mc/bus/dpbp-cmd.h index 2860411..489c27f 100644 --- a/drivers/staging/fsl-mc/bus/dpbp-cmd.h +++ b/drivers/staging/fsl-mc/bus/dpbp-cmd.h @@ -11,7 +11,6 @@ * names of any contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * - * * ALTERNATIVELY, this software may be distributed under the terms of the * GNU General Public License ("GPL") as published by the Free Software * Foundation, either version 2 of that License or (at your option) any diff --git a/drivers/staging/fsl-mc/bus/dpbp.c b/drivers/staging/fsl-mc/bus/dpbp.c index b392745..0b2064e 100644 --- a/drivers/staging/fsl-mc/bus/dpbp.c +++ b/drivers/staging/fsl-mc/bus/dpbp.c @@ -11,7 +11,6 @@ * names of any contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * - * * ALTERNATIVELY, this software may be distributed under the terms of the * GNU General Public License ("GPL") as published by the Free Software * Foundation, either version 2 of that License or (at your option) any diff --git a/drivers/staging/fsl-mc/bus/dpcon-cmd.h b/drivers/staging/fsl-mc/bus/dpcon-cmd.h index 536b2ef..c89b305 100644 --- a/drivers/staging/fsl-mc/bus/dpcon-cmd.h +++ b/drivers/staging/fsl-mc/bus/dpcon-cmd.h @@ -11,7 +11,6 @@ * names of any contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * - * * ALTERNATIVELY, this software may be distributed under the terms of the * GNU General Public License ("GPL") as published by the Free Software * Foundation, either version 2 of that License or (at your option) any diff --git a/drivers/staging/fsl-mc/bus/dpmcp-cmd.h b/drivers/staging/fsl-mc/bus/dpmcp-cmd.h index d098a6d..b77c902 100644 --- a/drivers/staging/fsl-mc/bus/dpmcp-cmd.h +++ b/drivers/staging/fsl-mc/bus/dpmcp-cmd.h @@ -11,7 +11,6 @@ * names of any contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * - * * ALTERNATIVELY, this software may be distributed under the terms of the * GNU General Public License ("GPL") as published by the Free Software * Foundation, either version 2 of that License or (at your option) any diff --git a/drivers/staging/fsl-mc/bus/dpmcp.c b/drivers/staging/fsl-mc/bus/dpmcp.c index 55766f7..865572d4 100644 --- a/drivers/staging/fsl-mc/bus/dpmcp.c +++ b/drivers/staging/fsl-mc/bus/dpmcp.c @@ -11,7 +11,6 @@ * names of any contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * - * * ALTERNATIVELY, this software may be distributed under the terms of the * GNU General Public License ("GPL") as published by the Free Software * Foundation, either version 2 of that License or (at your option) any diff --git a/drivers/staging/fsl-mc/bus/dpmcp.h b/drivers/staging/fsl-mc/bus/dpmcp.h index 5434e09..3911f92 100644 --- a/drivers/staging/fsl-mc/bus/dpmcp.h +++ b/drivers/staging/fsl-mc/bus/dpmcp.h @@ -11,7 +11,6 @@ * names of any contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * - * * ALTERNATIVELY, this software may be distributed under the terms of the * GNU General Public License ("GPL") as published by the Free Software * Foundation, either version 2 of that License or (at your option) any @@ -59,10 +58,10 @@ struct dpmcp_cfg { int portal_id; }; -int dpmcp_create(struct fsl_mc_io *mc_io, -u32cmd_flags, -const struct dpmcp_cfg *cfg, -
[PATCH 11/14] staging: fsl-mc: message cleanup
Cleanup and clarify messages -use "fsl-mc" prefix for all messages that don't come from dev_* functions -remove unnecessary verbosity to make things clearer -use explicit __func__ arguments to clarify some error messages -improve misc wording for clarity Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/fsl-mc-allocator.c | 4 ++-- drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 30 +++ 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c index cf10148..e92c780 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c @@ -605,7 +605,7 @@ static int fsl_mc_allocator_probe(struct fsl_mc_device *mc_dev) return error; dev_dbg(&mc_dev->dev, - "Allocatable MC object device bound to fsl_mc_allocator driver"); + "Allocatable fsl-mc device bound to fsl_mc_allocator driver"); return 0; } @@ -627,7 +627,7 @@ static int fsl_mc_allocator_remove(struct fsl_mc_device *mc_dev) } dev_dbg(&mc_dev->dev, - "Allocatable MC object device unbound from fsl_mc_allocator driver"); + "Allocatable fsl-mc device unbound from fsl_mc_allocator driver"); return 0; } diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c index 44f64b6..936e3ee 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c @@ -164,8 +164,7 @@ static int fsl_mc_driver_probe(struct device *dev) error = mc_drv->probe(mc_dev); if (error < 0) { - dev_err(dev, "MC object device probe callback failed: %d\n", - error); + dev_err(dev, "%s failed: %d\n", __func__, error); return error; } @@ -183,9 +182,7 @@ static int fsl_mc_driver_remove(struct device *dev) error = mc_drv->remove(mc_dev); if (error < 0) { - dev_err(dev, - "MC object device remove callback failed: %d\n", - error); + dev_err(dev, "%s failed: %d\n", __func__, error); return error; } @@ -227,13 +224,12 @@ int __fsl_mc_driver_register(struct fsl_mc_driver *mc_driver, error = driver_register(&mc_driver->driver); if (error < 0) { - pr_err("driver_register() failed for %s: %d\n", + pr_err("fsl-mc: driver_register() failed for %s: %d\n", mc_driver->driver.name, error); return error; } - pr_info("MC object device driver %s registered\n", - mc_driver->driver.name); + pr_info("fsl-mc: driver %s registered\n", mc_driver->driver.name); return 0; } EXPORT_SYMBOL_GPL(__fsl_mc_driver_register); @@ -572,8 +568,7 @@ int fsl_mc_device_add(struct dprc_obj_desc *obj_desc, } (void)get_device(&mc_dev->dev); - dev_dbg(parent_dev, "Added MC object device %s\n", - dev_name(&mc_dev->dev)); + dev_dbg(parent_dev, "added %s\n", dev_name(&mc_dev->dev)); *new_mc_dev = mc_dev; return 0; @@ -749,7 +744,7 @@ static int fsl_mc_bus_probe(struct platform_device *pdev) struct mc_version mc_version; struct resource res; - dev_info(&pdev->dev, "Root MC bus device probed"); + dev_info(&pdev->dev, "root DPRC probed"); mc = devm_kzalloc(&pdev->dev, sizeof(*mc), GFP_KERNEL); if (!mc) @@ -783,8 +778,7 @@ static int fsl_mc_bus_probe(struct platform_device *pdev) goto error_cleanup_mc_io; } - dev_info(&pdev->dev, -"Freescale Management Complex Firmware version: %u.%u.%u\n", + dev_info(&pdev->dev, "MC firmware version: %u.%u.%u\n", mc_version.major, mc_version.minor, mc_version.revision); error = get_mc_addr_translation_ranges(&pdev->dev, @@ -840,7 +834,7 @@ static int fsl_mc_bus_remove(struct platform_device *pdev) fsl_destroy_mc_io(mc->root_mc_bus_dev->mc_io); mc->root_mc_bus_dev->mc_io = NULL; - dev_info(&pdev->dev, "Root MC bus device removed"); + dev_info(&pdev->dev, "root DPRC removed"); return 0; } @@ -869,21 +863,21 @@ static int __init fsl_mc_bus_driver_init(void) sizeof(struct fsl_mc_device), 0, 0, NULL); if (!mc_dev_cache) { - pr_err("Could not create fsl_mc_device cache\n"); + pr_err("fsl-mc: could not create fsl_mc_device cache\n"); return -ENOMEM; } error = bus_register(&fsl_mc_bus_type); if (error < 0) { - pr_err("fsl-mc bus type registration failed: %d\n", error); + pr_err("fsl-mc
[PATCH 10/14] staging: fsl-mc: cleanup comment style
Be consistent and use kernel-preferred multi-line comment style everywhere. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/dpbp-cmd.h | 3 ++- drivers/staging/fsl-mc/bus/dpbp.c | 3 ++- drivers/staging/fsl-mc/bus/dpcon-cmd.h | 3 ++- drivers/staging/fsl-mc/bus/dpmcp-cmd.h | 3 ++- drivers/staging/fsl-mc/bus/dpmcp.c | 3 ++- drivers/staging/fsl-mc/bus/dpmcp.h | 6 -- drivers/staging/fsl-mc/bus/dpmng.c | 3 ++- drivers/staging/fsl-mc/bus/dprc.c | 3 ++- drivers/staging/fsl-mc/bus/mc-io.c | 3 ++- drivers/staging/fsl-mc/bus/mc-sys.c | 3 ++- drivers/staging/fsl-mc/include/dpbp.h | 6 -- drivers/staging/fsl-mc/include/dpmng.h | 6 -- drivers/staging/fsl-mc/include/dprc.h | 33 ++--- drivers/staging/fsl-mc/include/mc-cmd.h | 3 ++- drivers/staging/fsl-mc/include/mc-sys.h | 3 ++- 15 files changed, 56 insertions(+), 28 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/dpbp-cmd.h b/drivers/staging/fsl-mc/bus/dpbp-cmd.h index 489c27f..4cc2918 100644 --- a/drivers/staging/fsl-mc/bus/dpbp-cmd.h +++ b/drivers/staging/fsl-mc/bus/dpbp-cmd.h @@ -1,4 +1,5 @@ -/* Copyright 2013-2016 Freescale Semiconductor Inc. +/* + * Copyright 2013-2016 Freescale Semiconductor Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/drivers/staging/fsl-mc/bus/dpbp.c b/drivers/staging/fsl-mc/bus/dpbp.c index 0b2064e..122c40d 100644 --- a/drivers/staging/fsl-mc/bus/dpbp.c +++ b/drivers/staging/fsl-mc/bus/dpbp.c @@ -1,4 +1,5 @@ -/* Copyright 2013-2016 Freescale Semiconductor Inc. +/* + * Copyright 2013-2016 Freescale Semiconductor Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/drivers/staging/fsl-mc/bus/dpcon-cmd.h b/drivers/staging/fsl-mc/bus/dpcon-cmd.h index c89b305..4ebb3fc 100644 --- a/drivers/staging/fsl-mc/bus/dpcon-cmd.h +++ b/drivers/staging/fsl-mc/bus/dpcon-cmd.h @@ -1,4 +1,5 @@ -/* Copyright 2013-2015 Freescale Semiconductor Inc. +/* + * Copyright 2013-2015 Freescale Semiconductor Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/drivers/staging/fsl-mc/bus/dpmcp-cmd.h b/drivers/staging/fsl-mc/bus/dpmcp-cmd.h index b77c902..1073ca2 100644 --- a/drivers/staging/fsl-mc/bus/dpmcp-cmd.h +++ b/drivers/staging/fsl-mc/bus/dpmcp-cmd.h @@ -1,4 +1,5 @@ -/* Copyright 2013-2016 Freescale Semiconductor Inc. +/* + * Copyright 2013-2016 Freescale Semiconductor Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/drivers/staging/fsl-mc/bus/dpmcp.c b/drivers/staging/fsl-mc/bus/dpmcp.c index 865572d4..faade1e 100644 --- a/drivers/staging/fsl-mc/bus/dpmcp.c +++ b/drivers/staging/fsl-mc/bus/dpmcp.c @@ -1,4 +1,5 @@ -/* Copyright 2013-2016 Freescale Semiconductor Inc. +/* + * Copyright 2013-2016 Freescale Semiconductor Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/drivers/staging/fsl-mc/bus/dpmcp.h b/drivers/staging/fsl-mc/bus/dpmcp.h index 3911f92..7e70d80 100644 --- a/drivers/staging/fsl-mc/bus/dpmcp.h +++ b/drivers/staging/fsl-mc/bus/dpmcp.h @@ -1,4 +1,5 @@ -/* Copyright 2013-2015 Freescale Semiconductor Inc. +/* + * Copyright 2013-2015 Freescale Semiconductor Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -31,7 +32,8 @@ #ifndef __FSL_DPMCP_H #define __FSL_DPMCP_H -/* Data Path Management Command Portal API +/* + * Data Path Management Command Portal API * Contains initialization APIs and runtime control APIs for DPMCP */ diff --git a/drivers/staging/fsl-mc/bus/dpmng.c b/drivers/staging/fsl-mc/bus/dpmng.c index 13bec9e..831c6ed 100644 --- a/drivers/staging/fsl-mc/bus/dpmng.c +++ b/drivers/staging/fsl-mc/bus/dpmng.c @@ -1,4 +1,5 @@ -/* Copyright 2013-2016 Freescale Semiconductor Inc. +/* + * Copyright 2013-2016 Freescale Semiconductor Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/drivers/staging/fsl-mc/bus/dprc.c b/drivers/staging/fsl-mc/bus/dprc.c index 24c8dfb..ace3441 100644 --- a/drivers/staging/fsl-mc/bus/dprc.c +++ b/drivers/staging/fsl-mc/bus/dprc.c @@ -1,4 +1,5 @@ -/* Copyright 2013-2016 Freescale Semiconductor Inc. +/* + * Copyright 2013-2016 Freescale Semiconductor Inc. * * Redistribution and use in source and binary forms, with or without * modification, are pe
[PATCH 07/14] staging: fsl-mc: dprc: shorten DPRC interrupt name
improve readibility of the DPRC interrupt name in sysfs by shortening this and just using the device name. There is only one interrupt DPRC used, so no further differentiation is needed. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/dprc-driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c index c5ee463..6aa2915 100644 --- a/drivers/staging/fsl-mc/bus/dprc-driver.c +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c @@ -505,7 +505,7 @@ static int register_dprc_irq_handler(struct fsl_mc_device *mc_dev) dprc_irq0_handler, dprc_irq0_handler_thread, IRQF_NO_SUSPEND | IRQF_ONESHOT, - "FSL MC DPRC irq0", + dev_name(&mc_dev->dev), &mc_dev->dev); if (error < 0) { dev_err(&mc_dev->dev, -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/14] staging: fsl-mc: add missing includes to fsl-mc-private.h
fsl-mc-private.h references several definitions that it does not explicitly have includes for. Up until now we've gotten lucky due to include ordering that things compile. Add the missing includes. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/fsl-mc-private.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-private.h b/drivers/staging/fsl-mc/bus/fsl-mc-private.h index d459c26..5c49c9d 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-private.h +++ b/drivers/staging/fsl-mc/bus/fsl-mc-private.h @@ -10,6 +10,9 @@ #ifndef _FSL_MC_PRIVATE_H_ #define _FSL_MC_PRIVATE_H_ +#include "../include/mc.h" +#include "../include/mc-bus.h" + int __must_check fsl_mc_device_add(struct dprc_obj_desc *obj_desc, struct fsl_mc_io *mc_io, struct device *parent_dev, -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/14] staging: fsl-mc: update Kconfig dependency
The Kconfig dependency previously included ARM64, which is not strictly correct. Change it to ARCH_LAYERSCAPE which is the SoC platform that includes the DPAA2 hardware. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/fsl-mc/bus/Kconfig b/drivers/staging/fsl-mc/bus/Kconfig index aa9c04c..5c009ab 100644 --- a/drivers/staging/fsl-mc/bus/Kconfig +++ b/drivers/staging/fsl-mc/bus/Kconfig @@ -8,7 +8,7 @@ config FSL_MC_BUS bool "QorIQ DPAA2 fsl-mc bus driver" - depends on OF && ARM64 + depends on OF && ARCH_LAYERSCAPE select GENERIC_MSI_IRQ_DOMAIN help Driver to enable the bus infrastructure for the QorIQ DPAA2 -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [RFC PATCH v1 21/28] KVM: introduce KVM_SEV_ISSUE_CMD ioctl
Hi Paolo, On 10/13/2016 05:45 AM, Paolo Bonzini wrote: On 23/08/2016 01:28, Brijesh Singh wrote: The ioctl will be used by qemu to issue the Secure Encrypted Virtualization (SEV) guest commands to transition a guest into into SEV-enabled mode. a typical usage: struct kvm_sev_launch_start start; struct kvm_sev_issue_cmd data; data.cmd = KVM_SEV_LAUNCH_START; data.opaque = &start; ret = ioctl(fd, KVM_SEV_ISSUE_CMD, &data); On SEV command failure, data.ret_code will contain the firmware error code. Please modify the ioctl to require the file descriptor for the PSP. A program without access to /dev/psp should not be able to use SEV. I am not sure if I fully understand this feedback. Let me summaries what we have right now. At highest level SEV key management commands are divided into two sections: - platform management : commands used during platform provisioning. PSP drv provides ioctl's for these commands. Qemu will not use these ioctl's, i believe these ioctl will be used by other tools. - guest management: command used during guest life cycle. PSP drv exports various function and KVM drv calls these function when it receives the SEV_ISSUE_CMD ioctl from qemu. If I understanding correctly then you are recommending that instead of exporting various functions from PSP drv we should expose one function for the all the guest command handling (something like this). int psp_issue_cmd_external_user(struct file *filep, int cmd, unsigned long addr, int *psp_ret) { /* here we check to ensure that file->f_ops is a valid * psp instance. */ if (filep->f_ops != &psp_fops) return -EINVAL; /* handle the command */ return psp_issue_cmd (cmd, addr, timeout, psp_ret); } In KVM driver use something like this to invoke the PSP command handler. int kvm_sev_psp_cmd (struct kvm_sev_issue_cmd *input, unsigned long data) { int ret; struct fd f; f = fdget(input->psp_fd); if (!f.file) return -EBADF; psp_issue_cmd_external_user(f.file, input->cmd, data, &input->psp_ret); } Please let me know if I understood this correctly. Signed-off-by: Brijesh Singh --- arch/x86/include/asm/kvm_host.h |3 + arch/x86/kvm/x86.c | 13 include/uapi/linux/kvm.h| 125 +++ 3 files changed, 141 insertions(+) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: lustre: remove unused identifier OBD_INIT_CHECK
OBD_INIT_CHECK was previously used by a conditional group. This is no longer the case so it can be removed. Signed-off-by: Aya Mahfouz --- drivers/staging/lustre/lustre/obdclass/class_obd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index d9d2a19..2b21675 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -398,7 +398,6 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) return err; } /* class_handle_ioctl */ -#define OBD_INIT_CHECK static int obd_init_checks(void) { __u64 u64val, div64val; -- 2.5.0 -- Kind Regards, Aya Saif El-yazal Mahfouz ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH -next] greybus: arche-platform: Add missing of_node_put() in arche_platform_change_state()
On Mon, Oct 17, 2016 at 04:37:20PM +, Wei Yongjun wrote: > From: Wei Yongjun > > This node pointer is returned by of_find_compatible_node() with > refcount incremented in this function. of_node_put() on it before > exitting this function. > > This is detected by Coccinelle semantic patch. > > Signed-off-by: Wei Yongjun This code is going away eventually, but still. Acked-by: Johan Hovold Thanks, Johan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: media: bcm2048: Use octal permissions '0444'
On Mon, 2016-10-17 at 18:07 +0200, Greg KH wrote: > On Mon, Oct 17, 2016 at 09:24:19PM +0530, Shyam Saini wrote: > > > > Fixed following checkpatch warning > > Symbolic permissions 'S_IRUGO' are not preferred. Consider using > > octal > > permissions '0444' > > > > Signed-off-by: Shyam Saini > > --- > > drivers/staging/media/bcm2048/radio-bcm2048.c | 18 + > > - > > 1 file changed, 9 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c > > b/drivers/staging/media/bcm2048/radio-bcm2048.c > > index 5d2b702..9c286c3 100644 > > --- a/drivers/staging/media/bcm2048/radio-bcm2048.c > > +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c > > @@ -2103,21 +2103,21 @@ static struct device_attribute attrs[] = { > > bcm2048_rds_pi_match_write), > > __ATTR(rds_wline, 0644, bcm2048_rds_wline_read, > > bcm2048_rds_wline_write), > > - __ATTR(rds_pi, S_IRUGO, bcm2048_rds_pi_read, NULL), > > - __ATTR(rds_rt, S_IRUGO, bcm2048_rds_rt_read, NULL), > > - __ATTR(rds_ps, S_IRUGO, bcm2048_rds_ps_read, NULL), > > - __ATTR(fm_rds_flags, S_IRUGO, bcm2048_fm_rds_flags_read, > > NULL), > > - __ATTR(region_bottom_frequency, S_IRUGO, > > + __ATTR(rds_pi, 0444, bcm2048_rds_pi_read, NULL), > > + __ATTR(rds_rt, 0444, bcm2048_rds_rt_read, NULL), > > + __ATTR(rds_ps, 0444, bcm2048_rds_ps_read, NULL), > > + __ATTR(fm_rds_flags, 0444, bcm2048_fm_rds_flags_read, > > NULL), > > + __ATTR(region_bottom_frequency, 0444, > > bcm2048_region_bottom_frequency_read, NULL), > Why not use __ATTR_RO() for all of these instead? I just used what checkpatch.pl suggested. Now I'll use __ATTR_RO(). Also shouldn't we change checkpatch.pl accordingly ? Thanks for correcting me ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH -next] greybus: arche-platform: Add missing of_node_put() in arche_platform_change_state()
From: Wei Yongjun This node pointer is returned by of_find_compatible_node() with refcount incremented in this function. of_node_put() on it before exitting this function. This is detected by Coccinelle semantic patch. Signed-off-by: Wei Yongjun --- drivers/staging/greybus/arche-platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c index a850f6b..389ed36 100644 --- a/drivers/staging/greybus/arche-platform.c +++ b/drivers/staging/greybus/arche-platform.c @@ -128,6 +128,7 @@ int arche_platform_change_state(enum arche_platform_state state, pdev = of_find_device_by_node(np); if (!pdev) { pr_err("arche-platform device not found\n"); + of_node_put(np); return -ENODEV; } ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8188eu: Fix coding style errors
Yes, thanks for the heads up. I'll try to avoid such mistakes in the next patches On Mon, Oct 17, 2016 at 6:29 PM, Greg KH wrote: > On Mon, Oct 17, 2016 at 06:17:21PM +0200, Carlos Maiolino wrote: >> >> --- >> >> drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 28 >> >> +-- >> >> 1 file changed, 14 insertions(+), 14 deletions(-) >> > >> > Any reason you didn't use scripts/get_maintainer.pl to cc: the relevant >> > maintainers and developers of this code? >> > >> > thanks, >> > >> > greg k-h >> >> Not at all Greg, I was going to CC you on the patch too, but I did a >> mistake while adding the list to git send-email, and I needed to >> run git-send-email again, and was afraid to add you again and send you >> two copies of the same patch, but, after I sent it to the list, >> I realized the first try didn't send it to anybody at all, but I had >> already sent it to the list. I apologize, it was a mistake while using >> git-send-email. >> >> Should I re-send it? > > Nah, it's fine, I'll queue it up in a few days, just wanting to make > sure you knew to do that in the future... > > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8188eu: Fix coding style errors
On Mon, Oct 17, 2016 at 06:17:21PM +0200, Carlos Maiolino wrote: > >> --- > >> drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 28 > >> +-- > >> 1 file changed, 14 insertions(+), 14 deletions(-) > > > > Any reason you didn't use scripts/get_maintainer.pl to cc: the relevant > > maintainers and developers of this code? > > > > thanks, > > > > greg k-h > > Not at all Greg, I was going to CC you on the patch too, but I did a > mistake while adding the list to git send-email, and I needed to > run git-send-email again, and was afraid to add you again and send you > two copies of the same patch, but, after I sent it to the list, > I realized the first try didn't send it to anybody at all, but I had > already sent it to the list. I apologize, it was a mistake while using > git-send-email. > > Should I re-send it? Nah, it's fine, I'll queue it up in a few days, just wanting to make sure you knew to do that in the future... thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8188eu: Fix coding style errors
>> --- >> drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 28 >> +-- >> 1 file changed, 14 insertions(+), 14 deletions(-) > > Any reason you didn't use scripts/get_maintainer.pl to cc: the relevant > maintainers and developers of this code? > > thanks, > > greg k-h Not at all Greg, I was going to CC you on the patch too, but I did a mistake while adding the list to git send-email, and I needed to run git-send-email again, and was afraid to add you again and send you two copies of the same patch, but, after I sent it to the list, I realized the first try didn't send it to anybody at all, but I had already sent it to the list. I apologize, it was a mistake while using git-send-email. Should I re-send it? Thanks ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: media: bcm2048: Use octal permissions '0644'
On Mon, Oct 17, 2016 at 09:23:07PM +0530, Shyam Saini wrote: > Fixed following checkpatch.pl warning > WARNING: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. > Consider using octal permissions '0644'. > > Signed-off-by: Shyam Saini > --- > drivers/staging/media/bcm2048/radio-bcm2048.c | 40 > +-- > 1 file changed, 20 insertions(+), 20 deletions(-) > > diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c > b/drivers/staging/media/bcm2048/radio-bcm2048.c > index ea15cc6..5d2b702 100644 > --- a/drivers/staging/media/bcm2048/radio-bcm2048.c > +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c > @@ -2057,51 +2057,51 @@ property_signed_read(fm_rssi, int, "%d") > DEFINE_SYSFS_PROPERTY(region, unsigned, int, "%u", 0) > > static struct device_attribute attrs[] = { > - __ATTR(power_state, S_IRUGO | S_IWUSR, bcm2048_power_state_read, > + __ATTR(power_state, 0644, bcm2048_power_state_read, > bcm2048_power_state_write), Why not use __ATTR_RW() instead? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: media: bcm2048: Use octal permissions '0444'
On Mon, Oct 17, 2016 at 09:24:19PM +0530, Shyam Saini wrote: > Fixed following checkpatch warning > Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal > permissions '0444' > > Signed-off-by: Shyam Saini > --- > drivers/staging/media/bcm2048/radio-bcm2048.c | 18 +- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c > b/drivers/staging/media/bcm2048/radio-bcm2048.c > index 5d2b702..9c286c3 100644 > --- a/drivers/staging/media/bcm2048/radio-bcm2048.c > +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c > @@ -2103,21 +2103,21 @@ static struct device_attribute attrs[] = { > bcm2048_rds_pi_match_write), > __ATTR(rds_wline, 0644, bcm2048_rds_wline_read, > bcm2048_rds_wline_write), > - __ATTR(rds_pi, S_IRUGO, bcm2048_rds_pi_read, NULL), > - __ATTR(rds_rt, S_IRUGO, bcm2048_rds_rt_read, NULL), > - __ATTR(rds_ps, S_IRUGO, bcm2048_rds_ps_read, NULL), > - __ATTR(fm_rds_flags, S_IRUGO, bcm2048_fm_rds_flags_read, NULL), > - __ATTR(region_bottom_frequency, S_IRUGO, > + __ATTR(rds_pi, 0444, bcm2048_rds_pi_read, NULL), > + __ATTR(rds_rt, 0444, bcm2048_rds_rt_read, NULL), > + __ATTR(rds_ps, 0444, bcm2048_rds_ps_read, NULL), > + __ATTR(fm_rds_flags, 0444, bcm2048_fm_rds_flags_read, NULL), > + __ATTR(region_bottom_frequency, 0444, > bcm2048_region_bottom_frequency_read, NULL), Why not use __ATTR_RO() for all of these instead? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8188eu: Fix coding style errors
On Mon, Oct 17, 2016 at 05:39:22PM +0200, Carlos Maiolino wrote: > Fix coding style errors reported by checkpatch.pl, specifically: > > ERROR: space prohibited before that ',' (ctx:WxW) > > This patch get rid of all "ERROR" messages from checkpatch.pl for this file > > Signed-off-by: Carlos Maiolino > --- > drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 28 > +-- > 1 file changed, 14 insertions(+), 14 deletions(-) Any reason you didn't use scripts/get_maintainer.pl to cc: the relevant maintainers and developers of this code? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: media: bcm2048: Use octal permissions '0444'
Fixed following checkpatch warning Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444' Signed-off-by: Shyam Saini --- drivers/staging/media/bcm2048/radio-bcm2048.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c index 5d2b702..9c286c3 100644 --- a/drivers/staging/media/bcm2048/radio-bcm2048.c +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c @@ -2103,21 +2103,21 @@ static struct device_attribute attrs[] = { bcm2048_rds_pi_match_write), __ATTR(rds_wline, 0644, bcm2048_rds_wline_read, bcm2048_rds_wline_write), - __ATTR(rds_pi, S_IRUGO, bcm2048_rds_pi_read, NULL), - __ATTR(rds_rt, S_IRUGO, bcm2048_rds_rt_read, NULL), - __ATTR(rds_ps, S_IRUGO, bcm2048_rds_ps_read, NULL), - __ATTR(fm_rds_flags, S_IRUGO, bcm2048_fm_rds_flags_read, NULL), - __ATTR(region_bottom_frequency, S_IRUGO, + __ATTR(rds_pi, 0444, bcm2048_rds_pi_read, NULL), + __ATTR(rds_rt, 0444, bcm2048_rds_rt_read, NULL), + __ATTR(rds_ps, 0444, bcm2048_rds_ps_read, NULL), + __ATTR(fm_rds_flags, 0444, bcm2048_fm_rds_flags_read, NULL), + __ATTR(region_bottom_frequency, 0444, bcm2048_region_bottom_frequency_read, NULL), - __ATTR(region_top_frequency, S_IRUGO, + __ATTR(region_top_frequency, 0444, bcm2048_region_top_frequency_read, NULL), - __ATTR(fm_carrier_error, S_IRUGO, + __ATTR(fm_carrier_error, 0444, bcm2048_fm_carrier_error_read, NULL), - __ATTR(fm_rssi, S_IRUGO, + __ATTR(fm_rssi, 0444, bcm2048_fm_rssi_read, NULL), __ATTR(region, 0644, bcm2048_region_read, bcm2048_region_write), - __ATTR(rds_data, S_IRUGO, bcm2048_rds_data_read, NULL), + __ATTR(rds_data, 0444, bcm2048_rds_data_read, NULL), }; static int bcm2048_sysfs_unregister_properties(struct bcm2048_device *bdev, -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: media: bcm2048: Use octal permissions '0644'
Fixed following checkpatch.pl warning WARNING: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'. Signed-off-by: Shyam Saini --- drivers/staging/media/bcm2048/radio-bcm2048.c | 40 +-- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c index ea15cc6..5d2b702 100644 --- a/drivers/staging/media/bcm2048/radio-bcm2048.c +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c @@ -2057,51 +2057,51 @@ property_signed_read(fm_rssi, int, "%d") DEFINE_SYSFS_PROPERTY(region, unsigned, int, "%u", 0) static struct device_attribute attrs[] = { - __ATTR(power_state, S_IRUGO | S_IWUSR, bcm2048_power_state_read, + __ATTR(power_state, 0644, bcm2048_power_state_read, bcm2048_power_state_write), - __ATTR(mute, S_IRUGO | S_IWUSR, bcm2048_mute_read, + __ATTR(mute, 0644, bcm2048_mute_read, bcm2048_mute_write), - __ATTR(audio_route, S_IRUGO | S_IWUSR, bcm2048_audio_route_read, + __ATTR(audio_route, 0644, bcm2048_audio_route_read, bcm2048_audio_route_write), - __ATTR(dac_output, S_IRUGO | S_IWUSR, bcm2048_dac_output_read, + __ATTR(dac_output, 0644, bcm2048_dac_output_read, bcm2048_dac_output_write), - __ATTR(fm_hi_lo_injection, S_IRUGO | S_IWUSR, + __ATTR(fm_hi_lo_injection, 0644, bcm2048_fm_hi_lo_injection_read, bcm2048_fm_hi_lo_injection_write), - __ATTR(fm_frequency, S_IRUGO | S_IWUSR, bcm2048_fm_frequency_read, + __ATTR(fm_frequency, 0644, bcm2048_fm_frequency_read, bcm2048_fm_frequency_write), - __ATTR(fm_af_frequency, S_IRUGO | S_IWUSR, + __ATTR(fm_af_frequency, 0644, bcm2048_fm_af_frequency_read, bcm2048_fm_af_frequency_write), - __ATTR(fm_deemphasis, S_IRUGO | S_IWUSR, bcm2048_fm_deemphasis_read, + __ATTR(fm_deemphasis, 0644, bcm2048_fm_deemphasis_read, bcm2048_fm_deemphasis_write), - __ATTR(fm_rds_mask, S_IRUGO | S_IWUSR, bcm2048_fm_rds_mask_read, + __ATTR(fm_rds_mask, 0644, bcm2048_fm_rds_mask_read, bcm2048_fm_rds_mask_write), - __ATTR(fm_best_tune_mode, S_IRUGO | S_IWUSR, + __ATTR(fm_best_tune_mode, 0644, bcm2048_fm_best_tune_mode_read, bcm2048_fm_best_tune_mode_write), - __ATTR(fm_search_rssi_threshold, S_IRUGO | S_IWUSR, + __ATTR(fm_search_rssi_threshold, 0644, bcm2048_fm_search_rssi_threshold_read, bcm2048_fm_search_rssi_threshold_write), - __ATTR(fm_search_mode_direction, S_IRUGO | S_IWUSR, + __ATTR(fm_search_mode_direction, 0644, bcm2048_fm_search_mode_direction_read, bcm2048_fm_search_mode_direction_write), - __ATTR(fm_search_tune_mode, S_IRUGO | S_IWUSR, + __ATTR(fm_search_tune_mode, 0644, bcm2048_fm_search_tune_mode_read, bcm2048_fm_search_tune_mode_write), - __ATTR(rds, S_IRUGO | S_IWUSR, bcm2048_rds_read, + __ATTR(rds, 0644, bcm2048_rds_read, bcm2048_rds_write), - __ATTR(rds_b_block_mask, S_IRUGO | S_IWUSR, + __ATTR(rds_b_block_mask, 0644, bcm2048_rds_b_block_mask_read, bcm2048_rds_b_block_mask_write), - __ATTR(rds_b_block_match, S_IRUGO | S_IWUSR, + __ATTR(rds_b_block_match, 0644, bcm2048_rds_b_block_match_read, bcm2048_rds_b_block_match_write), - __ATTR(rds_pi_mask, S_IRUGO | S_IWUSR, bcm2048_rds_pi_mask_read, + __ATTR(rds_pi_mask, 0644, bcm2048_rds_pi_mask_read, bcm2048_rds_pi_mask_write), - __ATTR(rds_pi_match, S_IRUGO | S_IWUSR, bcm2048_rds_pi_match_read, + __ATTR(rds_pi_match, 0644, bcm2048_rds_pi_match_read, bcm2048_rds_pi_match_write), - __ATTR(rds_wline, S_IRUGO | S_IWUSR, bcm2048_rds_wline_read, + __ATTR(rds_wline, 0644, bcm2048_rds_wline_read, bcm2048_rds_wline_write), __ATTR(rds_pi, S_IRUGO, bcm2048_rds_pi_read, NULL), __ATTR(rds_rt, S_IRUGO, bcm2048_rds_rt_read, NULL), @@ -2115,7 +2115,7 @@ static struct device_attribute attrs[] = { bcm2048_fm_carrier_error_read, NULL), __ATTR(fm_rssi, S_IRUGO, bcm2048_fm_rssi_read, NULL), - __ATTR(region, S_IRUGO | S_IWUSR, bcm2048_region_read, + __ATTR(region, 0644, bcm2048_region_read, bcm2048_region_write), __ATTR(rds_data, S_IRUGO, bcm2048_rds_data_read, NULL), }; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 0/4] Add support for led triggers on phy link state change
Fix skge driver that declared enum contants that conflicted with enum constants in linux/leds.h Create function that encapsulates actions taken during the adjust phy link step of phy state changes. Create function that provides list of speeds currently supported by the phy. Add support for led triggers on phy link state changes by adding a config option. When set the config option will create a set of led triggers for each phy device. Users can use the led triggers to represent link state changes on the phy. v2: * New patch that creates phy_adjust_link function to encapsulate actions taken when adjusting phy link during phy state changes * led trigger speed strings changed to match existing phy speed strings * New function that maps speeds to led triggers * Replace magic constants with definitions when declaring trigger name buffer and number of triggers. v3: * Changed LED_ON to LED_REG_ON in skge driver to avoid possible future conflict and improve consistency. * Dropped rtl8712 patch that was accepted separately. v4: * tweaked commit message v5 * Changed commit message to explain relationship between the new triggers and leds driven by phys. * Added new patch that creates phy_supported_speeds function. * Moved phy_leds_triggers_register and phy_leds_triggers_unregister to phy_attach and phy_detach respectively. This change is so the phydev->supported field will be filled by the time the triggers are registered. * Changed hardcoded list of triggers to dynamic list determined by speeds return by phy_supported_speeds. Zach Brown (4): skge: Rename LED_OFF and LED_ON in marvel skge driver to avoid conflicts with leds namespace net: phy: Encapsulate actions performed during link state changes into function phy_adjust_link net: phy: Create phy_supported_speeds function which lists speeds currently supported by a phydevice net: phy: leds: add support for led triggers on phy link state change drivers/net/ethernet/marvell/skge.c | 6 +- drivers/net/ethernet/marvell/skge.h | 4 +- drivers/net/phy/Kconfig | 13 drivers/net/phy/Makefile| 1 + drivers/net/phy/phy.c | 57 --- drivers/net/phy/phy_device.c| 5 ++ drivers/net/phy/phy_led_triggers.c | 136 include/linux/phy.h | 22 ++ include/linux/phy_led_triggers.h| 51 ++ 9 files changed, 282 insertions(+), 13 deletions(-) create mode 100644 drivers/net/phy/phy_led_triggers.c create mode 100644 include/linux/phy_led_triggers.h -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 2/4] net: phy: Encapsulate actions performed during link state changes into function phy_adjust_link
During phy state machine state transitions some set of actions should occur whenever the link state changes. These actions should be encapsulated into a single function This patch adds the phy_adjust_link function, which is called whenever phydev->adjust_link would have been called before. Actions that should occur whenever the phy link is adjusted can now be added to the phy_adjust_link function. Signed-off-by: Zach Brown --- drivers/net/phy/phy.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index c6f6683..f5721db 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -893,6 +893,11 @@ void phy_start(struct phy_device *phydev) } EXPORT_SYMBOL(phy_start); +static void phy_adjust_link(struct phy_device *phydev) +{ + phydev->adjust_link(phydev->attached_dev); +} + /** * phy_state_machine - Handle the state machine * @work: work_struct that describes the work to be done @@ -935,7 +940,7 @@ void phy_state_machine(struct work_struct *work) if (!phydev->link) { phydev->state = PHY_NOLINK; netif_carrier_off(phydev->attached_dev); - phydev->adjust_link(phydev->attached_dev); + phy_adjust_link(phydev); break; } @@ -948,7 +953,7 @@ void phy_state_machine(struct work_struct *work) if (err > 0) { phydev->state = PHY_RUNNING; netif_carrier_on(phydev->attached_dev); - phydev->adjust_link(phydev->attached_dev); + phy_adjust_link(phydev); } else if (0 == phydev->link_timeout--) needs_aneg = true; @@ -975,7 +980,7 @@ void phy_state_machine(struct work_struct *work) } phydev->state = PHY_RUNNING; netif_carrier_on(phydev->attached_dev); - phydev->adjust_link(phydev->attached_dev); + phy_adjust_link(phydev); } break; case PHY_FORCING: @@ -991,7 +996,7 @@ void phy_state_machine(struct work_struct *work) needs_aneg = true; } - phydev->adjust_link(phydev->attached_dev); + phy_adjust_link(phydev); break; case PHY_RUNNING: /* Only register a CHANGE if we are polling and link changed @@ -1020,7 +1025,7 @@ void phy_state_machine(struct work_struct *work) netif_carrier_off(phydev->attached_dev); } - phydev->adjust_link(phydev->attached_dev); + phy_adjust_link(phydev); if (phy_interrupt_is_valid(phydev)) err = phy_config_interrupt(phydev, @@ -1030,7 +1035,7 @@ void phy_state_machine(struct work_struct *work) if (phydev->link) { phydev->link = 0; netif_carrier_off(phydev->attached_dev); - phydev->adjust_link(phydev->attached_dev); + phy_adjust_link(phydev); do_suspend = true; } break; @@ -1054,7 +1059,7 @@ void phy_state_machine(struct work_struct *work) } else { phydev->state = PHY_NOLINK; } - phydev->adjust_link(phydev->attached_dev); + phy_adjust_link(phydev); } else { phydev->state = PHY_AN; phydev->link_timeout = PHY_AN_TIMEOUT; @@ -1070,7 +1075,7 @@ void phy_state_machine(struct work_struct *work) } else { phydev->state = PHY_NOLINK; } - phydev->adjust_link(phydev->attached_dev); + phy_adjust_link(phydev); } break; } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 1/4] skge: Rename LED_OFF and LED_ON in marvel skge driver to avoid conflicts with leds namespace
Adding led support for phy causes namespace conflicts for some phy drivers. The marvel skge driver declared an enum for representing the states of Link LED Register. The enum contained constant LED_OFF which conflicted with declartation found in linux/leds.h. LED_OFF changed to LED_REG_OFF Also changed LED_ON to LED_REG_ON to avoid possible future conflict and for consistency. Signed-off-by: Zach Brown --- drivers/net/ethernet/marvell/skge.c | 6 +++--- drivers/net/ethernet/marvell/skge.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c index 7173836..783df01 100644 --- a/drivers/net/ethernet/marvell/skge.c +++ b/drivers/net/ethernet/marvell/skge.c @@ -1048,7 +1048,7 @@ static const char *skge_pause(enum pause_status status) static void skge_link_up(struct skge_port *skge) { skge_write8(skge->hw, SK_REG(skge->port, LNK_LED_REG), - LED_BLK_OFF|LED_SYNC_OFF|LED_ON); + LED_BLK_OFF|LED_SYNC_OFF|LED_REG_ON); netif_carrier_on(skge->netdev); netif_wake_queue(skge->netdev); @@ -1062,7 +1062,7 @@ static void skge_link_up(struct skge_port *skge) static void skge_link_down(struct skge_port *skge) { - skge_write8(skge->hw, SK_REG(skge->port, LNK_LED_REG), LED_OFF); + skge_write8(skge->hw, SK_REG(skge->port, LNK_LED_REG), LED_REG_OFF); netif_carrier_off(skge->netdev); netif_stop_queue(skge->netdev); @@ -2668,7 +2668,7 @@ static int skge_down(struct net_device *dev) if (hw->ports == 1) free_irq(hw->pdev->irq, hw); - skge_write8(skge->hw, SK_REG(skge->port, LNK_LED_REG), LED_OFF); + skge_write8(skge->hw, SK_REG(skge->port, LNK_LED_REG), LED_REG_OFF); if (is_genesis(hw)) genesis_stop(skge); else diff --git a/drivers/net/ethernet/marvell/skge.h b/drivers/net/ethernet/marvell/skge.h index a2eb341..3ea151f 100644 --- a/drivers/net/ethernet/marvell/skge.h +++ b/drivers/net/ethernet/marvell/skge.h @@ -662,8 +662,8 @@ enum { LED_BLK_OFF = 1<<4, /* Link LED Blinking Off */ LED_SYNC_ON = 1<<3, /* Use Sync Wire to switch LED */ LED_SYNC_OFF= 1<<2, /* Disable Sync Wire Input */ - LED_ON = 1<<1, /* switch LED on */ - LED_OFF = 1<<0, /* switch LED off */ + LED_REG_ON = 1<<1, /* switch LED on */ + LED_REG_OFF = 1<<0, /* switch LED off */ }; /* Receive GMAC FIFO (YUKON) */ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 4/4] net: phy: leds: add support for led triggers on phy link state change
Create an option CONFIG_LED_TRIGGER_PHY (default n), which will create a set of led triggers for each instantiated PHY device. There is one LED trigger per link-speed, per-phy. The triggers are registered during phy_attach and unregistered during phy_detach. This allows for a user to configure their system to allow a set of LEDs not controlled by the phy to represent link state changes on the phy. LEDS controlled by the phy are unaffected. For example, we have a board where some of the leds in the RJ45 socket are controlled by the phy, but others are not. Using the triggers provided by this patch the leds not controlled by the phy can be configured to show the current speed of the ethernet connection. The leds controlled by the phy are unaffected. Signed-off-by: Josh Cartwright Signed-off-by: Nathan Sullivan Signed-off-by: Zach Brown --- drivers/net/phy/Kconfig| 13 drivers/net/phy/Makefile | 1 + drivers/net/phy/phy.c | 1 + drivers/net/phy/phy_device.c | 5 ++ drivers/net/phy/phy_led_triggers.c | 136 + include/linux/phy.h| 7 ++ include/linux/phy_led_triggers.h | 51 ++ 7 files changed, 214 insertions(+) create mode 100644 drivers/net/phy/phy_led_triggers.c create mode 100644 include/linux/phy_led_triggers.h diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index 5078a0d..54c8eb8 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -15,6 +15,19 @@ if PHYLIB config SWPHY bool +config LED_TRIGGER_PHY + bool "Support LED triggers for tracking link state" + depends on LEDS_TRIGGERS + ---help--- + Adds support for a set of LED trigger events per-PHY. Link + state change will trigger the events, for consumption by an + LED class driver. There are triggers for each link speed currently + supported by the phy, and are of the form: + :: + + Where speed is in the form: + Mbps or Gbps + comment "MDIO bus device drivers" config MDIO_BCM_IPROC diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile index e58667d..86d12cd 100644 --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile @@ -2,6 +2,7 @@ libphy-y := phy.o phy_device.o mdio_bus.o mdio_device.o libphy-$(CONFIG_SWPHY) += swphy.o +libphy-$(CONFIG_LED_TRIGGER_PHY) += phy_led_triggers.o obj-$(CONFIG_PHYLIB) += libphy.o diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 82ee233..ef0e3d0 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -931,6 +931,7 @@ EXPORT_SYMBOL(phy_start); static void phy_adjust_link(struct phy_device *phydev) { phydev->adjust_link(phydev->attached_dev); + phy_led_trigger_change_speed(phydev); } /** diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index e977ba9..b41ebd5 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -916,6 +917,8 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, else phy_resume(phydev); + phy_led_triggers_register(phydev); + return err; error: @@ -989,6 +992,8 @@ void phy_detach(struct phy_device *phydev) } } + phy_led_triggers_unregister(phydev); + /* * The phydev might go away on the put_device() below, so avoid * a use-after-free bug by reading the underlying bus first. diff --git a/drivers/net/phy/phy_led_triggers.c b/drivers/net/phy/phy_led_triggers.c new file mode 100644 index 000..cda600a --- /dev/null +++ b/drivers/net/phy/phy_led_triggers.c @@ -0,0 +1,136 @@ +/* Copyright (C) 2016 National Instruments Corp. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ +#include +#include +#include + +static struct phy_led_trigger *phy_speed_to_led_trigger(struct phy_device *phy, + unsigned int speed) +{ + unsigned int i; + + for (i = 0; i < phy->phy_num_led_triggers; i++) { + if (phy->phy_led_triggers[i].speed == speed) + return &phy->phy_led_triggers[i]; + } + return NULL; +} + +void phy_led_trigger_change_speed(struct phy_device *phy) +{ + struct phy_led_trigger *plt; + + if (!phy-
[PATCH v5 3/4] net: phy: Create phy_supported_speeds function which lists speeds currently supported by a phydevice
phy_supported_speeds provides a means to get a list of all the speeds a phy device currently supports. Signed-off-by: Zach Brown --- drivers/net/phy/phy.c | 35 +++ include/linux/phy.h | 15 +++ 2 files changed, 50 insertions(+) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index f5721db..82ee233 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -261,6 +261,41 @@ static inline unsigned int phy_find_valid(unsigned int idx, u32 features) } /** + * phy_supported_speeds - return all speeds currently supported by a phy device + * @phy: The phy device to return supported speeds of. + * @speeds: buffer to store supported speeds in. + * @size: size of speeds buffer. + * + * Description: Returns the number of supported speeds, and fills the speeds + * buffer with the supported speeds. If speeds buffer is too small to contain + * all currently supported speeds, will return as many speeds as can fit. + */ +unsigned int phy_supported_speeds(struct phy_device *phy, + unsigned int *speeds, + unsigned int size) +{ + unsigned int count = 0; + unsigned int idx = 0; + + while (idx < MAX_NUM_SETTINGS && count < size) { + idx = phy_find_valid(idx, phy->supported); + + if (!(settings[idx].setting & phy->supported)) + break; + + /* Assumes settings are grouped by speed */ + if ((count == 0) || + (speeds[count - 1] != settings[idx].speed)) { + speeds[count] = settings[idx].speed; + count++; + } + idx++; + } + + return count; +} + +/** * phy_check_valid - check if there is a valid PHY setting which matches * speed, duplex, and feature mask * @speed: speed to match diff --git a/include/linux/phy.h b/include/linux/phy.h index e25f183..8761f30 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -85,6 +85,21 @@ typedef enum { } phy_interface_t; /** + * phy_supported_speeds - return all speeds currently supported by a phy device + * @phy: The phy device to return supported speeds of. + * @speeds: buffer to store supported speeds in. + * @size: size of speeds buffer. + * + * Description: Returns the number of supported speeds, and + * fills the speeds * buffer with the supported speeds. If speeds buffer is + * too small to contain * all currently supported speeds, will return as + * many speeds as can fit. + */ +unsigned int phy_supported_speeds(struct phy_device *phy, + unsigned int *speeds, + unsigned int size); + +/** * It maps 'enum phy_interface_t' found in include/linux/phy.h * into the device tree binding of 'phy-mode', so that Ethernet * device driver can get phy interface from device tree. -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/5] [media] st-cec: Fix module autoload
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/staging/media//st-cec/stih-cec.ko | grep alias $ After this patch: $ modinfo drivers/staging/media//st-cec/stih-cec.ko | grep alias alias: of:N*T*Cst,stih-cecC* alias: of:N*T*Cst,stih-cec Signed-off-by: Javier Martinez Canillas --- drivers/staging/media/st-cec/stih-cec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/media/st-cec/stih-cec.c b/drivers/staging/media/st-cec/stih-cec.c index 214344866a6b..19d3ff30c8f8 100644 --- a/drivers/staging/media/st-cec/stih-cec.c +++ b/drivers/staging/media/st-cec/stih-cec.c @@ -363,6 +363,7 @@ static const struct of_device_id stih_cec_match[] = { }, {}, }; +MODULE_DEVICE_TABLE(of, stih_cec_match); static struct platform_driver stih_cec_pdrv = { .probe = stih_cec_probe, -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/5] [media] s5p-cec: Fix module autoload
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/staging/media/s5p-cec/s5p-cec.ko | grep alias $ After this patch: $ modinfo drivers/staging/media/s5p-cec/s5p-cec.ko | grep alias alias: of:N*T*Csamsung,s5p-cecC* alias: of:N*T*Csamsung,s5p-cec Signed-off-by: Javier Martinez Canillas --- drivers/staging/media/s5p-cec/s5p_cec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/media/s5p-cec/s5p_cec.c b/drivers/staging/media/s5p-cec/s5p_cec.c index 1780a08b73c9..4e41f72dbfaa 100644 --- a/drivers/staging/media/s5p-cec/s5p_cec.c +++ b/drivers/staging/media/s5p-cec/s5p_cec.c @@ -263,6 +263,7 @@ static const struct of_device_id s5p_cec_match[] = { }, {}, }; +MODULE_DEVICE_TABLE(of, s5p_cec_match); static struct platform_driver s5p_cec_pdrv = { .probe = s5p_cec_probe, -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/5] [media] Fix module autoload for media platform drivers
Hello Mauro, I noticed that module autoload won't be working in a bunch of media platform drivers because the module alias information is not filled in the modules. This patch series contains the fixes for them. Best regards, Javier Javier Martinez Canillas (5): [media] v4l: vsp1: Fix module autoload for OF registration [media] v4l: rcar-fcp: Fix module autoload for OF registration [media] rc: meson-ir: Fix module autoload [media] s5p-cec: Fix module autoload [media] st-cec: Fix module autoload drivers/media/platform/rcar-fcp.c | 1 + drivers/media/platform/vsp1/vsp1_drv.c | 1 + drivers/media/rc/meson-ir.c | 1 + drivers/staging/media/s5p-cec/s5p_cec.c | 1 + drivers/staging/media/st-cec/stih-cec.c | 1 + 5 files changed, 5 insertions(+) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: Fix coding style errors
Fix coding style errors reported by checkpatch.pl, specifically: ERROR: space prohibited before that ',' (ctx:WxW) This patch get rid of all "ERROR" messages from checkpatch.pl for this file Signed-off-by: Carlos Maiolino --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 28 +-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index c94700c..d9c1147 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -669,10 +669,10 @@ static int issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pss get_rate_set(padapter, bssrate, &bssrate_len); if (bssrate_len > 8) { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , 8, bssrate, &(pattrib->pktlen)); - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, 8, bssrate, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); } else { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, bssrate_len, bssrate, &(pattrib->pktlen)); } /* add wps_ie for wps2.0 */ @@ -1001,7 +1001,7 @@ static void issue_asocrsp(struct adapter *padapter, unsigned short status, } if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_REALTEK) - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 6 , REALTEK_96B_IE, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 6, REALTEK_96B_IE, &(pattrib->pktlen)); /* add WPS IE ie for wps 2.0 */ if (pmlmepriv->wps_assoc_resp_ie && pmlmepriv->wps_assoc_resp_ie_len > 0) { @@ -1122,10 +1122,10 @@ static void issue_assocreq(struct adapter *padapter) if (bssrate_len > 8) { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , 8, bssrate, &(pattrib->pktlen)); - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, 8, bssrate, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); } else { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, bssrate_len, bssrate, &(pattrib->pktlen)); } /* RSN */ @@ -1167,7 +1167,7 @@ static void issue_assocreq(struct adapter *padapter) memcpy(&pmlmeinfo->HT_caps.mcs, MCS_rate_2R, 16); break; } - pframe = rtw_set_ie(pframe, _HT_CAPABILITY_IE_, ie_len , (u8 *)(&(pmlmeinfo->HT_caps)), &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, _HT_CAPABILITY_IE_, ie_len, (u8 *)(&(pmlmeinfo->HT_caps)), &(pattrib->pktlen)); } } @@ -1196,7 +1196,7 @@ static void issue_assocreq(struct adapter *padapter) } if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_REALTEK) - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 6 , REALTEK_96B_IE, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 6, REALTEK_96B_IE, &(pattrib->pktlen)); pattrib->last_txcmdsz = pattrib->pktlen; dump_mgntframe(padapter, pmgntframe); @@ -2646,7 +2646,7 @@ static unsigned int OnBeacon(struct adapter *padapter, ret = rtw_check_bcn_info(padapter, pframe, len); if (!ret) { DBG_88E_LEVEL(_drv_info_, "ap has changed, disconnect now\n "); - receive_disconnect(padapter, pmlmeinfo->network.MacAddress , 65535); + receive_disconnect(padapter, pmlmeinfo->network.MacAddress, 65535); return _SUCCESS; } /* update WMM, ERP in the beacon */ @@ -2804,7 +2804,7 @@ static unsigned int OnAuth(struct adapter *padapter, /* checking for challenging txt... */ DBG_88E("checking for challenging txt...\n"); - p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + 4 + _AUTH_IE_OFFSET_ , _CHLGETXT_IE_, (int *)&ie_len, + p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + 4 + _AUTH_IE_OFFSET_, _CHLGE
Re: [PATCH] staging: greybus: audio: Rename cport with intf_id
On Sun, Oct 16, 2016 at 03:29:14PM +0530, Pankaj Bharadiya wrote: > gb_audio_manager_module_descriptor's cport field is actually used to > manage and pass interface id to user space. > > Thus rename gb_audio_manager_module_descriptor's 'cport' field and > few other things to avoid confusion. Please be more specific about what these other things are; in this case sysfs attributes, uevent vars, and an odd-looking sysfs-string interface (more?). Wouldn't this change break any current user-space implementation? Also why aren't any of these attributes documented as they should be? Thanks, Johan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: greybus: es2: Use kmemdup instead of kmalloc and memcpy
[+CC: staging list ] On Sun, Oct 16, 2016 at 02:19:48PM +0530, sayli karnik wrote: > This patch replaces kmalloc and memcpy with kmemdup for duplication of > memory. > > Signed-off-by: sayli karnik Acked-by: Johan Hovold > --- > drivers/staging/greybus/es2.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/staging/greybus/es2.c b/drivers/staging/greybus/es2.c > index 071bb1c..8eabc71 100644 > --- a/drivers/staging/greybus/es2.c > +++ b/drivers/staging/greybus/es2.c > @@ -175,10 +175,9 @@ static int output_sync(struct es2_ap_dev *es2, void > *req, u16 size, u8 cmd) > u8 *data; > int retval; > > - data = kmalloc(size, GFP_KERNEL); > + data = kmemdup(req, size, GFP_KERNEL); > if (!data) > return -ENOMEM; > - memcpy(data, req, size); > > retval = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), >cmd, Thanks, Johan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH -next] staging: bcm2708_vchiq: fix return value check in vchiq_platform_conn_state_changed()
From: Wei Yongjun In case of error, the function kthread_create() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun --- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index e11c0e0..ccd1735 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -2781,7 +2781,7 @@ void vchiq_platform_conn_state_changed(VCHIQ_STATE_T *state, &vchiq_keepalive_thread_func, (void *)state, threadname); - if (arm_state->ka_thread == NULL) { + if (IS_ERR(arm_state->ka_thread)) { vchiq_log_error(vchiq_susp_log_level, "vchiq: FATAL: couldn't create thread %s", threadname); ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH -next] staging: bcm2708_vchiq: remove .owner field for driver
From: Wei Yongjun Remove .owner field if calls are used which set it automatically. Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Wei Yongjun --- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index e11c0e0..5370cb8 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -2891,7 +2891,6 @@ MODULE_DEVICE_TABLE(of, vchiq_of_match); static struct platform_driver vchiq_driver = { .driver = { .name = "bcm2835_vchiq", - .owner = THIS_MODULE, .of_match_table = vchiq_of_match, }, .probe = vchiq_probe, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH -next] staging: bcm2708_vchiq: fix return value check in vchiq_init_state()
From: Wei Yongjun In case of error, the function kthread_create() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun --- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c index 2c98da4..8cb43f5 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -2494,7 +2494,7 @@ vchiq_init_state(VCHIQ_STATE_T *state, VCHIQ_SLOT_ZERO_T *slot_zero, (void *)state, threadname); - if (state->slot_handler_thread == NULL) { + if (IS_ERR(state->slot_handler_thread)) { vchiq_loud_error_header(); vchiq_loud_error("couldn't create thread %s", threadname); vchiq_loud_error_footer(); @@ -2507,7 +2507,7 @@ vchiq_init_state(VCHIQ_STATE_T *state, VCHIQ_SLOT_ZERO_T *slot_zero, state->recycle_thread = kthread_create(&recycle_func, (void *)state, threadname); - if (state->recycle_thread == NULL) { + if (IS_ERR(state->recycle_thread)) { vchiq_loud_error_header(); vchiq_loud_error("couldn't create thread %s", threadname); vchiq_loud_error_footer(); @@ -2520,7 +2520,7 @@ vchiq_init_state(VCHIQ_STATE_T *state, VCHIQ_SLOT_ZERO_T *slot_zero, state->sync_thread = kthread_create(&sync_func, (void *)state, threadname); - if (state->sync_thread == NULL) { + if (IS_ERR(state->sync_thread)) { vchiq_loud_error_header(); vchiq_loud_error("couldn't create thread %s", threadname); vchiq_loud_error_footer(); ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [RFC PATCH v1 00/28] x86: Secure Encrypted Virtualization (AMD)
Hi Paolo, Thanks for reviews. I will incorporate your feedbacks in v2. On 10/13/2016 06:19 AM, Paolo Bonzini wrote: On 23/08/2016 01:23, Brijesh Singh wrote: TODO: - send qemu/seabios RFC's on respective mailing list - integrate the psp driver with CCP driver (they share the PCI id's) - add SEV guest migration command support - add SEV snapshotting command support - determine how to do ioremap of physical memory with mem encryption enabled (e.g acpi tables) The would be encrypted, right? Similar to the EFI data in patch 9. Yes. - determine how to share the guest memory with hypervisor for to support pvclock driver Is it enough if the guest makes that page unencrypted? Yes that should be enough. If guest can mark a page as unencrypted then hypervisor should be able to read and write to that particular page. Tom's patches have introduced API (set_memory_dec) to mark memory as unencrypted but pvclock drv runs very early during boot (when irq was disabled). Because of this we are not able to use set_memory_dec() to mark the page as unencrypted. Will need to come up with method for handling these cases. I reviewed the KVM host-side patches and they are pretty straightforward, so the comments on each patch suffice. Thanks, Paolo Brijesh Singh (11): crypto: add AMD Platform Security Processor driver KVM: SVM: prepare to reserve asid for SEV guest KVM: SVM: prepare for SEV guest management API support KVM: introduce KVM_SEV_ISSUE_CMD ioctl KVM: SVM: add SEV launch start command KVM: SVM: add SEV launch update command KVM: SVM: add SEV_LAUNCH_FINISH command KVM: SVM: add KVM_SEV_GUEST_STATUS command KVM: SVM: add KVM_SEV_DEBUG_DECRYPT command KVM: SVM: add KVM_SEV_DEBUG_ENCRYPT command KVM: SVM: add command to query SEV API version Tom Lendacky (17): kvm: svm: Add support for additional SVM NPF error codes kvm: svm: Add kvm_fast_pio_in support kvm: svm: Use the hardware provided GPA instead of page walk x86: Secure Encrypted Virtualization (SEV) support KVM: SVM: prepare for new bit definition in nested_ctl KVM: SVM: Add SEV feature definitions to KVM x86: Do not encrypt memory areas if SEV is enabled Access BOOT related data encrypted with SEV active x86/efi: Access EFI data as encrypted when SEV is active x86: Change early_ioremap to early_memremap for BOOT data x86: Don't decrypt trampoline area if SEV is active x86: DMA support for SEV memory encryption iommu/amd: AMD IOMMU support for SEV x86: Don't set the SME MSR bit when SEV is active x86: Unroll string I/O when SEV is active x86: Add support to determine if running with SEV enabled KVM: SVM: Enable SEV by setting the SEV_ENABLE cpu feature arch/x86/boot/compressed/Makefile |2 arch/x86/boot/compressed/head_64.S | 19 + arch/x86/boot/compressed/mem_encrypt.S | 123 arch/x86/include/asm/io.h | 26 + arch/x86/include/asm/kvm_emulate.h |3 arch/x86/include/asm/kvm_host.h| 27 + arch/x86/include/asm/mem_encrypt.h |3 arch/x86/include/asm/svm.h |3 arch/x86/include/uapi/asm/hyperv.h |4 arch/x86/include/uapi/asm/kvm_para.h |4 arch/x86/kernel/acpi/boot.c|4 arch/x86/kernel/head64.c |4 arch/x86/kernel/mem_encrypt.S | 44 ++ arch/x86/kernel/mpparse.c | 10 arch/x86/kernel/setup.c|7 arch/x86/kernel/x8664_ksyms_64.c |1 arch/x86/kvm/cpuid.c |4 arch/x86/kvm/mmu.c | 20 + arch/x86/kvm/svm.c | 906 arch/x86/kvm/x86.c | 73 +++ arch/x86/mm/ioremap.c |7 arch/x86/mm/mem_encrypt.c | 50 ++ arch/x86/platform/efi/efi_64.c | 14 arch/x86/realmode/init.c | 11 drivers/crypto/Kconfig | 11 drivers/crypto/Makefile|1 drivers/crypto/psp/Kconfig |8 drivers/crypto/psp/Makefile|3 drivers/crypto/psp/psp-dev.c | 220 drivers/crypto/psp/psp-dev.h | 95 +++ drivers/crypto/psp/psp-ops.c | 454 drivers/crypto/psp/psp-pci.c | 376 + drivers/sfi/sfi_core.c |6 include/linux/ccp-psp.h| 833 + include/uapi/linux/Kbuild |1 include/uapi/linux/ccp-psp.h | 182 ++ include/uapi/linux/kvm.h | 125 37 files changed, 3643 insertions(+), 41 deletions(-) create mode 100644 arch/x86/boot/compressed/mem_encrypt.S create mode 100644 drivers/crypto/psp/Kconfig create mode 100644 drivers/crypto/psp/Makefile create mode 100644 drivers/crypto/psp/psp-dev.c create mode
[PATCH 1/1] Staging: gs_fpgaboot: Use octal permissions '0444'
Fixed following checkpatch warning WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. Signed-off-by: Shyam Saini --- drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c index 8ed4d39..19b550f 100644 --- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c +++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c @@ -38,7 +38,7 @@ static u8 bits_magic[] = { static struct platform_device *firmware_pdev; static char*file = "xlinx_fpga_firmware.bit"; -module_param(file, charp, S_IRUGO); +module_param(file, charp, 0444); MODULE_PARM_DESC(file, "Xilinx FPGA firmware file."); static void read_bitstream(char *bitdata, char *buf, int *offset, int rdsize) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/3] staging: ks7010: Coding style fixes
On Mon, Oct 17, 2016 at 01:26:51PM +0200, Carlos Maiolino wrote: > Hi Greg, > > I've based these patches on top of linux-next. Thanks anyway. > > Which tree are you applying these patches on? I'll make sure to submit > next patches based on your tree. While the -rc1 merge window was open, I couldn't add anything to my trees that would show up in linux-next, that's why you didn't see these changes. Now that -rc1 is out, my trees will all be synced up with linux-next on a daily basis, so working from there will be fine. If you only care about staging tree cleanups, you can just use my staging.git tree on git.kernel.org and use the staging-testing branch to get the latest stuff. hope this helps, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/3] staging: ks7010: Coding style fixes
Hi Greg, I've based these patches on top of linux-next. Thanks anyway. Which tree are you applying these patches on? I'll make sure to submit next patches based on your tree. Cheers On Mon, Oct 17, 2016 at 10:27 AM, Greg KH wrote: > On Sun, Oct 16, 2016 at 10:16:00PM +0200, Carlos Maiolino wrote: >> A small patchset fixing some coding style errors identified by checkpatch.pl >> >> Greg. I splitted the single patch into 3 different patches now, hope I set it >> right now :) >> >> Also added a blank line before the signed-off. > > None of these apply to my tree as I think others have already made them > before you did, sorry :( > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/2] staging: dgnc: Remove some redundant functions
dgnc_tty_preinit() and dgnc_tty_post_uninit() functions are used to allocate and free "dgnc_TmpWriteBuf" and this "dgnc_TmpWriteBuf" is not really getting used. Hence remove these redundant functions. Also remove dgnc_TmpWriteBuf variable as it is not used anymore. Signed-off-by: Pankaj Bharadiya --- drivers/staging/dgnc/dgnc_driver.c | 13 --- drivers/staging/dgnc/dgnc_tty.c| 45 ++ drivers/staging/dgnc/dgnc_tty.h| 2 -- 3 files changed, 2 insertions(+), 58 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index fd372d3..0fe7e85 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -151,7 +151,6 @@ static void cleanup(bool sysfiles) dgnc_cleanup_board(dgnc_board[i]); } - dgnc_tty_post_uninit(); } /* @@ -241,16 +240,6 @@ static int dgnc_start(void) goto failed_device; } - /* -* Init any global tty stuff. -*/ - rc = dgnc_tty_preinit(); - - if (rc < 0) { - pr_err(DRVSTR ": tty preinit - not enough memory (%d)\n", rc); - goto failed_tty; - } - /* Start the poller */ spin_lock_irqsave(&dgnc_poll_lock, flags); setup_timer(&dgnc_poll_timer, dgnc_poll_handler, 0); @@ -262,8 +251,6 @@ static int dgnc_start(void) return 0; -failed_tty: - device_destroy(dgnc_class, MKDEV(dgnc_major, 0)); failed_device: class_destroy(dgnc_class); failed_class: diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index ef9a45b..8d557fa 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -43,11 +43,6 @@ #include "dgnc_utils.h" /* - * internal variables - */ -static unsigned char *dgnc_TmpWriteBuf; - -/* * Default transparent print information. */ static struct digi_t dgnc_digi_init = { @@ -144,31 +139,6 @@ static void dgnc_tty_set_termios(struct tty_struct *tty, / /* - * dgnc_tty_preinit() - * - * Initialize any global tty related data before we download any boards. - */ -int dgnc_tty_preinit(void) -{ - /* -* Allocate a buffer for doing the copy from user space to -* kernel space in dgnc_write(). We only use one buffer and -* control access to it with a semaphore. If we are paging, we -* are already in trouble so one buffer won't hurt much anyway. -* -* We are okay to sleep in the malloc, as this routine -* is only called during module load, (not in interrupt context), -* and with no locks held. -*/ - dgnc_TmpWriteBuf = kmalloc(WRITEBUFLEN, GFP_KERNEL); - - if (!dgnc_TmpWriteBuf) - return -ENOMEM; - - return 0; -} - -/* * dgnc_tty_register() * * Init the tty subsystem for this board. @@ -365,17 +335,6 @@ int dgnc_tty_init(struct dgnc_board *brd) } /* - * dgnc_tty_post_uninit() - * - * UnInitialize any global tty related data. - */ -void dgnc_tty_post_uninit(void) -{ - kfree(dgnc_TmpWriteBuf); - dgnc_TmpWriteBuf = NULL; -} - -/* * dgnc_cleanup_tty() * * Uninitialize the TTY portion of this driver. Free all memory and @@ -1543,7 +1502,7 @@ static int dgnc_tty_write_room(struct tty_struct *tty) int ret = 0; unsigned long flags; - if (!tty || !dgnc_TmpWriteBuf) + if (!tty) return 0; un = tty->driver_data; @@ -1623,7 +1582,7 @@ static int dgnc_tty_write(struct tty_struct *tty, ushort tmask; uint remain; - if (!tty || !dgnc_TmpWriteBuf) + if (!tty) return 0; un = tty->driver_data; diff --git a/drivers/staging/dgnc/dgnc_tty.h b/drivers/staging/dgnc/dgnc_tty.h index 24c9a41..85a1310 100644 --- a/drivers/staging/dgnc/dgnc_tty.h +++ b/drivers/staging/dgnc/dgnc_tty.h @@ -21,10 +21,8 @@ intdgnc_tty_register(struct dgnc_board *brd); void dgnc_tty_unregister(struct dgnc_board *brd); -intdgnc_tty_preinit(void); int dgnc_tty_init(struct dgnc_board *); -void dgnc_tty_post_uninit(void); void dgnc_cleanup_tty(struct dgnc_board *); void dgnc_input(struct channel_t *ch); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 0/2] staging: dgnc: Code cleaup
Hi, This patchset does minor cleanup for dgnc driver. v1->v2: - Split into multiple patches - remove redundant dgnc_tmp_write_buf variable and function calls - rename dgnc_default_termios to default_termios Pankaj Bharadiya (2): staging: dgnc: Remove some redundant functions staging: dgnc: Replace CamelCase namings with underscores drivers/staging/dgnc/dgnc_driver.c | 13 -- drivers/staging/dgnc/dgnc_tty.c| 51 -- drivers/staging/dgnc/dgnc_tty.h| 2 -- 3 files changed, 5 insertions(+), 61 deletions(-) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/2] staging: dgnc: Replace CamelCase namings with underscores
Replace CamelCase names with underscores to comply with the standard kernel coding style. Signed-off-by: Pankaj Bharadiya --- drivers/staging/dgnc/dgnc_tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index 8d557fa..52af3ef 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -64,7 +64,7 @@ * This defines a raw port at 9600 baud, 8 data bits, no parity, * 1 stop bit. */ -static struct ktermios DgncDefaultTermios = { +static struct ktermios default_termios = { .c_iflag = (DEFAULT_IFLAGS), /* iflags */ .c_oflag = (DEFAULT_OFLAGS), /* oflags */ .c_cflag = (DEFAULT_CFLAGS), /* cflags */ @@ -164,7 +164,7 @@ int dgnc_tty_register(struct dgnc_board *brd) brd->serial_driver->minor_start = 0; brd->serial_driver->type = TTY_DRIVER_TYPE_SERIAL; brd->serial_driver->subtype = SERIAL_TYPE_NORMAL; - brd->serial_driver->init_termios = DgncDefaultTermios; + brd->serial_driver->init_termios = default_termios; brd->serial_driver->driver_name = DRVSTR; /* @@ -203,7 +203,7 @@ int dgnc_tty_register(struct dgnc_board *brd) brd->print_driver->minor_start = 0x80; brd->print_driver->type = TTY_DRIVER_TYPE_SERIAL; brd->print_driver->subtype = SERIAL_TYPE_NORMAL; - brd->print_driver->init_termios = DgncDefaultTermios; + brd->print_driver->init_termios = default_termios; brd->print_driver->driver_name = DRVSTR; /* -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: greybus: audio: remove redundant slot field
On Mon, Oct 17, 2016 at 2:42 PM, Pankaj Bharadiya wrote: > gb_audio_manager_module_descriptor's intf_id field maintains the > information about the interface on which module is connected hence > having an extra slot field is redundant. > > Thus remove the slot field and its associated code. > > Signed-off-by: Pankaj Bharadiya > --- > drivers/staging/greybus/audio_codec.h | 1 - > drivers/staging/greybus/audio_manager.h| 1 - > drivers/staging/greybus/audio_manager_module.c | 17 + > drivers/staging/greybus/audio_manager_sysfs.c | 7 +++ > drivers/staging/greybus/audio_module.c | 1 - > 5 files changed, 4 insertions(+), 23 deletions(-) > > diff --git a/drivers/staging/greybus/audio_codec.h > b/drivers/staging/greybus/audio_codec.h > index ca027bd..62fd939 100644 > --- a/drivers/staging/greybus/audio_codec.h > +++ b/drivers/staging/greybus/audio_codec.h > @@ -158,7 +158,6 @@ struct gbaudio_module_info { > int dev_id; /* check if it should be bundle_id/hd_cport_id */ > int vid; > int pid; > - int slot; > int type; > int set_uevent; > char vstr[NAME_SIZE]; > diff --git a/drivers/staging/greybus/audio_manager.h > b/drivers/staging/greybus/audio_manager.h > index 056088e..5ab8f5e 100644 > --- a/drivers/staging/greybus/audio_manager.h > +++ b/drivers/staging/greybus/audio_manager.h > @@ -18,7 +18,6 @@ > > struct gb_audio_manager_module_descriptor { > char name[GB_AUDIO_MANAGER_MODULE_NAME_LEN]; > - int slot; > int vid; > int pid; > int intf_id; > diff --git a/drivers/staging/greybus/audio_manager_module.c > b/drivers/staging/greybus/audio_manager_module.c > index 2bf40a9..adc1697 100644 > --- a/drivers/staging/greybus/audio_manager_module.c > +++ b/drivers/staging/greybus/audio_manager_module.c > @@ -81,16 +81,6 @@ static ssize_t gb_audio_module_name_show( > static struct gb_audio_manager_module_attribute > gb_audio_module_name_attribute = > __ATTR(name, 0664, gb_audio_module_name_show, NULL); > > -static ssize_t gb_audio_module_slot_show( > - struct gb_audio_manager_module *module, > - struct gb_audio_manager_module_attribute *attr, char *buf) > -{ > - return sprintf(buf, "%d", module->desc.slot); > -} > - > -static struct gb_audio_manager_module_attribute > gb_audio_module_slot_attribute = > - __ATTR(slot, 0664, gb_audio_module_slot_show, NULL); > - > static ssize_t gb_audio_module_vid_show( > struct gb_audio_manager_module *module, > struct gb_audio_manager_module_attribute *attr, char *buf) > @@ -146,7 +136,6 @@ static ssize_t gb_audio_module_op_devices_show( > > static struct attribute *gb_audio_module_default_attrs[] = { > &gb_audio_module_name_attribute.attr, > - &gb_audio_module_slot_attribute.attr, > &gb_audio_module_vid_attribute.attr, > &gb_audio_module_pid_attribute.attr, > &gb_audio_module_intf_id_attribute.attr, > @@ -164,7 +153,6 @@ static ssize_t gb_audio_module_op_devices_show( > static void send_add_uevent(struct gb_audio_manager_module *module) > { > char name_string[128]; > - char slot_string[64]; > char vid_string[64]; > char pid_string[64]; > char intf_id_string[64]; > @@ -173,7 +161,6 @@ static void send_add_uevent(struct > gb_audio_manager_module *module) > > char *envp[] = { > name_string, > - slot_string, > vid_string, > pid_string, > intf_id_string, > @@ -183,7 +170,6 @@ static void send_add_uevent(struct > gb_audio_manager_module *module) > }; > > snprintf(name_string, 128, "NAME=%s", module->desc.name); > - snprintf(slot_string, 64, "SLOT=%d", module->desc.slot); > snprintf(vid_string, 64, "VID=%d", module->desc.vid); > snprintf(pid_string, 64, "PID=%d", module->desc.pid); > snprintf(intf_id_string, 64, "INTF_ID=%d", module->desc.intf_id); > @@ -246,10 +232,9 @@ int gb_audio_manager_module_create( > > void gb_audio_manager_module_dump(struct gb_audio_manager_module *module) > { > - pr_info("audio module #%d name=%s slot=%d vid=%d pid=%d intf_id=%d > i/p devices=0x%X o/p devices=0x%X\n", > + pr_info("audio module #%d name=%s vid=%d pid=%d intf_id=%d i/p > devices=0x%X o/p devices=0x%X\n", > module->id, > module->desc.name, > - module->desc.slot, > module->desc.vid, > module->desc.pid, > module->desc.intf_id, > diff --git a/drivers/staging/greybus/audio_manager_sysfs.c > b/drivers/staging/greybus/audio_manager_sysfs.c > index fc0aca6..9eae70f 100644 > --- a/drivers/staging/greybus/audio_manager_sysfs.c > +++ b/drivers/staging/greybus/audio_manager_sysfs.c > @@ -20,10 +20,9 @@ static ssize_t manager_sysfs_add_store( > > int num = sscanf(buf, >
Re: [PATCH] staging: greybus: audio: remove redundant slot field
On Mon, Oct 17, 2016 at 2:42 PM, Pankaj Bharadiya wrote: > gb_audio_manager_module_descriptor's intf_id field maintains the > information about the interface on which module is connected hence > having an extra slot field is redundant. > > Thus remove the slot field and its associated code. > > Signed-off-by: Pankaj Bharadiya > --- > drivers/staging/greybus/audio_codec.h | 1 - > drivers/staging/greybus/audio_manager.h| 1 - > drivers/staging/greybus/audio_manager_module.c | 17 + > drivers/staging/greybus/audio_manager_sysfs.c | 7 +++ > drivers/staging/greybus/audio_module.c | 1 - > 5 files changed, 4 insertions(+), 23 deletions(-) Acked-by: Viresh Kumar ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: greybus: audio: remove redundant slot field
gb_audio_manager_module_descriptor's intf_id field maintains the information about the interface on which module is connected hence having an extra slot field is redundant. Thus remove the slot field and its associated code. Signed-off-by: Pankaj Bharadiya --- drivers/staging/greybus/audio_codec.h | 1 - drivers/staging/greybus/audio_manager.h| 1 - drivers/staging/greybus/audio_manager_module.c | 17 + drivers/staging/greybus/audio_manager_sysfs.c | 7 +++ drivers/staging/greybus/audio_module.c | 1 - 5 files changed, 4 insertions(+), 23 deletions(-) diff --git a/drivers/staging/greybus/audio_codec.h b/drivers/staging/greybus/audio_codec.h index ca027bd..62fd939 100644 --- a/drivers/staging/greybus/audio_codec.h +++ b/drivers/staging/greybus/audio_codec.h @@ -158,7 +158,6 @@ struct gbaudio_module_info { int dev_id; /* check if it should be bundle_id/hd_cport_id */ int vid; int pid; - int slot; int type; int set_uevent; char vstr[NAME_SIZE]; diff --git a/drivers/staging/greybus/audio_manager.h b/drivers/staging/greybus/audio_manager.h index 056088e..5ab8f5e 100644 --- a/drivers/staging/greybus/audio_manager.h +++ b/drivers/staging/greybus/audio_manager.h @@ -18,7 +18,6 @@ struct gb_audio_manager_module_descriptor { char name[GB_AUDIO_MANAGER_MODULE_NAME_LEN]; - int slot; int vid; int pid; int intf_id; diff --git a/drivers/staging/greybus/audio_manager_module.c b/drivers/staging/greybus/audio_manager_module.c index 2bf40a9..adc1697 100644 --- a/drivers/staging/greybus/audio_manager_module.c +++ b/drivers/staging/greybus/audio_manager_module.c @@ -81,16 +81,6 @@ static ssize_t gb_audio_module_name_show( static struct gb_audio_manager_module_attribute gb_audio_module_name_attribute = __ATTR(name, 0664, gb_audio_module_name_show, NULL); -static ssize_t gb_audio_module_slot_show( - struct gb_audio_manager_module *module, - struct gb_audio_manager_module_attribute *attr, char *buf) -{ - return sprintf(buf, "%d", module->desc.slot); -} - -static struct gb_audio_manager_module_attribute gb_audio_module_slot_attribute = - __ATTR(slot, 0664, gb_audio_module_slot_show, NULL); - static ssize_t gb_audio_module_vid_show( struct gb_audio_manager_module *module, struct gb_audio_manager_module_attribute *attr, char *buf) @@ -146,7 +136,6 @@ static ssize_t gb_audio_module_op_devices_show( static struct attribute *gb_audio_module_default_attrs[] = { &gb_audio_module_name_attribute.attr, - &gb_audio_module_slot_attribute.attr, &gb_audio_module_vid_attribute.attr, &gb_audio_module_pid_attribute.attr, &gb_audio_module_intf_id_attribute.attr, @@ -164,7 +153,6 @@ static ssize_t gb_audio_module_op_devices_show( static void send_add_uevent(struct gb_audio_manager_module *module) { char name_string[128]; - char slot_string[64]; char vid_string[64]; char pid_string[64]; char intf_id_string[64]; @@ -173,7 +161,6 @@ static void send_add_uevent(struct gb_audio_manager_module *module) char *envp[] = { name_string, - slot_string, vid_string, pid_string, intf_id_string, @@ -183,7 +170,6 @@ static void send_add_uevent(struct gb_audio_manager_module *module) }; snprintf(name_string, 128, "NAME=%s", module->desc.name); - snprintf(slot_string, 64, "SLOT=%d", module->desc.slot); snprintf(vid_string, 64, "VID=%d", module->desc.vid); snprintf(pid_string, 64, "PID=%d", module->desc.pid); snprintf(intf_id_string, 64, "INTF_ID=%d", module->desc.intf_id); @@ -246,10 +232,9 @@ int gb_audio_manager_module_create( void gb_audio_manager_module_dump(struct gb_audio_manager_module *module) { - pr_info("audio module #%d name=%s slot=%d vid=%d pid=%d intf_id=%d i/p devices=0x%X o/p devices=0x%X\n", + pr_info("audio module #%d name=%s vid=%d pid=%d intf_id=%d i/p devices=0x%X o/p devices=0x%X\n", module->id, module->desc.name, - module->desc.slot, module->desc.vid, module->desc.pid, module->desc.intf_id, diff --git a/drivers/staging/greybus/audio_manager_sysfs.c b/drivers/staging/greybus/audio_manager_sysfs.c index fc0aca6..9eae70f 100644 --- a/drivers/staging/greybus/audio_manager_sysfs.c +++ b/drivers/staging/greybus/audio_manager_sysfs.c @@ -20,10 +20,9 @@ static ssize_t manager_sysfs_add_store( int num = sscanf(buf, "name=%" GB_AUDIO_MANAGER_MODULE_NAME_LEN_SSCANF "s " - "slot=%d vid=%d pid=%d intf_id=%d i/p devices=0x%X" - "o/p devices=0x%X", - desc.name, &desc.slot, &desc.vid, &desc.pid, - &desc.intf_
Re: linux-4.9-rc1/drivers/staging/lustre/lustre/osc/osc_request.c:973: always false test ?
On Mon, Oct 17, 2016 at 07:33:33AM +, David Binderman wrote: > Hello there, > > > > linux-4.9-rc1/drivers/staging/lustre/lustre/osc/osc_request.c:973]: (style) > Checking if unsigned variable 'cli.cl_avail_grant' is less than zero. > > > > Source code is > > > > if (cli->cl_avail_grant < 0) { > > > > Suggest code rework. Great! Please send a patch. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: replace DGNC_VERIFY_BOARD macro
On Fri, Oct 14, 2016 at 07:22:57PM +0200, Fernando Apesteguia wrote: > The patch replaces the macro with a function (dgnc_get_board) and > substitutes the macro statement with a call to that function and a > comparison on the returned value. > > This removes a checkpatch warning. > > Signed-off-by: Fernando Apesteguia > --- > drivers/staging/dgnc/dgnc_sysfs.c | 74 > +++ > 1 file changed, 51 insertions(+), 23 deletions(-) > > diff --git a/drivers/staging/dgnc/dgnc_sysfs.c > b/drivers/staging/dgnc/dgnc_sysfs.c > index 290bf6e..3ea23a9 100644 > --- a/drivers/staging/dgnc/dgnc_sysfs.c > +++ b/drivers/staging/dgnc/dgnc_sysfs.c > @@ -90,17 +90,21 @@ void dgnc_remove_driver_sysfiles(struct pci_driver > *dgnc_driver) > driver_remove_file(driverfs, &driver_attr_pollrate); > } > > -#define DGNC_VERIFY_BOARD(p, bd) \ > - do {\ > - if (!p) \ > - return 0; \ > - \ > - bd = dev_get_drvdata(p);\ > - if (!bd || bd->magic != DGNC_BOARD_MAGIC) \ > - return 0; \ > - if (bd->state != BOARD_READY) \ > - return 0; \ > - } while (0) > +static struct dgnc_board *dgnc_get_board(struct device *p) > +{ > + struct dgnc_board *bd; > + > + if (!p) > + return NULL; > + > + bd = dev_get_drvdata(p); > + if (!bd || bd->magic != DGNC_BOARD_MAGIC) > + return NULL; > + if (bd->state != BOARD_READY) > + return NULL; > + > + return bd; > +} No, this macro should be removed entirely as what it does is pointless in some parts, wrong in others, and not needed at all in the rest :( I've asked others to fix this up properly in the past, but it doesn't seem like anyone wants to do the work... I don't want to take this patch as it will hide the real issues here. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/3] staging: ks7010: Coding style fixes
On Sun, Oct 16, 2016 at 10:16:00PM +0200, Carlos Maiolino wrote: > A small patchset fixing some coding style errors identified by checkpatch.pl > > Greg. I splitted the single patch into 3 different patches now, hope I set it > right now :) > > Also added a blank line before the signed-off. None of these apply to my tree as I think others have already made them before you did, sorry :( greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: dgnc_tty: Add missing static keyword.
On Mon, Oct 17, 2016 at 12:40:01AM +0100, Cathal Mullaney wrote: > Fixed sparse warning; function not declared static. > > Signed-off-by: Cathal Mullaney > --- > drivers/staging/dgnc/dgnc_tty.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Someone else already made this change before you did, sorry :( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: Replace CamelCase namings with underscores.
On Mon, Oct 17, 2016 at 01:13:55AM +0530, Pankaj Bharadiya wrote: > Replace CamelCase names with underscores to comply with the standard > kernel coding style. > > Signed-off-by: Pankaj Bharadiya > --- > drivers/staging/dgnc/dgnc_tty.c | 20 ++-- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c > index ef9a45b..1a21902 100644 > --- a/drivers/staging/dgnc/dgnc_tty.c > +++ b/drivers/staging/dgnc/dgnc_tty.c > @@ -45,7 +45,7 @@ > /* > * internal variables > */ > -static unsigned char *dgnc_TmpWriteBuf; > +static unsigned char *dgnc_tmp_write_buf; Why not just fix the code to not have this variable at all? It's not correct to have it from what I can tell... Also, you modify many different variables all at once, can you please just modify one at a time (one per patch), to make it more obvious it is correct? > /* > * Default transparent print information. > @@ -69,7 +69,7 @@ > * This defines a raw port at 9600 baud, 8 data bits, no parity, > * 1 stop bit. > */ > -static struct ktermios DgncDefaultTermios = { > +static struct ktermios dgnc_default_termios = { rename to "default_termios"? No need to keep the driver name prefix on a static variable, right? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
linux-4.9-rc1/drivers/staging/lustre/lustre/osc/osc_request.c:973: always false test ?
Hello there, linux-4.9-rc1/drivers/staging/lustre/lustre/osc/osc_request.c:973]: (style) Checking if unsigned variable 'cli.cl_avail_grant' is less than zero. Source code is if (cli->cl_avail_grant < 0) { Suggest code rework. Regards David Binderman ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/lustre/llite: Move unstable_stats from sysfs to debugfs
On Sun, Oct 16, 2016 at 01:16:50PM -0400, Oleg Drokin wrote: > It's multiple values per file, so it has no business being in sysfs, > besides it was assuming seqfile anyway. > > Introduced by > commit d806f30e639b ("staging: lustre: osc: revise unstable pages accounting") In the future, the "correct" format for saying something like this is: Fixes: d806f30e639b ("staging: lustre: osc: revise unstable pages accounting") thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel