[PATCH v2] Staging: comedi: dt2814: remove unused assignments
Silence following compiler warning: drivers/staging/comedi/drivers/dt2814.c: In function ‘dt2814_interrupt’: drivers/staging/comedi/drivers/dt2814.c:193:6: warning: variable ‘data’ set but not used [-Wunused-but-set-variable] int data; ^~~~ drivers/staging/comedi/drivers/dt2814.c: In function ‘dt2814_attach’: drivers/staging/comedi/drivers/dt2814.c:232:6: warning: variable ‘i’ set but not used [-Wunused-but-set-variable] int i; ^ Signed-off-by: Gaurav Pathak --- v2: Update subject and commit message. drivers/staging/comedi/drivers/dt2814.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt2814.c index d2c715737361..eea587d63e18 100644 --- a/drivers/staging/comedi/drivers/dt2814.c +++ b/drivers/staging/comedi/drivers/dt2814.c @@ -186,22 +186,15 @@ static int dt2814_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) static irqreturn_t dt2814_interrupt(int irq, void *d) { - int lo, hi; struct comedi_device *dev = d; struct dt2814_private *devpriv = dev->private; struct comedi_subdevice *s = dev->read_subdev; - int data; if (!dev->attached) { dev_err(dev->class_dev, "spurious interrupt\n"); return IRQ_HANDLED; } - hi = inb(dev->iobase + DT2814_DATA); - lo = inb(dev->iobase + DT2814_DATA); - - data = (hi << 4) | (lo >> 4); - if (!(--devpriv->ntrig)) { int i; @@ -229,7 +222,6 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it) struct dt2814_private *devpriv; struct comedi_subdevice *s; int ret; - int i; ret = comedi_request_region(dev, it->options[0], 0x2); if (ret) @@ -241,8 +233,6 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it) dev_err(dev->class_dev, "reset error (fatal)\n"); return -EIO; } - i = inb(dev->iobase + DT2814_DATA); - i = inb(dev->iobase + DT2814_DATA); if (it->options[1]) { ret = request_irq(it->options[1], dt2814_interrupt, 0, -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: greybus: Fix warning to limit chars per line
Signed-off-by: Gaurav Dhingra --- Changes in v2: - use correct format for multiline comment --- drivers/staging/greybus/audio_codec.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/greybus/audio_codec.h b/drivers/staging/greybus/audio_codec.h index a1d5440..4efd8b3 100644 --- a/drivers/staging/greybus/audio_codec.h +++ b/drivers/staging/greybus/audio_codec.h @@ -23,7 +23,10 @@ enum { NUM_CODEC_DAIS, }; -/* device_type should be same as defined in audio.h (Android media layer) */ +/* + * device_type should be same as defined in audio.h + * (Android media layer) + */ enum { GBAUDIO_DEVICE_NONE = 0x0, /* reserved bits */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: greybus: Fix warning to limit chars per line
Hi, On Friday 06 April 2018 03:52 PM, Viresh Kumar wrote: On Fri, Apr 6, 2018 at 3:39 PM, Gaurav Dhingra wrote: Why did you remove the commit log? You had the right one in v1. I didn't realize that it would be necessary to add it to this patch set. I thought you guys will do squashing of the commits (v2 and v1) and using just one commit message (and will take it from last commit), seems like I was wrong. Now I've understood it. Signed-off-by: Gaurav Dhingra --- Changes in v2: - use correct format for multiline comment --- drivers/staging/greybus/audio_codec.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/greybus/audio_codec.h b/drivers/staging/greybus/audio_codec.h index a1d5440..4efd8b3 100644 --- a/drivers/staging/greybus/audio_codec.h +++ b/drivers/staging/greybus/audio_codec.h @@ -23,7 +23,10 @@ enum { NUM_CODEC_DAIS, }; -/* device_type should be same as defined in audio.h (Android media layer) */ +/* + * device_type should be same as defined in audio.h + * (Android media layer) + */ enum { GBAUDIO_DEVICE_NONE = 0x0, /* reserved bits */ This looks ok. Do I now need to send v3 with these exact changes, since I missed the 'commit log' in this one? -- Gaurav Dhingra (sent from Thunderbird email client) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3] staging: greybus: Fix warning to limit chars per line
Wrap comment to fix warning "prefer a maximum 75 chars per line" Signed-off-by: Gaurav Dhingra --- Changes in v2: - use correct format for multiline comment Changes in v3: - include commit log --- drivers/staging/greybus/audio_codec.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/greybus/audio_codec.h b/drivers/staging/greybus/audio_codec.h index a1d5440..4efd8b3 100644 --- a/drivers/staging/greybus/audio_codec.h +++ b/drivers/staging/greybus/audio_codec.h @@ -23,7 +23,10 @@ enum { NUM_CODEC_DAIS, }; -/* device_type should be same as defined in audio.h (Android media layer) */ +/* + * device_type should be same as defined in audio.h + * (Android media layer) + */ enum { GBAUDIO_DEVICE_NONE = 0x0, /* reserved bits */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 35/35] Staging:dgap:dgap_tty.c: Upgraded driver to use Mutex instead of semaphore
dgap driver uses semaphore for obtaining lock. I upgraded it to use MUTEX. Signed-off-by: Kumar Gaurav --- drivers/staging/dgap/dgap_tty.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/staging/dgap/dgap_tty.c b/drivers/staging/dgap/dgap_tty.c index 2a7a372..0ca72a2 100755 --- a/drivers/staging/dgap/dgap_tty.c +++ b/drivers/staging/dgap/dgap_tty.c @@ -52,7 +52,7 @@ #include/* For copy_from_user/copy_to_user */ #include /* For read[bwl]/write[bwl] */ #include - +#include #include "dgap_driver.h" #include "dgap_tty.h" #include "dgap_types.h" @@ -61,18 +61,12 @@ #include "dgap_conf.h" #include "dgap_sysfs.h" -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) -#define init_MUTEX(sem) sema_init(sem, 1) -#define DECLARE_MUTEX(name) \ -struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1) -#endif - /* * internal variables */ static struct board_t *dgap_BoardsByMajor[256]; static uchar *dgap_TmpWriteBuf = NULL; -static DECLARE_MUTEX(dgap_TmpWriteSem); +static DEFINE_MUTEX(dgap_TmpWriteSem); /* * Default transparent print information. @@ -2004,12 +1998,11 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int * the board. */ /* we're allowed to block if it's from_user */ - if (down_interruptible(&dgap_TmpWriteSem)) { + if (mutex_lock_interruptible(&dgap_TmpWriteSem)) return (-EINTR); - } if (copy_from_user(dgap_TmpWriteBuf, (const uchar __user *) buf, count)) { - up(&dgap_TmpWriteSem); + mutex_unlock(&dgap_TmpWriteSem); printk("Write: Copy from user failed!\n"); return -EFAULT; } @@ -2093,7 +2086,7 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int if (from_user) { DGAP_UNLOCK(ch->ch_lock, lock_flags); - up(&dgap_TmpWriteSem); + mutex_unlock(&dgap_TmpWriteSem); } else { DGAP_UNLOCK(ch->ch_lock, lock_flags); -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 35/35] Staging:dgap:dgap_tty.c: Upgraded driver to use Mutex instead of semaphore
Hi All, Please ignore this patch. I'm sending with correct Subject Line On Thursday 17 April 2014 09:21 PM, Kumar Gaurav wrote: dgap driver uses semaphore for obtaining lock. I upgraded it to use MUTEX. Signed-off-by: Kumar Gaurav --- drivers/staging/dgap/dgap_tty.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/staging/dgap/dgap_tty.c b/drivers/staging/dgap/dgap_tty.c index 2a7a372..0ca72a2 100755 --- a/drivers/staging/dgap/dgap_tty.c +++ b/drivers/staging/dgap/dgap_tty.c @@ -52,7 +52,7 @@ #include /* For copy_from_user/copy_to_user */ #include /* For read[bwl]/write[bwl] */ #include - +#include #include "dgap_driver.h" #include "dgap_tty.h" #include "dgap_types.h" @@ -61,18 +61,12 @@ #include "dgap_conf.h" #include "dgap_sysfs.h" -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) -#define init_MUTEX(sem) sema_init(sem, 1) -#define DECLARE_MUTEX(name) \ -struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1) -#endif - /* * internal variables */ static struct board_t *dgap_BoardsByMajor[256]; static uchar *dgap_TmpWriteBuf = NULL; -static DECLARE_MUTEX(dgap_TmpWriteSem); +static DEFINE_MUTEX(dgap_TmpWriteSem); /* * Default transparent print information. @@ -2004,12 +1998,11 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int * the board. */ /* we're allowed to block if it's from_user */ - if (down_interruptible(&dgap_TmpWriteSem)) { + if (mutex_lock_interruptible(&dgap_TmpWriteSem)) return (-EINTR); - } if (copy_from_user(dgap_TmpWriteBuf, (const uchar __user *) buf, count)) { - up(&dgap_TmpWriteSem); + mutex_unlock(&dgap_TmpWriteSem); printk("Write: Copy from user failed!\n"); return -EFAULT; } @@ -2093,7 +2086,7 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int if (from_user) { DGAP_UNLOCK(ch->ch_lock, lock_flags); - up(&dgap_TmpWriteSem); + mutex_unlock(&dgap_TmpWriteSem); } else { DGAP_UNLOCK(ch->ch_lock, lock_flags); ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging:dgap:dgap_tty.c: Upgraded driver to use Mutex instead of semaphore
dgap driver uses semaphore for obtaining lock. I upgraded it to use MUTEX. Signed-off-by: Kumar Gaurav --- drivers/staging/dgap/dgap_tty.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/staging/dgap/dgap_tty.c b/drivers/staging/dgap/dgap_tty.c index 2a7a372..0ca72a2 100755 --- a/drivers/staging/dgap/dgap_tty.c +++ b/drivers/staging/dgap/dgap_tty.c @@ -52,7 +52,7 @@ #include/* For copy_from_user/copy_to_user */ #include /* For read[bwl]/write[bwl] */ #include - +#include #include "dgap_driver.h" #include "dgap_tty.h" #include "dgap_types.h" @@ -61,18 +61,12 @@ #include "dgap_conf.h" #include "dgap_sysfs.h" -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) -#define init_MUTEX(sem) sema_init(sem, 1) -#define DECLARE_MUTEX(name) \ -struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1) -#endif - /* * internal variables */ static struct board_t *dgap_BoardsByMajor[256]; static uchar *dgap_TmpWriteBuf = NULL; -static DECLARE_MUTEX(dgap_TmpWriteSem); +static DEFINE_MUTEX(dgap_TmpWriteSem); /* * Default transparent print information. @@ -2004,12 +1998,11 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int * the board. */ /* we're allowed to block if it's from_user */ - if (down_interruptible(&dgap_TmpWriteSem)) { + if (mutex_lock_interruptible(&dgap_TmpWriteSem)) return (-EINTR); - } if (copy_from_user(dgap_TmpWriteBuf, (const uchar __user *) buf, count)) { - up(&dgap_TmpWriteSem); + mutex_unlock(&dgap_TmpWriteSem); printk("Write: Copy from user failed!\n"); return -EFAULT; } @@ -2093,7 +2086,7 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int if (from_user) { DGAP_UNLOCK(ch->ch_lock, lock_flags); - up(&dgap_TmpWriteSem); + mutex_unlock(&dgap_TmpWriteSem); } else { DGAP_UNLOCK(ch->ch_lock, lock_flags); -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging:dgap:dgap_tty.c: Upgraded driver to use Mutex instead of semaphore
Hi All, Any update on below patch. Do i need to make any modification? On Thursday 17 April 2014 09:25 PM, Kumar Gaurav wrote: dgap driver uses semaphore for obtaining lock. I upgraded it to use MUTEX. Signed-off-by: Kumar Gaurav --- drivers/staging/dgap/dgap_tty.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/staging/dgap/dgap_tty.c b/drivers/staging/dgap/dgap_tty.c index 2a7a372..0ca72a2 100755 --- a/drivers/staging/dgap/dgap_tty.c +++ b/drivers/staging/dgap/dgap_tty.c @@ -52,7 +52,7 @@ #include /* For copy_from_user/copy_to_user */ #include /* For read[bwl]/write[bwl] */ #include - +#include #include "dgap_driver.h" #include "dgap_tty.h" #include "dgap_types.h" @@ -61,18 +61,12 @@ #include "dgap_conf.h" #include "dgap_sysfs.h" -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) -#define init_MUTEX(sem) sema_init(sem, 1) -#define DECLARE_MUTEX(name) \ -struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1) -#endif - /* * internal variables */ static struct board_t *dgap_BoardsByMajor[256]; static uchar *dgap_TmpWriteBuf = NULL; -static DECLARE_MUTEX(dgap_TmpWriteSem); +static DEFINE_MUTEX(dgap_TmpWriteSem); /* * Default transparent print information. @@ -2004,12 +1998,11 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int * the board. */ /* we're allowed to block if it's from_user */ - if (down_interruptible(&dgap_TmpWriteSem)) { + if (mutex_lock_interruptible(&dgap_TmpWriteSem)) return (-EINTR); - } if (copy_from_user(dgap_TmpWriteBuf, (const uchar __user *) buf, count)) { - up(&dgap_TmpWriteSem); + mutex_unlock(&dgap_TmpWriteSem); printk("Write: Copy from user failed!\n"); return -EFAULT; } @@ -2093,7 +2086,7 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int if (from_user) { DGAP_UNLOCK(ch->ch_lock, lock_flags); - up(&dgap_TmpWriteSem); + mutex_unlock(&dgap_TmpWriteSem); } else { DGAP_UNLOCK(ch->ch_lock, lock_flags); ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v1] staging: rts5208: Change fixed function names with "%s: ", __func__
staging: rts5208: Refactored code to avoid few defects. Signed-off-by: Gaurav Pathak --- Hi, Gaurav hope this text appaers in the email, and i put it at the right place in patch. drivers/staging/rts5208/ms.c| 5 +++-- drivers/staging/rts5208/rtsx.c | 4 ++-- drivers/staging/rts5208/rtsx_chip.c | 4 ++-- drivers/staging/rts5208/sd.c| 28 +++- drivers/staging/rts5208/spi.c | 8 +--- drivers/staging/rts5208/xd.c| 17 ++--- 6 files changed, 37 insertions(+), 29 deletions(-) diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c index 482a29d..7cdce87 100644 --- a/drivers/staging/rts5208/ms.c +++ b/drivers/staging/rts5208/ms.c @@ -3064,7 +3064,8 @@ static int mspro_rw_multi_sector(struct scsi_cmnd *srb, if (detect_card_cd(chip, MS_CARD) != STATUS_SUCCESS) { chip->rw_need_retry = 0; - dev_dbg(rtsx_dev(chip), "No card exist, exit mspro_rw_multi_sector\n"); + dev_dbg(rtsx_dev(chip), "No card exist, exit %s\n", + __func__); rtsx_trace(chip); return STATUS_FAIL; } @@ -3101,7 +3102,7 @@ static int mspro_read_format_progress(struct rtsx_chip *chip, u8 cnt, tmp; u8 data[8]; - dev_dbg(rtsx_dev(chip), "mspro_read_format_progress, short_data_len = %d\n", + dev_dbg(rtsx_dev(chip), "%s, short_data_len = %d\n", __func__, short_data_len); retval = ms_switch_clock(chip); diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c index b8177f5..53748d6 100644 --- a/drivers/staging/rts5208/rtsx.c +++ b/drivers/staging/rts5208/rtsx.c @@ -999,7 +999,7 @@ static int rtsx_probe(struct pci_dev *pci, /* We come here if there are any problems */ errout: - dev_err(&pci->dev, "rtsx_probe() failed\n"); + dev_err(&pci->dev, "%s failed\n", __func__); release_everything(dev); return err; @@ -1009,7 +1009,7 @@ static void rtsx_remove(struct pci_dev *pci) { struct rtsx_dev *dev = pci_get_drvdata(pci); - dev_info(&pci->dev, "rtsx_remove() called\n"); + dev_info(&pci->dev, "%s called\n", __func__); quiesce_and_remove_host(dev); release_everything(dev); diff --git a/drivers/staging/rts5208/rtsx_chip.c b/drivers/staging/rts5208/rtsx_chip.c index 7f4107b..4ad472d 100644 --- a/drivers/staging/rts5208/rtsx_chip.c +++ b/drivers/staging/rts5208/rtsx_chip.c @@ -616,8 +616,8 @@ int rtsx_reset_chip(struct rtsx_chip *chip) else retval = rtsx_pre_handle_sdio_new(chip); - dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x (rtsx_reset_chip)\n", - (unsigned int)(chip->need_reset)); + dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x (%s)\n", + (unsigned int)(chip->need_reset), __func__); #else /* HW_AUTO_SWITCH_SD_BUS */ retval = rtsx_pre_handle_sdio_old(chip); #endif /* HW_AUTO_SWITCH_SD_BUS */ diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c index c2eb072..e2b1fa03 100644 --- a/drivers/staging/rts5208/sd.c +++ b/drivers/staging/rts5208/sd.c @@ -910,8 +910,8 @@ static int sd_change_phase(struct rtsx_chip *chip, u8 sample_point, u8 tune_dir) int retval; bool ddr_rx = false; - dev_dbg(rtsx_dev(chip), "sd_change_phase (sample_point = %d, tune_dir = %d)\n", - sample_point, tune_dir); + dev_dbg(rtsx_dev(chip), "%s (sample_point = %d, tune_dir = %d)\n", + __func__, sample_point, tune_dir); if (tune_dir == TUNE_RX) { SD_VP_CTL = SD_VPRX_CTL; @@ -1225,8 +1225,9 @@ static int sd_check_switch_mode(struct rtsx_chip *chip, u8 mode, u8 func_group, int retval; u8 cmd[5], buf[64]; - dev_dbg(rtsx_dev(chip), "sd_check_switch_mode (mode = %d, func_group = %d, func_to_switch = %d)\n", - mode, func_group, func_to_switch); + dev_dbg(rtsx_dev(chip), "%s ", __func__); + dev_dbg(rtsx_dev(chip), "mode = %d, func_group = %d,", mode, func_group); + dev_dbg(rtsx_dev(chip), "func_to_switch = %d)\n", func_to_switch); cmd[0] = 0x40 | SWITCH; cmd[1] = mode; @@ -3575,7 +3576,7 @@ static int reset_mmc_only(struct rtsx_chip *chip) return STATUS_FAIL; } - dev_dbg(rtsx_dev(chip), "In reset_mmc_only, sd_card->sd_type = 0x%x\n", + dev_dbg(rtsx_dev(chip), "In %s, sd_card->sd_type = 0x%x\n", __func__, sd_card->sd_type); return STATUS_SUCCESS; @@ -3699,11 +3700
[PATCH v1] staging: rts5208: Change fixed function names with "%s: ", __func__
staging: rts5208: Fix coding style issue caught by checkpatch.pl related to function name in debug print and shorten few lines over 80 char Signed-off-by: Gaurav Pathak --- drivers/staging/rts5208/ms.c| 5 +++-- drivers/staging/rts5208/rtsx.c | 4 ++-- drivers/staging/rts5208/rtsx_chip.c | 4 ++-- drivers/staging/rts5208/sd.c| 28 +++- drivers/staging/rts5208/spi.c | 8 +--- drivers/staging/rts5208/xd.c| 17 ++--- 6 files changed, 37 insertions(+), 29 deletions(-) diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c index 482a29d..7cdce87 100644 --- a/drivers/staging/rts5208/ms.c +++ b/drivers/staging/rts5208/ms.c @@ -3064,7 +3064,8 @@ static int mspro_rw_multi_sector(struct scsi_cmnd *srb, if (detect_card_cd(chip, MS_CARD) != STATUS_SUCCESS) { chip->rw_need_retry = 0; - dev_dbg(rtsx_dev(chip), "No card exist, exit mspro_rw_multi_sector\n"); + dev_dbg(rtsx_dev(chip), "No card exist, exit %s\n", + __func__); rtsx_trace(chip); return STATUS_FAIL; } @@ -3101,7 +3102,7 @@ static int mspro_read_format_progress(struct rtsx_chip *chip, u8 cnt, tmp; u8 data[8]; - dev_dbg(rtsx_dev(chip), "mspro_read_format_progress, short_data_len = %d\n", + dev_dbg(rtsx_dev(chip), "%s, short_data_len = %d\n", __func__, short_data_len); retval = ms_switch_clock(chip); diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c index b8177f5..53748d6 100644 --- a/drivers/staging/rts5208/rtsx.c +++ b/drivers/staging/rts5208/rtsx.c @@ -999,7 +999,7 @@ static int rtsx_probe(struct pci_dev *pci, /* We come here if there are any problems */ errout: - dev_err(&pci->dev, "rtsx_probe() failed\n"); + dev_err(&pci->dev, "%s failed\n", __func__); release_everything(dev); return err; @@ -1009,7 +1009,7 @@ static void rtsx_remove(struct pci_dev *pci) { struct rtsx_dev *dev = pci_get_drvdata(pci); - dev_info(&pci->dev, "rtsx_remove() called\n"); + dev_info(&pci->dev, "%s called\n", __func__); quiesce_and_remove_host(dev); release_everything(dev); diff --git a/drivers/staging/rts5208/rtsx_chip.c b/drivers/staging/rts5208/rtsx_chip.c index 7f4107b..4ad472d 100644 --- a/drivers/staging/rts5208/rtsx_chip.c +++ b/drivers/staging/rts5208/rtsx_chip.c @@ -616,8 +616,8 @@ int rtsx_reset_chip(struct rtsx_chip *chip) else retval = rtsx_pre_handle_sdio_new(chip); - dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x (rtsx_reset_chip)\n", - (unsigned int)(chip->need_reset)); + dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x (%s)\n", + (unsigned int)(chip->need_reset), __func__); #else /* HW_AUTO_SWITCH_SD_BUS */ retval = rtsx_pre_handle_sdio_old(chip); #endif /* HW_AUTO_SWITCH_SD_BUS */ diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c index c2eb072..e2b1fa03 100644 --- a/drivers/staging/rts5208/sd.c +++ b/drivers/staging/rts5208/sd.c @@ -910,8 +910,8 @@ static int sd_change_phase(struct rtsx_chip *chip, u8 sample_point, u8 tune_dir) int retval; bool ddr_rx = false; - dev_dbg(rtsx_dev(chip), "sd_change_phase (sample_point = %d, tune_dir = %d)\n", - sample_point, tune_dir); + dev_dbg(rtsx_dev(chip), "%s (sample_point = %d, tune_dir = %d)\n", + __func__, sample_point, tune_dir); if (tune_dir == TUNE_RX) { SD_VP_CTL = SD_VPRX_CTL; @@ -1225,8 +1225,9 @@ static int sd_check_switch_mode(struct rtsx_chip *chip, u8 mode, u8 func_group, int retval; u8 cmd[5], buf[64]; - dev_dbg(rtsx_dev(chip), "sd_check_switch_mode (mode = %d, func_group = %d, func_to_switch = %d)\n", - mode, func_group, func_to_switch); + dev_dbg(rtsx_dev(chip), "%s ", __func__); + dev_dbg(rtsx_dev(chip), "mode = %d, func_group = %d,", mode, func_group); + dev_dbg(rtsx_dev(chip), "func_to_switch = %d)\n", func_to_switch); cmd[0] = 0x40 | SWITCH; cmd[1] = mode; @@ -3575,7 +3576,7 @@ static int reset_mmc_only(struct rtsx_chip *chip) return STATUS_FAIL; } - dev_dbg(rtsx_dev(chip), "In reset_mmc_only, sd_card->sd_type = 0x%x\n", + dev_dbg(rtsx_dev(chip), "In %s, sd_card->sd_type = 0x%x\n", __func__, sd_card->sd_type); return STATUS_SUCCESS; @@ -3699,11 +3700
[PATCH v1] staging: rts5208: Change fixed function names with "%s: ", __func__
staging: rts5208: Fix coding style issue caught by checkpatch.pl related to function name in debug print Signed-off-by: Gaurav Pathak --- drivers/staging/rts5208/ms.c| 5 +++-- drivers/staging/rts5208/rtsx.c | 4 ++-- drivers/staging/rts5208/rtsx_chip.c | 4 ++-- drivers/staging/rts5208/sd.c| 21 +++-- drivers/staging/rts5208/spi.c | 8 +--- drivers/staging/rts5208/xd.c| 17 ++--- 6 files changed, 33 insertions(+), 26 deletions(-) diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c index 482a29d..7cdce87 100644 --- a/drivers/staging/rts5208/ms.c +++ b/drivers/staging/rts5208/ms.c @@ -3064,7 +3064,8 @@ static int mspro_rw_multi_sector(struct scsi_cmnd *srb, if (detect_card_cd(chip, MS_CARD) != STATUS_SUCCESS) { chip->rw_need_retry = 0; - dev_dbg(rtsx_dev(chip), "No card exist, exit mspro_rw_multi_sector\n"); + dev_dbg(rtsx_dev(chip), "No card exist, exit %s\n", + __func__); rtsx_trace(chip); return STATUS_FAIL; } @@ -3101,7 +3102,7 @@ static int mspro_read_format_progress(struct rtsx_chip *chip, u8 cnt, tmp; u8 data[8]; - dev_dbg(rtsx_dev(chip), "mspro_read_format_progress, short_data_len = %d\n", + dev_dbg(rtsx_dev(chip), "%s, short_data_len = %d\n", __func__, short_data_len); retval = ms_switch_clock(chip); diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c index b8177f5..53748d6 100644 --- a/drivers/staging/rts5208/rtsx.c +++ b/drivers/staging/rts5208/rtsx.c @@ -999,7 +999,7 @@ static int rtsx_probe(struct pci_dev *pci, /* We come here if there are any problems */ errout: - dev_err(&pci->dev, "rtsx_probe() failed\n"); + dev_err(&pci->dev, "%s failed\n", __func__); release_everything(dev); return err; @@ -1009,7 +1009,7 @@ static void rtsx_remove(struct pci_dev *pci) { struct rtsx_dev *dev = pci_get_drvdata(pci); - dev_info(&pci->dev, "rtsx_remove() called\n"); + dev_info(&pci->dev, "%s called\n", __func__); quiesce_and_remove_host(dev); release_everything(dev); diff --git a/drivers/staging/rts5208/rtsx_chip.c b/drivers/staging/rts5208/rtsx_chip.c index 7f4107b..4ad472d 100644 --- a/drivers/staging/rts5208/rtsx_chip.c +++ b/drivers/staging/rts5208/rtsx_chip.c @@ -616,8 +616,8 @@ int rtsx_reset_chip(struct rtsx_chip *chip) else retval = rtsx_pre_handle_sdio_new(chip); - dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x (rtsx_reset_chip)\n", - (unsigned int)(chip->need_reset)); + dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x (%s)\n", + (unsigned int)(chip->need_reset), __func__); #else /* HW_AUTO_SWITCH_SD_BUS */ retval = rtsx_pre_handle_sdio_old(chip); #endif /* HW_AUTO_SWITCH_SD_BUS */ diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c index c2eb072..b1fd0a1 100644 --- a/drivers/staging/rts5208/sd.c +++ b/drivers/staging/rts5208/sd.c @@ -910,8 +910,8 @@ static int sd_change_phase(struct rtsx_chip *chip, u8 sample_point, u8 tune_dir) int retval; bool ddr_rx = false; - dev_dbg(rtsx_dev(chip), "sd_change_phase (sample_point = %d, tune_dir = %d)\n", - sample_point, tune_dir); + dev_dbg(rtsx_dev(chip), "%s (sample_point = %d, tune_dir = %d)\n", + __func__, sample_point, tune_dir); if (tune_dir == TUNE_RX) { SD_VP_CTL = SD_VPRX_CTL; @@ -1225,8 +1225,8 @@ static int sd_check_switch_mode(struct rtsx_chip *chip, u8 mode, u8 func_group, int retval; u8 cmd[5], buf[64]; - dev_dbg(rtsx_dev(chip), "sd_check_switch_mode (mode = %d, func_group = %d, func_to_switch = %d)\n", - mode, func_group, func_to_switch); + dev_dbg(rtsx_dev(chip), "%s (mode = %d, func_group = %d, func_to_switch = %d)\n", + __func__, mode, func_group, func_to_switch); cmd[0] = 0x40 | SWITCH; cmd[1] = mode; @@ -3575,8 +3575,8 @@ static int reset_mmc_only(struct rtsx_chip *chip) return STATUS_FAIL; } - dev_dbg(rtsx_dev(chip), "In reset_mmc_only, sd_card->sd_type = 0x%x\n", - sd_card->sd_type); + dev_dbg(rtsx_dev(chip), "In %s, sd_card->sd_type = 0x%x\n", + __func__, sd_card->sd_type); return STATUS_SUCCESS; } @@ -3699,11 +3699,11 @@ int sd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip, u32 start_sector,
Query:Regarding object poison overwritten in binder_transaction
HI , Is there any known issue of slab poisoning in binder_transaction variable on kernel 4.9, it seems owner variable of spinlock is getting corrupted(which is last 8th byte of binder_transaction struct). 368.423462: <2> [] print_trailer+0x13c/0x214 368.428998: <2> [] check_bytes_and_report+0xe8/0xfc 368.435144: <2> [] check_object+0x248/0x280 368.440592: <2> [] alloc_debug_processing+0x148/0x1a0 368.446913: <2> [] ___slab_alloc.constprop.72+0x654/0x690 368.453586: <2> [] __slab_alloc.isra.68.constprop.71+0x58/0x98 368.460693: <2> [] kmem_cache_alloc_trace+0x198/0x2c4 368.467011: <2> [] binder_transaction+0xcb8/0x244c 368.473065: <2> [] binder_thread_write+0x9d8/0x1410 368.479206: <2> [] binder_ioctl_write_read+0x130/0x370 368.485615: <2> [] binder_ioctl+0x550/0x7dc 368.491065: <2> [] do_vfs_ioctl+0xcc/0x888 368.496424: <2> [] SyS_ioctl+0x90/0xa4 368.501430: <2> [] el0_svc_naked+0x24/0x28 368.506798: <6> Kernel panic - not syncing: object poison overwritten 368.287743: <6> Object ffc5a0692e20: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 368.297117: <6> Object ffc5a0692e30: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 368.306487: <6> Object ffc5a0692e40: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 368.315866: <6> Object ffc5a0692e50: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 368.325241: <6> Object ffc5a0692e60: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 368.334618: <6> Object ffc5a0692e70: 6b 6b 6b 6b 6b 6b 6b 6b 67 6b 6b 6b 6b 6b 6b a5 gkk. here it is corrupted(seems write after free case) 368.343997: <6> Redzone ffc5a0692e80: bb bb bb bb bb bb bb bb 368.352755: <6> Padding ffc5a0692fc0: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 368.362215: <6> Padding ffc5a0692fd0: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 368.371681: <6> Padding ffc5a0692fe0: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 368.381146: <6> Padding ffc5a0692ff0: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a Regards Gaurav -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Query:Regarding object poison overwritten in binder_transaction
Thanks Greg, I will check the common tree, and it seems to me a new bug , will file a bug if won't be able to resolve from android-common tree. Regards Gaurav On 3/4/2018 12:57 AM, Greg Kroah-Hartman wrote: On Sat, Mar 03, 2018 at 08:22:35PM +0530, Kohli, Gaurav wrote: HI , Is there any known issue of slab poisoning in binder_transaction variable on kernel 4.9, If you are using binder in an Android device with 4.9, please use the version in the android-common tree, as it has all of the newer features backported properly there. You will need that for newer Android systems (like Android O and newer) anyway, so please try that tree. If you still have problems there, please file a bug in AOSP. thanks, greg k-h -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Removing ununsed variable int lo, hi, int data and int i from comedi/drivers/dt2814.c.
Silence following sparse warning: drivers/staging/comedi/drivers/dt2814.c: In function ‘dt2814_interrupt’: drivers/staging/comedi/drivers/dt2814.c:193:6: warning: variable ‘data’ set but not used [-Wunused-but-set-variable] int data; ^~~~ drivers/staging/comedi/drivers/dt2814.c: In function ‘dt2814_attach’: drivers/staging/comedi/drivers/dt2814.c:232:6: warning: variable ‘i’ set but not used [-Wunused-but-set-variable] int i; ^ Signed-off-by: Gaurav Pathak --- drivers/staging/comedi/drivers/dt2814.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt2814.c index d2c715737361..eea587d63e18 100644 --- a/drivers/staging/comedi/drivers/dt2814.c +++ b/drivers/staging/comedi/drivers/dt2814.c @@ -186,22 +186,15 @@ static int dt2814_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) static irqreturn_t dt2814_interrupt(int irq, void *d) { - int lo, hi; struct comedi_device *dev = d; struct dt2814_private *devpriv = dev->private; struct comedi_subdevice *s = dev->read_subdev; - int data; if (!dev->attached) { dev_err(dev->class_dev, "spurious interrupt\n"); return IRQ_HANDLED; } - hi = inb(dev->iobase + DT2814_DATA); - lo = inb(dev->iobase + DT2814_DATA); - - data = (hi << 4) | (lo >> 4); - if (!(--devpriv->ntrig)) { int i; @@ -229,7 +222,6 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it) struct dt2814_private *devpriv; struct comedi_subdevice *s; int ret; - int i; ret = comedi_request_region(dev, it->options[0], 0x2); if (ret) @@ -241,8 +233,6 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it) dev_err(dev->class_dev, "reset error (fatal)\n"); return -EIO; } - i = inb(dev->iobase + DT2814_DATA); - i = inb(dev->iobase + DT2814_DATA); if (it->options[1]) { ret = request_irq(it->options[1], dt2814_interrupt, 0, -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Removing ununsed variable int lo, hi, int data and int i from comedi/drivers/dt2814.c.
Nevermind, my sparse version was broken. Installed sparse 0.6.1, but still no warnings from sparse in any of the directories in drivers staging. E.g.: make C=2 M=drivers/staging/sm750fb CHECK drivers/staging/sm750fb/sm750.c CHECK drivers/staging/sm750fb/sm750_hw.c CHECK drivers/staging/sm750fb/sm750_accel.c CHECK drivers/staging/sm750fb/sm750_cursor.c CHECK drivers/staging/sm750fb/ddk750_chip.c CHECK drivers/staging/sm750fb/ddk750_power.c CHECK drivers/staging/sm750fb/ddk750_mode.c CHECK drivers/staging/sm750fb/ddk750_display.c CHECK drivers/staging/sm750fb/ddk750_swi2c.c CHECK drivers/staging/sm750fb/ddk750_sii164.c CHECK drivers/staging/sm750fb/ddk750_dvi.c CHECK drivers/staging/sm750fb/ddk750_hwi2c.c MODPOST 1 modules For few drivers, I am getting: CC [M] drivers/staging/vt6656/key.o CHECK drivers/staging/vt6656/rf.c /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:417:9: warning: preprocessor token offsetof redefined ./include/linux/stddef.h:17:9: this was the original definition but I guess these are false positive, as #undef offsetof is already present in ./include/linux/stddef.h. On Sun, May 24, 2020 at 02:10:44PM +0200, Luc Van Oostenryck wrote: > Hi, > > On Sun, May 24, 2020 at 05:06:18PM +0530, Gaurav Pathak wrote: > > Silence following sparse warning: > > drivers/staging/comedi/drivers/dt2814.c: In function ‘dt2814_interrupt’: > > drivers/staging/comedi/drivers/dt2814.c:193:6: warning: variable ‘data’ set > > but not used [-Wunused-but-set-variable] > > int data; > > ^~~~ > > drivers/staging/comedi/drivers/dt2814.c: In function ‘dt2814_attach’: > > drivers/staging/comedi/drivers/dt2814.c:232:6: warning: variable ‘i’ set > > but not used [-Wunused-but-set-variable] > > int i; > > ^ > > These warnings are not from sparse but simply from the compiler. > > > static irqreturn_t dt2814_interrupt(int irq, void *d) > > { > > - int lo, hi; > > struct comedi_device *dev = d; > > struct dt2814_private *devpriv = dev->private; > > struct comedi_subdevice *s = dev->read_subdev; > > - int data; > > > > if (!dev->attached) { > > dev_err(dev->class_dev, "spurious interrupt\n"); > > return IRQ_HANDLED; > > } > > > > - hi = inb(dev->iobase + DT2814_DATA); > > - lo = inb(dev->iobase + DT2814_DATA); > > - > > - data = (hi << 4) | (lo >> 4); > > OK, 'data' is unused but are these 2 'inb(dev->iobase + DT2814_DATA)' > needed or not? I would guess that they're needed but I don't know > this hardware. > > > @@ -241,8 +233,6 @@ static int dt2814_attach(struct comedi_device *dev, > > struct comedi_devconfig *it) > > dev_err(dev->class_dev, "reset error (fatal)\n"); > > return -EIO; > > } > > - i = inb(dev->iobase + DT2814_DATA); > > - i = inb(dev->iobase + DT2814_DATA); > > Same here. > > -- Luc ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Removing ununsed variable int lo, hi, int data and int i from comedi/drivers/dt2814.c.
On Tue, May 26, 2020 at 05:13:46PM +0300, Dan Carpenter wrote: > Your subject doesn't use the correct patch prefix please use. > > [PATCH] Staging: comedi: dt2814: remove unused assignments > > Please resend a v2. > > Correct the references to Sparse as well like Luc said. > > regards, > dan carpenter > Hello Dan, Thank you for reviewing and suggesting changes. I have modified the patch and attached it with the e-mail to keep this thread conversation. I hope I have made the changes correctly. Thanks, Gaurav >From ef4a63e66fc09052c4cad808755d1142a9af7011 Mon Sep 17 00:00:00 2001 From: Gaurav Pathak Date: Sun, 24 May 2020 17:06:16 +0530 Subject: [PATCH v2] Staging: comedi: dt2814: remove unused assignments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Silence following compiler warning: drivers/staging/comedi/drivers/dt2814.c: In function ‘dt2814_interrupt’: drivers/staging/comedi/drivers/dt2814.c:193:6: warning: variable ‘data’ set but not used [-Wunused-but-set-variable] int data; ^~~~ drivers/staging/comedi/drivers/dt2814.c: In function ‘dt2814_attach’: drivers/staging/comedi/drivers/dt2814.c:232:6: warning: variable ‘i’ set but not used [-Wunused-but-set-variable] int i; ^ Signed-off-by: Gaurav Pathak --- drivers/staging/comedi/drivers/dt2814.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt2814.c index d2c715737361..eea587d63e18 100644 --- a/drivers/staging/comedi/drivers/dt2814.c +++ b/drivers/staging/comedi/drivers/dt2814.c @@ -186,22 +186,15 @@ static int dt2814_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) static irqreturn_t dt2814_interrupt(int irq, void *d) { - int lo, hi; struct comedi_device *dev = d; struct dt2814_private *devpriv = dev->private; struct comedi_subdevice *s = dev->read_subdev; - int data; if (!dev->attached) { dev_err(dev->class_dev, "spurious interrupt\n"); return IRQ_HANDLED; } - hi = inb(dev->iobase + DT2814_DATA); - lo = inb(dev->iobase + DT2814_DATA); - - data = (hi << 4) | (lo >> 4); - if (!(--devpriv->ntrig)) { int i; @@ -229,7 +222,6 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it) struct dt2814_private *devpriv; struct comedi_subdevice *s; int ret; - int i; ret = comedi_request_region(dev, it->options[0], 0x2); if (ret) @@ -241,8 +233,6 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it) dev_err(dev->class_dev, "reset error (fatal)\n"); return -EIO; } - i = inb(dev->iobase + DT2814_DATA); - i = inb(dev->iobase + DT2814_DATA); if (it->options[1]) { ret = request_irq(it->options[1], dt2814_interrupt, 0, -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3] Staging: comedi: dt2814: remove unused assignments
From: Gaurav Pathak Silence following compiler warning: drivers/staging/comedi/drivers/dt2814.c: In function ‘dt2814_interrupt’: drivers/staging/comedi/drivers/dt2814.c:193:6: warning: variable ‘data’ set but not used [-Wunused-but-set-variable] int data; ^~~~ drivers/staging/comedi/drivers/dt2814.c: In function ‘dt2814_attach’: drivers/staging/comedi/drivers/dt2814.c:232:6: warning: variable ‘i’ set but not used [-Wunused-but-set-variable] int i; ^ Signed-off-by: Gaurav Pathak --- v3: Update from email header. drivers/staging/comedi/drivers/dt2814.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt2814.c index d2c715737361..eea587d63e18 100644 --- a/drivers/staging/comedi/drivers/dt2814.c +++ b/drivers/staging/comedi/drivers/dt2814.c @@ -186,22 +186,15 @@ static int dt2814_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) static irqreturn_t dt2814_interrupt(int irq, void *d) { - int lo, hi; struct comedi_device *dev = d; struct dt2814_private *devpriv = dev->private; struct comedi_subdevice *s = dev->read_subdev; - int data; if (!dev->attached) { dev_err(dev->class_dev, "spurious interrupt\n"); return IRQ_HANDLED; } - hi = inb(dev->iobase + DT2814_DATA); - lo = inb(dev->iobase + DT2814_DATA); - - data = (hi << 4) | (lo >> 4); - if (!(--devpriv->ntrig)) { int i; @@ -229,7 +222,6 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it) struct dt2814_private *devpriv; struct comedi_subdevice *s; int ret; - int i; ret = comedi_request_region(dev, it->options[0], 0x2); if (ret) @@ -241,8 +233,6 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it) dev_err(dev->class_dev, "reset error (fatal)\n"); return -EIO; } - i = inb(dev->iobase + DT2814_DATA); - i = inb(dev->iobase + DT2814_DATA); if (it->options[1]) { ret = request_irq(it->options[1], dt2814_interrupt, 0, -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] USBIP:stub_dev.c fixing string splitted into multiple line issue
Fixed String splitted into multiple line issue using macro Signed-off-by: Kumar Gaurav --- drivers/staging/usbip/stub_dev.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c index 83d629a..3b881e1 100644 --- a/drivers/staging/usbip/stub_dev.c +++ b/drivers/staging/usbip/stub_dev.c @@ -30,6 +30,8 @@ * In most cases, wildcard matching will be okay because driver binding can be * changed dynamically by a userland program. */ +#define USBIP_REG_INTF "register new interface (bus %u dev %u ifn %u)\n" +#define USBIP_REG_DEV "register new device (bus %u dev %u ifn %u)\n" static struct usb_device_id stub_table[] = { #if 0 /* just an example */ @@ -357,8 +359,9 @@ static int stub_probe(struct usb_interface *interface, busid_priv = get_busid_priv(udev_busid); if (!busid_priv || (busid_priv->status == STUB_BUSID_REMOV) || (busid_priv->status == STUB_BUSID_OTHER)) { - dev_info(&interface->dev, "%s is not in match_busid table... " -"skip!\n", udev_busid); + dev_info(&interface->dev, +"%s is not in match_busid table... skip!\n", + udev_busid); /* * Return value should be ENODEV or ENOXIO to continue trying @@ -386,8 +389,7 @@ static int stub_probe(struct usb_interface *interface, return -ENODEV; busid_priv->interf_count++; - dev_info(&interface->dev, "usbip-host: register new interface " -"(bus %u dev %u ifn %u)\n", + dev_info(&interface->dev, USBIP_REG_INTF, udev->bus->busnum, udev->devnum, interface->cur_altsetting->desc.bInterfaceNumber); @@ -412,8 +414,8 @@ static int stub_probe(struct usb_interface *interface, if (!sdev) return -ENOMEM; - dev_info(&interface->dev, "usbip-host: register new device " -"(bus %u dev %u ifn %u)\n", udev->bus->busnum, udev->devnum, + dev_info(&interface->dev, USBIP_REG_DEV, +udev->bus->busnum, udev->devnum, interface->cur_altsetting->desc.bInterfaceNumber); busid_priv->interf_count = 0; @@ -426,7 +428,8 @@ static int stub_probe(struct usb_interface *interface, err = stub_add_files(&interface->dev); if (err) { - dev_err(&interface->dev, "stub_add_files for %s\n", udev_busid); + dev_err(&interface->dev, "stub_add_files for %s\n", + udev_busid); usb_set_intfdata(interface, NULL); usb_put_intf(interface); usb_put_dev(udev); -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] USBIP:stub_dev.c fixing string splitted into multiple line issue
On Thursday 01 August 2013 10:27 AM, Jiany Wu wrote: I have the same idea with julia. It is more difficult to check the log if we use MACRO instead of the strings. If we search in the system log, according to the string, we will find out the macro first. later we also need to find out where the macro is using. 2013/8/1 Julia Lawall mailto:julia.law...@lip6.fr>> On Wed, 31 Jul 2013, Kumar Gaurav wrote: > Fixed String splitted into multiple line issue using macro I'm not an expert on this kind of style issue, but I prefer strings that look like strings. julia > Signed-off-by: Kumar Gaurav mailto:kumargauravgup...@gmail.com>> > --- > drivers/staging/usbip/stub_dev.c | 17 ++--- > 1 file changed, 10 insertions(+), 7 deletions(-) > > diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c > index 83d629a..3b881e1 100644 > --- a/drivers/staging/usbip/stub_dev.c > +++ b/drivers/staging/usbip/stub_dev.c > @@ -30,6 +30,8 @@ > * In most cases, wildcard matching will be okay because driver binding can be > * changed dynamically by a userland program. > */ > +#define USBIP_REG_INTF "register new interface (bus %u dev %u ifn %u)\n" > +#define USBIP_REG_DEV "register new device (bus %u dev %u ifn %u)\n" > static struct usb_device_id stub_table[] = { > #if 0 > /* just an example */ > @@ -357,8 +359,9 @@ static int stub_probe(struct usb_interface *interface, > busid_priv = get_busid_priv(udev_busid); > if (!busid_priv || (busid_priv->status == STUB_BUSID_REMOV) || > (busid_priv->status == STUB_BUSID_OTHER)) { > - dev_info(&interface->dev, "%s is not in match_busid table... " > - "skip!\n", udev_busid); > + dev_info(&interface->dev, > + "%s is not in match_busid table... skip!\n", > + udev_busid); > > /* >* Return value should be ENODEV or ENOXIO to continue trying > @@ -386,8 +389,7 @@ static int stub_probe(struct usb_interface *interface, > return -ENODEV; > > busid_priv->interf_count++; > - dev_info(&interface->dev, "usbip-host: register new interface " > - "(bus %u dev %u ifn %u)\n", > + dev_info(&interface->dev, USBIP_REG_INTF, >udev->bus->busnum, udev->devnum, > interface->cur_altsetting->desc.bInterfaceNumber); > > @@ -412,8 +414,8 @@ static int stub_probe(struct usb_interface *interface, > if (!sdev) > return -ENOMEM; > > - dev_info(&interface->dev, "usbip-host: register new device " > - "(bus %u dev %u ifn %u)\n", udev->bus->busnum, udev->devnum, > + dev_info(&interface->dev, USBIP_REG_DEV, > + udev->bus->busnum, udev->devnum, > interface->cur_altsetting->desc.bInterfaceNumber); > > busid_priv->interf_count = 0; > @@ -426,7 +428,8 @@ static int stub_probe(struct usb_interface *interface, > > err = stub_add_files(&interface->dev); > if (err) { > - dev_err(&interface->dev, "stub_add_files for %s\n", udev_busid); > + dev_err(&interface->dev, "stub_add_files for %s\n", > + udev_busid); > usb_set_intfdata(interface, NULL); > usb_put_intf(interface); > usb_put_dev(udev); > -- > 1.7.9.5 > > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majord...@vger.kernel.org <mailto:majord...@vger.kernel.org> > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to majord...@vger.kernel.org <mailto:majord...@vger.kernel.org> More majordomo info at http://vger.kernel.org/majordomo-info.html Thanks you all for suggestions. I'll try finding some other way. Regargs Kumar Gaurav ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging:zram:zram_drv.c Fixed Error of trailing whitespace
Fixed by removing trailing whitespace Signed-off-by: Kumar Gaurav --- drivers/staging/zram/zram_drv.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c index 82c7202..f590715 100644 --- a/drivers/staging/zram/zram_drv.c +++ b/drivers/staging/zram/zram_drv.c @@ -169,7 +169,7 @@ static inline int is_partial_io(struct bio_vec *bvec) static inline int valid_io_request(struct zram *zram, struct bio *bio) { u64 start, end, bound; - + /* unaligned request */ if (unlikely(bio->bi_sector & (ZRAM_SECTOR_PER_LOGICAL_BLOCK - 1))) return 0; -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel