* [PATCH] Staging: rts5208 : checkpatch.pl fixes [not found] <20170627085852.GA14571@elsys-VirtualBox> @ 2017-06-27 9:16 ` Simo Koskinen 2017-06-27 9:38 ` Greg KH 0 siblings, 1 reply; 6+ messages in thread From: Simo Koskinen @ 2017-06-27 9:16 UTC (permalink / raw) To: gregkh; +Cc: linux-kernel Fixed issues found by checkpatch.pl and changed some dev_info() function call to dev_dgb(). Signed-off-by: Simo Koskinen <koskisoft@gmail.com> --- drivers/staging/rts5208/rtsx.c | 8 ++++---- drivers/staging/rts5208/rtsx_chip.c | 5 +++-- drivers/staging/rts5208/sd.c | 8 ++++---- drivers/staging/rts5208/spi.c | 8 ++++---- drivers/staging/rts5208/xd.c | 25 ++++++++++++++----------- 5 files changed, 29 insertions(+), 25 deletions(-) diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c index b8177f5..7a6ebd0 100644 --- a/drivers/staging/rts5208/rtsx.c +++ b/drivers/staging/rts5208/rtsx.c @@ -171,7 +171,7 @@ static int command_abort(struct scsi_cmnd *srb) struct rtsx_dev *dev = host_to_rtsx(host); struct rtsx_chip *chip = dev->chip; - dev_info(&dev->pci->dev, "%s called\n", __func__); + dev_dbg(&dev->pci->dev, "%s called\n", __func__); scsi_lock(host); @@ -200,7 +200,7 @@ static int device_reset(struct scsi_cmnd *srb) { struct rtsx_dev *dev = host_to_rtsx(srb->device->host); - dev_info(&dev->pci->dev, "%s called\n", __func__); + dev_dbg(&dev->pci->dev, "%s called\n", __func__); return SUCCESS; } @@ -210,7 +210,7 @@ static int bus_reset(struct scsi_cmnd *srb) { struct rtsx_dev *dev = host_to_rtsx(srb->device->host); - dev_info(&dev->pci->dev, "%s called\n", __func__); + dev_dbg(&dev->pci->dev, "%s called\n", __func__); return SUCCESS; } @@ -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_dbg(&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..4895579 100644 --- a/drivers/staging/rts5208/rtsx_chip.c +++ b/drivers/staging/rts5208/rtsx_chip.c @@ -616,8 +616,9 @@ 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..c8915bb 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; @@ -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; } diff --git a/drivers/staging/rts5208/spi.c b/drivers/staging/rts5208/spi.c index 8b8cd95..e227ce0 100644 --- a/drivers/staging/rts5208/spi.c +++ b/drivers/staging/rts5208/spi.c @@ -520,8 +520,8 @@ int spi_get_status(struct scsi_cmnd *srb, struct rtsx_chip *chip) { struct spi_info *spi = &chip->spi; - dev_dbg(rtsx_dev(chip), "spi_get_status: err_code = 0x%x\n", - spi->err_code); + dev_dbg(rtsx_dev(chip), "%s: err_code = 0x%x\n", + __func__, spi->err_code); rtsx_stor_set_xfer_buf(&spi->err_code, min_t(int, scsi_bufflen(srb), 1), srb); scsi_set_resid(srb, scsi_bufflen(srb) - 1); @@ -543,8 +543,8 @@ int spi_set_parameter(struct scsi_cmnd *srb, struct rtsx_chip *chip) spi->clk_div = ((u16)(srb->cmnd[4]) << 8) | srb->cmnd[5]; spi->write_en = srb->cmnd[6]; - dev_dbg(rtsx_dev(chip), "spi_set_parameter: spi_clock = %d, clk_div = %d, write_en = %d\n", - spi->spi_clock, spi->clk_div, spi->write_en); + dev_dbg(rtsx_dev(chip), "%s: spi_clock = %d, clk_div = %d, write_en = %d\n", + __func__, spi->spi_clock, spi->clk_div, spi->write_en); return STATUS_SUCCESS; } diff --git a/drivers/staging/rts5208/xd.c b/drivers/staging/rts5208/xd.c index 74d36f9..9a34f83 100644 --- a/drivers/staging/rts5208/xd.c +++ b/drivers/staging/rts5208/xd.c @@ -885,8 +885,8 @@ static int xd_init_l2p_tbl(struct rtsx_chip *chip) struct xd_info *xd_card = &chip->xd_card; int size, i; - dev_dbg(rtsx_dev(chip), "xd_init_l2p_tbl: zone_cnt = %d\n", - xd_card->zone_cnt); + dev_dbg(rtsx_dev(chip), "%s: zone_cnt = %d\n", + __func__, xd_card->zone_cnt); if (xd_card->zone_cnt < 1) { rtsx_trace(chip); @@ -1026,7 +1026,8 @@ static u32 xd_get_l2p_tbl(struct rtsx_chip *chip, int zone_no, u16 log_off) #ifdef XD_DELAY_WRITE retval = xd_delay_write(chip); if (retval != STATUS_SUCCESS) { - dev_dbg(rtsx_dev(chip), "In xd_get_l2p_tbl, delay write fail!\n"); + dev_dbg(rtsx_dev(chip), "In %s, delay write fail!\n", + __func__); return BLK_NOT_FOUND; } #endif @@ -1434,7 +1435,7 @@ static int xd_build_l2p_tbl(struct rtsx_chip *chip, int zone_no) u16 cur_lst_page_logoff, ent_lst_page_logoff; u8 redunt[11]; - dev_dbg(rtsx_dev(chip), "xd_build_l2p_tbl: %d\n", zone_no); + dev_dbg(rtsx_dev(chip), "%s: %d\n", __func__, zone_no); if (!xd_card->zone) { retval = xd_init_l2p_tbl(chip); @@ -1901,7 +1902,9 @@ static int xd_write_multiple_pages(struct rtsx_chip *chip, u32 old_blk, retval = rtsx_transfer_data_partial(chip, XD_CARD, buf, page_cnt * 512, scsi_sg_count(chip->srb), - index, offset, DMA_TO_DEVICE, chip->xd_timeout); + index, offset, + DMA_TO_DEVICE, + chip->xd_timeout); if (retval < 0) { rtsx_clear_xd_error(chip); @@ -1960,7 +1963,7 @@ int xd_delay_write(struct rtsx_chip *chip) int retval; if (delay_write->delay_write_flag) { - dev_dbg(rtsx_dev(chip), "xd_delay_write\n"); + dev_dbg(rtsx_dev(chip), "%s\n", __func__); retval = xd_switch_clock(chip); if (retval != STATUS_SUCCESS) { rtsx_trace(chip); @@ -2049,7 +2052,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip, start_page); if (retval != STATUS_SUCCESS) { set_sense_type(chip, lun, - SENSE_TYPE_MEDIA_WRITE_ERR); + SENSE_TYPE_MEDIA_WRITE_ERR); rtsx_trace(chip); return STATUS_FAIL; } @@ -2087,7 +2090,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip, if (detect_card_cd(chip, XD_CARD) != STATUS_SUCCESS) { set_sense_type(chip, lun, - SENSE_TYPE_MEDIA_NOT_PRESENT); + SENSE_TYPE_MEDIA_NOT_PRESENT); rtsx_trace(chip); return STATUS_FAIL; } @@ -2147,7 +2150,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip, ptr, &index, &offset); if (retval != STATUS_SUCCESS) { set_sense_type(chip, lun, - SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR); + SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR); rtsx_trace(chip); return STATUS_FAIL; } @@ -2190,10 +2193,10 @@ int xd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip, if (old_blk == BLK_NOT_FOUND) { if (srb->sc_data_direction == DMA_FROM_DEVICE) set_sense_type(chip, lun, - SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR); + SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR); else set_sense_type(chip, lun, - SENSE_TYPE_MEDIA_WRITE_ERR); + SENSE_TYPE_MEDIA_WRITE_ERR); rtsx_trace(chip); return STATUS_FAIL; -- 2.7.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Staging: rts5208 : checkpatch.pl fixes 2017-06-27 9:16 ` [PATCH] Staging: rts5208 : checkpatch.pl fixes Simo Koskinen @ 2017-06-27 9:38 ` Greg KH 0 siblings, 0 replies; 6+ messages in thread From: Greg KH @ 2017-06-27 9:38 UTC (permalink / raw) To: Simo Koskinen; +Cc: linux-kernel On Tue, Jun 27, 2017 at 11:16:40AM +0200, Simo Koskinen wrote: > Fixed issues found by checkpatch.pl and changed some dev_info() > function call to dev_dgb(). Please only do one "type" of thing per patch, and no, "fix issues found by checkpatch" is not "one thing" :) Also, always use scripts/get_maintainer.pl on your patch to determine who and what mailing list, to send your patch to. thanks, greg k-h ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] Staging : rts5208 : checkpatch.pl fixes @ 2017-06-23 13:55 Simo Koskinen 2017-06-23 15:59 ` Joe Perches 0 siblings, 1 reply; 6+ messages in thread From: Simo Koskinen @ 2017-06-23 13:55 UTC (permalink / raw) To: gregkh; +Cc: linux-kernel Fixed some issues reported by checkpatch.pl script. Signed-off-by: Simo Koskinen <koskisoft@gmail.com> --- drivers/staging/rts5208/rtsx.c | 2 +- drivers/staging/rts5208/rtsx_chip.c | 6 ++++-- drivers/staging/rts5208/sd.c | 14 ++++++++++---- drivers/staging/rts5208/spi.c | 11 +++++++---- drivers/staging/rts5208/xd.c | 26 +++++++++++++++----------- 5 files changed, 37 insertions(+), 22 deletions(-) diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c index b8177f5..ceef5fc 100644 --- a/drivers/staging/rts5208/rtsx.c +++ b/drivers/staging/rts5208/rtsx.c @@ -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", "rtsx_remove()"); 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..892b97a 100644 --- a/drivers/staging/rts5208/rtsx_chip.c +++ b/drivers/staging/rts5208/rtsx_chip.c @@ -616,8 +616,10 @@ 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), "%s = 0x%x (%s)\n", + "chip->need_reset", + (unsigned int)(chip->need_reset), + "rtsx_reset_chip"); #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..5bddd5d 100644 --- a/drivers/staging/rts5208/sd.c +++ b/drivers/staging/rts5208/sd.c @@ -910,8 +910,12 @@ 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 (%s = %d, %s = %d)\n", + "sd_change_phase", + "sample_point", + sample_point, + "tune_dir", + tune_dir); if (tune_dir == TUNE_RX) { SD_VP_CTL = SD_VPRX_CTL; @@ -3575,8 +3579,10 @@ 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, %s = 0x%x\n", + "reset_mmc_only", + "sd_card->sd_type", + sd_card->sd_type); return STATUS_SUCCESS; } diff --git a/drivers/staging/rts5208/spi.c b/drivers/staging/rts5208/spi.c index 8b8cd95..05aca86 100644 --- a/drivers/staging/rts5208/spi.c +++ b/drivers/staging/rts5208/spi.c @@ -520,8 +520,8 @@ int spi_get_status(struct scsi_cmnd *srb, struct rtsx_chip *chip) { struct spi_info *spi = &chip->spi; - dev_dbg(rtsx_dev(chip), "spi_get_status: err_code = 0x%x\n", - spi->err_code); + dev_dbg(rtsx_dev(chip), "%s: err_code = 0x%x\n", + "spi_get_status", spi->err_code); rtsx_stor_set_xfer_buf(&spi->err_code, min_t(int, scsi_bufflen(srb), 1), srb); scsi_set_resid(srb, scsi_bufflen(srb) - 1); @@ -543,8 +543,11 @@ int spi_set_parameter(struct scsi_cmnd *srb, struct rtsx_chip *chip) spi->clk_div = ((u16)(srb->cmnd[4]) << 8) | srb->cmnd[5]; spi->write_en = srb->cmnd[6]; - dev_dbg(rtsx_dev(chip), "spi_set_parameter: spi_clock = %d, clk_div = %d, write_en = %d\n", - spi->spi_clock, spi->clk_div, spi->write_en); + dev_dbg(rtsx_dev(chip), "%s: spi_clock = %d, clk_div = %d, write_en = %d\n", + "spi_set_parameter", + spi->spi_clock, + spi->clk_div, + spi->write_en); return STATUS_SUCCESS; } diff --git a/drivers/staging/rts5208/xd.c b/drivers/staging/rts5208/xd.c index 74d36f9..785207a 100644 --- a/drivers/staging/rts5208/xd.c +++ b/drivers/staging/rts5208/xd.c @@ -885,8 +885,9 @@ static int xd_init_l2p_tbl(struct rtsx_chip *chip) struct xd_info *xd_card = &chip->xd_card; int size, i; - dev_dbg(rtsx_dev(chip), "xd_init_l2p_tbl: zone_cnt = %d\n", - xd_card->zone_cnt); + dev_dbg(rtsx_dev(chip), "%s: zone_cnt = %d\n", + "xd_init_l2p_tbl", + xd_card->zone_cnt); if (xd_card->zone_cnt < 1) { rtsx_trace(chip); @@ -1026,7 +1027,8 @@ static u32 xd_get_l2p_tbl(struct rtsx_chip *chip, int zone_no, u16 log_off) #ifdef XD_DELAY_WRITE retval = xd_delay_write(chip); if (retval != STATUS_SUCCESS) { - dev_dbg(rtsx_dev(chip), "In xd_get_l2p_tbl, delay write fail!\n"); + dev_dbg(rtsx_dev(chip), "In %s, delay write fail!\n", + "xd_get_l2p_tbl"); return BLK_NOT_FOUND; } #endif @@ -1434,7 +1436,7 @@ static int xd_build_l2p_tbl(struct rtsx_chip *chip, int zone_no) u16 cur_lst_page_logoff, ent_lst_page_logoff; u8 redunt[11]; - dev_dbg(rtsx_dev(chip), "xd_build_l2p_tbl: %d\n", zone_no); + dev_dbg(rtsx_dev(chip), "%s: %d\n", "xd_build_l2p_tbl", zone_no); if (!xd_card->zone) { retval = xd_init_l2p_tbl(chip); @@ -1901,7 +1903,9 @@ static int xd_write_multiple_pages(struct rtsx_chip *chip, u32 old_blk, retval = rtsx_transfer_data_partial(chip, XD_CARD, buf, page_cnt * 512, scsi_sg_count(chip->srb), - index, offset, DMA_TO_DEVICE, chip->xd_timeout); + index, offset, + DMA_TO_DEVICE, + chip->xd_timeout); if (retval < 0) { rtsx_clear_xd_error(chip); @@ -1960,7 +1964,7 @@ int xd_delay_write(struct rtsx_chip *chip) int retval; if (delay_write->delay_write_flag) { - dev_dbg(rtsx_dev(chip), "xd_delay_write\n"); + dev_dbg(rtsx_dev(chip), "%s\n", "xd_delay_write"); retval = xd_switch_clock(chip); if (retval != STATUS_SUCCESS) { rtsx_trace(chip); @@ -2049,7 +2053,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip, start_page); if (retval != STATUS_SUCCESS) { set_sense_type(chip, lun, - SENSE_TYPE_MEDIA_WRITE_ERR); + SENSE_TYPE_MEDIA_WRITE_ERR); rtsx_trace(chip); return STATUS_FAIL; } @@ -2087,7 +2091,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip, if (detect_card_cd(chip, XD_CARD) != STATUS_SUCCESS) { set_sense_type(chip, lun, - SENSE_TYPE_MEDIA_NOT_PRESENT); + SENSE_TYPE_MEDIA_NOT_PRESENT); rtsx_trace(chip); return STATUS_FAIL; } @@ -2147,7 +2151,7 @@ int xd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip, ptr, &index, &offset); if (retval != STATUS_SUCCESS) { set_sense_type(chip, lun, - SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR); + SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR); rtsx_trace(chip); return STATUS_FAIL; } @@ -2190,10 +2194,10 @@ int xd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip, if (old_blk == BLK_NOT_FOUND) { if (srb->sc_data_direction == DMA_FROM_DEVICE) set_sense_type(chip, lun, - SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR); + SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR); else set_sense_type(chip, lun, - SENSE_TYPE_MEDIA_WRITE_ERR); + SENSE_TYPE_MEDIA_WRITE_ERR); rtsx_trace(chip); return STATUS_FAIL; -- 2.7.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Staging : rts5208 : checkpatch.pl fixes 2017-06-23 13:55 [PATCH] Staging : " Simo Koskinen @ 2017-06-23 15:59 ` Joe Perches 2017-06-26 9:12 ` Simo Koskinen 0 siblings, 1 reply; 6+ messages in thread From: Joe Perches @ 2017-06-23 15:59 UTC (permalink / raw) To: Simo Koskinen, gregkh; +Cc: linux-kernel On Fri, 2017-06-23 at 15:55 +0200, Simo Koskinen wrote: > Fixed some issues reported by checkpatch.pl script. [] > diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c > index b8177f5..ceef5fc 100644 > --- a/drivers/staging/rts5208/rtsx.c > +++ b/drivers/staging/rts5208/rtsx.c > @@ -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", "rtsx_remove()"); This would be better as dev_dbg > > 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..892b97a 100644 > --- a/drivers/staging/rts5208/rtsx_chip.c > +++ b/drivers/staging/rts5208/rtsx_chip.c > @@ -616,8 +616,10 @@ 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), "%s = 0x%x (%s)\n", > + "chip->need_reset", > + (unsigned int)(chip->need_reset), > + "rtsx_reset_chip"); This and other changes that take part of the format and convert them to '"%s", substrings' are not good. checkpatch doesn't emit a warning for long formats. > diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c [] > @@ -910,8 +910,12 @@ 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 (%s = %d, %s = %d)\n", > + "sd_change_phase", > + "sample_point", > + sample_point, > + "tune_dir", > + tune_dir); etc. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Staging : rts5208 : checkpatch.pl fixes 2017-06-23 15:59 ` Joe Perches @ 2017-06-26 9:12 ` Simo Koskinen 2017-06-26 9:29 ` Frans Klaver 0 siblings, 1 reply; 6+ messages in thread From: Simo Koskinen @ 2017-06-26 9:12 UTC (permalink / raw) To: Joe Perches; +Cc: gregkh, linux-kernel On Fri, Jun 23, 2017 at 5:59 PM, Joe Perches <joe@perches.com> wrote: > On Fri, 2017-06-23 at 15:55 +0200, Simo Koskinen wrote: >> Fixed some issues reported by checkpatch.pl script. > [] >> diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c >> index b8177f5..ceef5fc 100644 >> --- a/drivers/staging/rts5208/rtsx.c >> +++ b/drivers/staging/rts5208/rtsx.c >> @@ -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", "rtsx_remove()"); > > This would be better as dev_dbg True, I can change that... >> >> 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..892b97a 100644 >> --- a/drivers/staging/rts5208/rtsx_chip.c >> +++ b/drivers/staging/rts5208/rtsx_chip.c >> @@ -616,8 +616,10 @@ 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), "%s = 0x%x (%s)\n", >> + "chip->need_reset", >> + (unsigned int)(chip->need_reset), >> + "rtsx_reset_chip"); > > This and other changes that take part of the format > and convert them to '"%s", substrings' are not good. > checkpatch doesn't emit a warning for long formats. The reason for changes were the following warning when run the checkpatch.pl script: WARNING: Prefer using '"%s...", __func__' to using 'rtsx_reset_chip', this function's name, in a string #619: FILE: rtsx_chip.c:619: + dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x (rtsx_reset_chip)\n", So it's not a good idea to fix these warnings? On Fri, Jun 23, 2017 at 5:59 PM, Joe Perches <joe@perches.com> wrote: > On Fri, 2017-06-23 at 15:55 +0200, Simo Koskinen wrote: >> Fixed some issues reported by checkpatch.pl script. > [] >> diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c >> index b8177f5..ceef5fc 100644 >> --- a/drivers/staging/rts5208/rtsx.c >> +++ b/drivers/staging/rts5208/rtsx.c >> @@ -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", "rtsx_remove()"); > > This would be better as dev_dbg >> >> 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..892b97a 100644 >> --- a/drivers/staging/rts5208/rtsx_chip.c >> +++ b/drivers/staging/rts5208/rtsx_chip.c >> @@ -616,8 +616,10 @@ 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), "%s = 0x%x (%s)\n", >> + "chip->need_reset", >> + (unsigned int)(chip->need_reset), >> + "rtsx_reset_chip"); > > This and other changes that take part of the format > and convert them to '"%s", substrings' are not good. > checkpatch doesn't emit a warning for long formats. > >> diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c > [] >> @@ -910,8 +910,12 @@ 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 (%s = %d, %s = %d)\n", >> + "sd_change_phase", >> + "sample_point", >> + sample_point, >> + "tune_dir", >> + tune_dir); > > etc. > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Staging : rts5208 : checkpatch.pl fixes 2017-06-26 9:12 ` Simo Koskinen @ 2017-06-26 9:29 ` Frans Klaver 0 siblings, 0 replies; 6+ messages in thread From: Frans Klaver @ 2017-06-26 9:29 UTC (permalink / raw) To: Simo Koskinen; +Cc: Joe Perches, Greg KH, linux-kernel On Mon, Jun 26, 2017 at 11:12 AM, Simo Koskinen <koskisoft@gmail.com> wrote: > On Fri, Jun 23, 2017 at 5:59 PM, Joe Perches <joe@perches.com> wrote: >> On Fri, 2017-06-23 at 15:55 +0200, Simo Koskinen wrote: >>> Fixed some issues reported by checkpatch.pl script. >> [] >>> diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c >>> index b8177f5..ceef5fc 100644 >>> --- a/drivers/staging/rts5208/rtsx.c >>> +++ b/drivers/staging/rts5208/rtsx.c >>> @@ -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", "rtsx_remove()"); >> >> This would be better as dev_dbg > True, I can change that... > > >>> >>> 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..892b97a 100644 >>> --- a/drivers/staging/rts5208/rtsx_chip.c >>> +++ b/drivers/staging/rts5208/rtsx_chip.c >>> @@ -616,8 +616,10 @@ 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), "%s = 0x%x (%s)\n", >>> + "chip->need_reset", >>> + (unsigned int)(chip->need_reset), >>> + "rtsx_reset_chip"); >> >> This and other changes that take part of the format >> and convert them to '"%s", substrings' are not good. >> checkpatch doesn't emit a warning for long formats. > The reason for changes were the following warning when run the > checkpatch.pl script: > > WARNING: Prefer using '"%s...", __func__' to using 'rtsx_reset_chip', > this function's name, in a string > #619: FILE: rtsx_chip.c:619: > + dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x (rtsx_reset_chip)\n", > > So it's not a good idea to fix these warnings? The warning suggests you change this to dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x (%s)\n", (unsigned int)(chip->need_reset), __func__); It doesn't mention the chip->need_reset part. The reason is simply that when the function name changes, this doesn't have to be updated. That same reasoning doesn't hold up for when something changes in "chip->need_reset". Frans ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-06-27 9:38 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20170627085852.GA14571@elsys-VirtualBox> 2017-06-27 9:16 ` [PATCH] Staging: rts5208 : checkpatch.pl fixes Simo Koskinen 2017-06-27 9:38 ` Greg KH 2017-06-23 13:55 [PATCH] Staging : " Simo Koskinen 2017-06-23 15:59 ` Joe Perches 2017-06-26 9:12 ` Simo Koskinen 2017-06-26 9:29 ` Frans Klaver
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.