Re: [Outreachy kernel] [PATCH] staging: qlge: Fix multiple assignments warning by splitting the assignement into two each
On Wed, 2019-10-09 at 22:48 +0200, Julia Lawall wrote: > On Wed, 9 Oct 2019, Jules Irenge wrote: > > Fix multiple assignments warning " check > > issued by checkpatch.pl tool: > > "CHECK: multiple assignments should be avoided". [] > > diff --git a/drivers/staging/qlge/qlge_dbg.c > > b/drivers/staging/qlge/qlge_dbg.c [] > > @@ -141,8 +141,10 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, > > u32 *direct_ptr, temp; > > u32 *indirect_ptr; > > > > - xfi_direct_valid = xfi_indirect_valid = 0; > > - xaui_direct_valid = xaui_indirect_valid = 1; > > + xfi_indirect_valid = 0; > > + xfi_direct_valid = xfi_indirect_valid; > > + xaui_indirect_valid = 1; > > + xaui_direct_valid = xaui_indirect_valid > > Despite checkpatch, I think that the original code was easier to > understand. It'd likely be easier to understand if all the _valid uses were bool and the ql_get_both_serdes _valid arguments were change to bool from unsigned int as well. btw: qlge likely is going to be deleted and not updated. --- drivers/staging/qlge/qlge_dbg.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 7e16066a3527..90ab37d4c49d 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -112,7 +112,7 @@ static int ql_read_serdes_reg(struct ql_adapter *qdev, u32 reg, u32 *data) static void ql_get_both_serdes(struct ql_adapter *qdev, u32 addr, u32 *direct_ptr, u32 *indirect_ptr, - unsigned int direct_valid, unsigned int indirect_valid) + bool direct_valid, bool indirect_valid) { unsigned int status; @@ -136,14 +136,12 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump) { int status; - unsigned int xfi_direct_valid, xfi_indirect_valid, xaui_direct_valid; - unsigned int xaui_indirect_valid, i; + bool xfi_direct_valid = false, xfi_indirect_valid = false; + bool xaui_direct_valid = true, xaui_indirect_valid = true; + unsigned int i; u32 *direct_ptr, temp; u32 *indirect_ptr; - xfi_direct_valid = xfi_indirect_valid = 0; - xaui_direct_valid = xaui_indirect_valid = 1; - /* The XAUI needs to be read out per port */ status = ql_read_other_func_serdes_reg(qdev, XG_SERDES_XAUI_HSS_PCS_START, &temp); @@ -152,7 +150,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, if ((temp & XG_SERDES_ADDR_XAUI_PWR_DOWN) == XG_SERDES_ADDR_XAUI_PWR_DOWN) - xaui_indirect_valid = 0; + xaui_indirect_valid = false; status = ql_read_serdes_reg(qdev, XG_SERDES_XAUI_HSS_PCS_START, &temp); @@ -161,7 +159,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, if ((temp & XG_SERDES_ADDR_XAUI_PWR_DOWN) == XG_SERDES_ADDR_XAUI_PWR_DOWN) - xaui_direct_valid = 0; + xaui_direct_valid = false; /* * XFI register is shared so only need to read one @@ -176,18 +174,18 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, /* now see if i'm NIC 1 or NIC 2 */ if (qdev->func & 1) /* I'm NIC 2, so the indirect (NIC1) xfi is up. */ - xfi_indirect_valid = 1; + xfi_indirect_valid = true; else - xfi_direct_valid = 1; + xfi_direct_valid = true; } if ((temp & XG_SERDES_ADDR_XFI2_PWR_UP) == XG_SERDES_ADDR_XFI2_PWR_UP) { /* now see if i'm NIC 1 or NIC 2 */ if (qdev->func & 1) /* I'm NIC 2, so the indirect (NIC1) xfi is up. */ - xfi_direct_valid = 1; + xfi_direct_valid = true; else - xfi_indirect_valid = 1; + xfi_indirect_valid = true; } /* Get XAUI_AN register block. */ ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 1/2] dmaengine: avalon: Intel Avalon-MM DMA Interface for PCIe
On Wed, Oct 09, 2019 at 09:53:23PM +0300, Dan Carpenter wrote: > > > > + u32 *rd_flags = hw->dma_desc_table_rd.cpu_addr->flags; > > > > + u32 *wr_flags = hw->dma_desc_table_wr.cpu_addr->flags; > > > > + struct avalon_dma_desc *desc; > > > > + struct virt_dma_desc *vdesc; > > > > + bool rd_done; > > > > + bool wr_done; > > > > + > > > > + spin_lock(lock); > > > > + > > > > + rd_done = (hw->h2d_last_id < 0); > > > > + wr_done = (hw->d2h_last_id < 0); > > > > + > > > > + if (rd_done && wr_done) { > > > > + spin_unlock(lock); > > > > + return IRQ_NONE; > > > > + } > > > > + > > > > + do { > > > > + if (!rd_done && rd_flags[hw->h2d_last_id]) > > > > + rd_done = true; > > > > + > > > > + if (!wr_done && wr_flags[hw->d2h_last_id]) > > > > + wr_done = true; > > > > + } while (!rd_done || !wr_done); > > > > > > This loop is very strange. It feels like the last_id indexes needs > > > to atomic or protected from racing somehow so we don't do an out of > > > bounds read. [...] > You're missing my point. When we set > hw->d2h_last_id = 1; [1] > ... > hw->d2h_last_id = 2; [2] > There is a tiny moment where ->d2h_last_id is transitioning from 1 to 2 > where its value is unknown. We're in a busy loop here so we have a > decent chance of hitting that 1/1000,000th of a second. If we happen to > hit it at exactly the right time then we're reading from a random > address and it will cause an oops. > > We have to use atomic_t types or something to handle race conditions. Err.. I am still missing the point :( In your example I do see a chance for a reader to read out 1 at point in time [2] - because of SMP race. But what could it be other than 1 or 2? Anyways, all code paths dealing with h2d_last_id and d2h_last_id indexes are protected with a spinlock. > regards, > dan carpenter > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: qlge: Fix multiple assignments warning by splitting the assignement into two each
On Wed, Oct 09, 2019 at 09:10:29PM +0100, Jules Irenge wrote: > Fix multiple assignments warning " check > issued by checkpatch.pl tool: > "CHECK: multiple assignments should be avoided". > > Signed-off-by: Jules Irenge > --- > drivers/staging/qlge/qlge_dbg.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c > index 086f067fd899..69bd4710c5ec 100644 > --- a/drivers/staging/qlge/qlge_dbg.c > +++ b/drivers/staging/qlge/qlge_dbg.c > @@ -141,8 +141,10 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, > u32 *direct_ptr, temp; > u32 *indirect_ptr; > > - xfi_direct_valid = xfi_indirect_valid = 0; > - xaui_direct_valid = xaui_indirect_valid = 1; > + xfi_indirect_valid = 0; > + xfi_direct_valid = xfi_indirect_valid; > + xaui_indirect_valid = 1; > + xaui_direct_valid = xaui_indirect_valid The original code is fine here. Just ignore checkpatch on this. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
driverdev-devel@linuxdriverproject.org
On Wed, Oct 09, 2019 at 03:07:39PM +, Jerome Pouiller wrote: > On Wednesday 9 October 2019 09:38:31 CEST kbuild test robot wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git > > staging-testing > > head: d49d1c76b96ebf39539e93d5ab7943a01ef70e4f > > commit: 1a61af0f8cbecd1610c6fc380d0fb00f57fd43f2 [57/111] staging: wfx: > > allow to scan networks > > > > If you fix the issue, kindly add following tag > > Reported-by: kbuild test robot > > Reported-by: Dan Carpenter > > > > New smatch warnings: > > drivers/staging/wfx/scan.c:207 wfx_scan_work() warn: inconsistent returns > > 'sem:&wvif->scan.lock'. > > Locked on: line 201 > > Unlocked on: line 145 > > > > # > > https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/?id=1a61af0f8cbecd1610c6fc380d0fb00f57fd43f2 > > git remote add staging > > https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git > > git remote update staging > > git checkout 1a61af0f8cbecd1610c6fc380d0fb00f57fd43f2 > > vim +207 drivers/staging/wfx/scan.c > > > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 116 void wfx_scan_work(struct > > work_struct *work) > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 117 { > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 118 struct wfx_vif > > *wvif = container_of(work, struct wfx_vif, scan.work); > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 119 struct > > ieee80211_channel **it; > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 120 struct > > wfx_scan_params scan = { > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 121 > > .scan_req.scan_type.type = 0,/* Foreground */ > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 122 }; > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 123 struct > > ieee80211_channel *first; > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 124 int i; > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 125 > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 126 > > down(&wvif->scan.lock); > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 127 > > mutex_lock(&wvif->wdev->conf_mutex); > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 128 > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 129 if (!wvif->scan.req > > || wvif->scan.curr == wvif->scan.end) { > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 130 if > > (wvif->scan.output_power != wvif->wdev->output_power) > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 131 > > hif_set_output_power(wvif, wvif->wdev->output_power * 10); > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 132 > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 133 if > > (wvif->scan.status < 0) > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 134 > > dev_warn(wvif->wdev->dev, "scan failed\n"); > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 135 else if > > (wvif->scan.req) > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 136 > > dev_dbg(wvif->wdev->dev, "scan completed\n"); > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 137 else > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 138 > > dev_dbg(wvif->wdev->dev, "scan canceled\n"); > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 139 > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 140 > > wvif->scan.req = NULL; > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 141 > > wfx_tx_unlock(wvif->wdev); > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 142 > > mutex_unlock(&wvif->wdev->conf_mutex); > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 143 > > __ieee80211_scan_completed_compat(wvif->wdev->hw, wvif->scan.status ? 1 : > > 0); > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 144 > > up(&wvif->scan.lock); > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 145 return; > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 146 } > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 147 first = > > *wvif->scan.curr; > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 148 > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 149 for (it = > > wvif->scan.curr + 1, i = 1; > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 150 it != > > wvif->scan.end && i < HIF_API_MAX_NB_CHANNELS; > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 151 ++it, ++i) { > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 152 if > > ((*it)->band != first->band) > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 153 > > break; > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 154 if > > (((*it)->flags ^ first->flags) & > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 155 > > IEEE80211_CHAN_NO_IR) > > 1a61af0f8cbecd Jérôme Pouiller 2019-09-19 156 > > break; > > 1a
Re: [PATCH] KPC2000: kpc2000_spi.c: Fix style issues (line length)
On Wed, Oct 09, 2019 at 08:08:57PM -0700, Chandra Annamaneni wrote: > Resoved: "WARNING: line over 80 characters" from checkpatch.pl > > Signed-off-by: Chandra Annamaneni > --- > drivers/staging/kpc2000/kpc2000_spi.c | 20 ++-- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/drivers/staging/kpc2000/kpc2000_spi.c > b/drivers/staging/kpc2000/kpc2000_spi.c > index 3be33c4..ef78b6d 100644 > --- a/drivers/staging/kpc2000/kpc2000_spi.c > +++ b/drivers/staging/kpc2000/kpc2000_spi.c > @@ -30,19 +30,19 @@ > #include "kpc.h" > > static struct mtd_partition p2kr0_spi0_parts[] = { > - { .name = "SLOT_0", .size = 7798784,.offset = 0, > }, > - { .name = "SLOT_1", .size = 7798784,.offset = > MTDPART_OFS_NXTBLK}, > - { .name = "SLOT_2", .size = 7798784,.offset = > MTDPART_OFS_NXTBLK}, > - { .name = "SLOT_3", .size = 7798784,.offset = > MTDPART_OFS_NXTBLK}, > - { .name = "CS0_EXTRA", .size = MTDPART_SIZ_FULL, .offset = > MTDPART_OFS_NXTBLK}, > + { .name = "SLOT_0", .size = 7798784, .offset = 0,}, > + { .name = "SLOT_1", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, > + { .name = "SLOT_2", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, > + { .name = "SLOT_3", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, > + { .name = "CS0_EXTRA", .size = MTDPART_SIZ_FULL, .offset = > MTDPART_OFS_NXTBLK}, > }; > > static struct mtd_partition p2kr0_spi1_parts[] = { > - { .name = "SLOT_4", .size = 7798784,.offset = 0, > }, > - { .name = "SLOT_5", .size = 7798784,.offset = > MTDPART_OFS_NXTBLK}, > - { .name = "SLOT_6", .size = 7798784,.offset = > MTDPART_OFS_NXTBLK}, > - { .name = "SLOT_7", .size = 7798784,.offset = > MTDPART_OFS_NXTBLK}, > - { .name = "CS1_EXTRA", .size = MTDPART_SIZ_FULL, .offset = > MTDPART_OFS_NXTBLK}, > + { .name = "SLOT_4", .size = 7798784, .offset = 0,}, > + { .name = "SLOT_5", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, > + { .name = "SLOT_6", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, > + { .name = "SLOT_7", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, > + { .name = "CS1_EXTRA", .size = MTDPART_SIZ_FULL, .offset = > MTDPART_OFS_NXTBLK}, > }; > > static struct flash_platform_data p2kr0_spi0_pdata = { > -- > 2.7.4 > Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - You sent multiple patches, yet no indication of which ones should be applied in which order. Greg could just guess, but if you are receiving this email, he guessed wrong and the patches didn't apply. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for a description of how to do this so that Greg has a chance to apply these correctly. - You did not specify a description of why the patch is needed, or possibly, any description at all, in the email body. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what is needed in order to properly describe the change. - You did not write a descriptive Subject: for the patch, allowing Greg, and everyone else, to know what this patch is all about. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what a proper Subject: line should look like. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/4] staging: rtl8723bs: Remove comparisons to booleans in conditionals.
On Thu, Oct 10, 2019 at 06:39:23AM +0300, Wambui Karuga wrote: > if (is_primary_adapter(adapter)) > DBG_871X("IsBtDisabled =%d, IsBtControlLps =%d\n", > hal_btcoex_IsBtDisabled(adapter), hal_btcoex_IsBtControlLps(adapter)); > > - if ((adapter_to_pwrctl(adapter)->bFwCurrentInPSMode == true) > - && (hal_btcoex_IsBtControlLps(adapter) == false) > + if ((adapter_to_pwrctl(adapter)->bFwCurrentInPSMode) > + && !(hal_btcoex_IsBtControlLps(adapter)) Delete the extra parentheses as well, because they don't make sense when we remove the == false comparison. It's part of doing "one thing" is to the whole thing and not leave bits undone. && !hal_btcoex_IsBtControlLps(adapter) > ) { > u8 bEnterPS; > > @@ -2047,7 +2047,7 @@ static int rtw_check_join_candidate(struct mlme_priv > *mlme > > > /* check bssid, if needed */ > - if (mlme->assoc_by_bssid == true) { > + if (mlme->assoc_by_bssid) { > if (memcmp(competitor->network.MacAddress, mlme->assoc_bssid, > ETH_ALEN)) > goto exit; > } > @@ -2805,7 +2805,6 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 > *pie, uint ie_len, u8 channe > struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); > u8 cbw40_enable = 0; > > - > if (!phtpriv->ht_option) > return; > > @@ -2815,7 +2814,7 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 > *pie, uint ie_len, u8 channe > DBG_871X("+rtw_update_ht_cap()\n"); > > /* maybe needs check if ap supports rx ampdu. */ > - if ((phtpriv->ampdu_enable == false) && (pregistrypriv->ampdu_enable == > 1)) { > + if (!(phtpriv->ampdu_enable) && pregistrypriv->ampdu_enable == 1) { Same. > if (pregistrypriv->wifi_spec == 1) { > /* remove this part because testbed AP should disable > RX AMPDU */ > /* phtpriv->ampdu_enable = false; */ regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 1/4] staging: rtl8723bs: Remove comparisons to NULL in conditionals
On Thu, Oct 10, 2019 at 07:49:05AM +0300, Wambui Karuga wrote: > Remove most comparisons to NULL in conditionals in > drivers/staging/rtl8723bs/core/rtw_mlme.c > Issues reported by checkpatch.pl as: > CHECK: Comparison to NULL could be written > > Signed-off-by: Wambui Karuga > --- > drivers/staging/rtl8723bs/core/rtw_mlme.c | 46 +++ > 1 file changed, 23 insertions(+), 23 deletions(-) Due to lots of other changes in this file recently, this patch does not apply, and so the rest of this series does not apply either. Can you please rebase this against my staging-testing branch and resend? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 0/4] staging: rtl8723bs: Style clean-up in rtw_mlme.c
On Thu, Oct 10, 2019 at 07:49:04AM +0300, Wambui Karuga wrote: > This patchset addresses multiple style and formatting issues reported by > checkpatch.pl in drivers/staging/rtl8723bs/core/rtw_mlme.c > > PATCH v2 of the series corrects the "patchest" mispelling in the > original cover letter and provides a clearer subject line. The cover letter isn't stored in the git log so spelling is not important. The original subjects were fine as well. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: sm750fb: Potential uninitialized field in "pll"
On Wed, Oct 09, 2019 at 09:38:08PM -0700, Yizhuo wrote: > Inside function set_chip_clock(), struct pll is supposed to be > initialized in sm750_calc_pll_value(), if condition > "diff < mini_diff" in sm750_calc_pll_value() cannot be fulfilled, > then some field of pll will not be initialized but used in > function sm750_format_pll_reg(), which is potentially unsafe. > > Signed-off-by: Yizhuo > --- > drivers/staging/sm750fb/ddk750_chip.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/sm750fb/ddk750_chip.c > b/drivers/staging/sm750fb/ddk750_chip.c > index 5a317cc98a4b..31b3cf9c2d8b 100644 > --- a/drivers/staging/sm750fb/ddk750_chip.c > +++ b/drivers/staging/sm750fb/ddk750_chip.c > @@ -55,7 +55,7 @@ static unsigned int get_mxclk_freq(void) > */ > static void set_chip_clock(unsigned int frequency) > { > - struct pll_value pll; > + struct pll_value pll = {}; > unsigned int actual_mx_clk; > > /* Cheok_0509: For SM750LE, the chip clock is fixed. Nothing to set. */ This doesn't apply to my tree at all. Please rebase it against the staging-next branch of staging.git and resend. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Outreachy kernel] [PATCH] staging: qlge: Fix multiple assignments warning by splitting the assignement into two each
I was just about to give a newbie a Reviewed-by cookie until I saw it was a Joe Perches patch without a commit message or a sign off. And then I was annoyed that I had invested any time in it at all. I even dropped out of my email client for this! :P If you want to resend as a proper commit then you can still have my Reviewed-by I guess. Reviewed-by: Dan Carpenter regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: qlge: Fix multiple assignments warning by splitting the assignement into two each
Hi Jules, Thank you for the patch! Yet something to improve: [auto build test ERROR on staging/staging-testing] url: https://github.com/0day-ci/linux/commits/Jules-Irenge/staging-qlge-Fix-multiple-assignments-warning-by-splitting-the-assignement-into-two-each/20191010-141520 config: x86_64-randconfig-g004-201940 (attached as .config) compiler: gcc-7 (Debian 7.4.0-13) 7.4.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 If you fix the issue, kindly add following tag Reported-by: kbuild test robot All errors (new ones prefixed by >>): drivers/staging/qlge/qlge_dbg.c: In function 'ql_get_serdes_regs': >> drivers/staging/qlge/qlge_dbg.c:150:2: error: expected ';' before 'status' status = ql_read_other_func_serdes_reg(qdev, ^~ vim +150 drivers/staging/qlge/qlge_dbg.c a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 134 a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 135 static int ql_get_serdes_regs(struct ql_adapter *qdev, a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 136 struct ql_mpi_coredump *mpi_coredump) a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 137 { a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 138 int status; a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 139 unsigned int xfi_direct_valid, xfi_indirect_valid, xaui_direct_valid; a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 140 unsigned int xaui_indirect_valid, i; a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 141 u32 *direct_ptr, temp; a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 142 u32 *indirect_ptr; a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 143 53cbe4642113f8 drivers/staging/qlge/qlge_dbg.c Jules Irenge 2019-10-09 144 xfi_indirect_valid = 0; 53cbe4642113f8 drivers/staging/qlge/qlge_dbg.c Jules Irenge 2019-10-09 145 xfi_direct_valid = xfi_indirect_valid; 53cbe4642113f8 drivers/staging/qlge/qlge_dbg.c Jules Irenge 2019-10-09 146 xaui_indirect_valid = 1; 53cbe4642113f8 drivers/staging/qlge/qlge_dbg.c Jules Irenge 2019-10-09 147 xaui_direct_valid = xaui_indirect_valid a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 148 a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 149 /* The XAUI needs to be read out per port */ a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 @150 status = ql_read_other_func_serdes_reg(qdev, a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 151 XG_SERDES_XAUI_HSS_PCS_START, &temp); a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 152 if (status) a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 153 temp = XG_SERDES_ADDR_XAUI_PWR_DOWN; 4db93fb8aca3e9 drivers/net/ethernet/qlogic/qlge/qlge_dbg.c Gustavo A. R. Silva 2017-08-12 154 a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 155 if ((temp & XG_SERDES_ADDR_XAUI_PWR_DOWN) == a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 156 XG_SERDES_ADDR_XAUI_PWR_DOWN) a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 157 xaui_indirect_valid = 0; a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 158 4db93fb8aca3e9 drivers/net/ethernet/qlogic/qlge/qlge_dbg.c Gustavo A. R. Silva 2017-08-12 159 status = ql_read_serdes_reg(qdev, XG_SERDES_XAUI_HSS_PCS_START, &temp); a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 160 a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 161 if (status) a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 162 temp = XG_SERDES_ADDR_XAUI_PWR_DOWN; a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 163 a48c86fdb1253f drivers/net/qlge/qlge_dbg.c Ron Mercer 2010-01-15 164 if ((temp & XG_SER
[PATCH v2 0/2] Add initial support for slimport anx7625
Hi all, The following series add initial support for the Slimport ANX7625 transmitter, a ultra-low power Full-HD 4K MIPI to DP transmitter designed for portable device. This is the initial version, any mistakes, please let me know, I will fix it in the next series. Thanks, Xin Xin Ji (2): dt-bindings: drm/bridge: anx7625: MIPI to DP transmitter binding drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver .../bindings/display/bridge/anx7625.yaml | 96 + drivers/gpu/drm/bridge/Makefile|2 +- drivers/gpu/drm/bridge/analogix/Kconfig|6 + drivers/gpu/drm/bridge/analogix/Makefile |1 + drivers/gpu/drm/bridge/analogix/anx7625.c | 2155 drivers/gpu/drm/bridge/analogix/anx7625.h | 406 6 files changed, 2665 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/display/bridge/anx7625.yaml create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.c create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.h -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver
The ANX7625 is an ultra-low power 4K Mobile HD Transmitter designed for portable device. It converts MIPI DSI/DPI to DisplayPort 1.3 4K. The ANX7625 can support both USB Type-C PD feature and MIPI DSI/DPI to DP feature. This driver only enabled MIPI DSI/DPI to DP feature. Signed-off-by: Xin Ji --- drivers/gpu/drm/bridge/Makefile |2 +- drivers/gpu/drm/bridge/analogix/Kconfig |6 + drivers/gpu/drm/bridge/analogix/Makefile |1 + drivers/gpu/drm/bridge/analogix/anx7625.c | 2155 + drivers/gpu/drm/bridge/analogix/anx7625.h | 406 ++ 5 files changed, 2569 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.c create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.h diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index 4934fcf..bcd388a 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -12,8 +12,8 @@ obj-$(CONFIG_DRM_SII9234) += sii9234.o obj-$(CONFIG_DRM_THINE_THC63LVD1024) += thc63lvd1024.o obj-$(CONFIG_DRM_TOSHIBA_TC358764) += tc358764.o obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o -obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/ obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/ obj-$(CONFIG_DRM_TI_SN65DSI86) += ti-sn65dsi86.o obj-$(CONFIG_DRM_TI_TFP410) += ti-tfp410.o +obj-y += analogix/ obj-y += synopsys/ diff --git a/drivers/gpu/drm/bridge/analogix/Kconfig b/drivers/gpu/drm/bridge/analogix/Kconfig index e930ff9..b2f127e 100644 --- a/drivers/gpu/drm/bridge/analogix/Kconfig +++ b/drivers/gpu/drm/bridge/analogix/Kconfig @@ -2,3 +2,9 @@ config DRM_ANALOGIX_DP tristate depends on DRM + +config ANALOGIX_ANX7625 + tristate "Analogix MIPI to DP interface support" + help + ANX7625 is an ultra-low power 4K mobile HD transmitter designed + for portable devices. It converts MIPI/DPI to DisplayPort1.3 4K. diff --git a/drivers/gpu/drm/bridge/analogix/Makefile b/drivers/gpu/drm/bridge/analogix/Makefile index fdbf3fd..8a52867 100644 --- a/drivers/gpu/drm/bridge/analogix/Makefile +++ b/drivers/gpu/drm/bridge/analogix/Makefile @@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only +obj-$(CONFIG_ANALOGIX_ANX7625) += anx7625.o analogix_dp-objs := analogix_dp_core.o analogix_dp_reg.o obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix_dp.o diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c new file mode 100644 index 000..4328c4e --- /dev/null +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -0,0 +1,2155 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright(c) 2016, Analogix Semiconductor. All rights reserved. + * + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "anx7625.h" + +/* + * there is a sync issue while access I2C register between AP(CPU) and + * internal firmware(OCM), to avoid the race condition, AP should access + * the reserved slave address before slave address occurs changes. + */ +static int i2c_access_workaround(struct anx7625_data *ctx, +struct i2c_client *client) +{ + u8 offset; + struct device *dev = &client->dev; + int ret; + + if (client == ctx->last_client) + return 0; + + ctx->last_client = client; + + if (client == ctx->i2c.tcpc_client) + offset = RSVD_00_ADDR; + else if (client == ctx->i2c.tx_p0_client) + offset = RSVD_D1_ADDR; + else if (client == ctx->i2c.tx_p1_client) + offset = RSVD_60_ADDR; + else if (client == ctx->i2c.rx_p0_client) + offset = RSVD_39_ADDR; + else if (client == ctx->i2c.rx_p1_client) + offset = RSVD_7F_ADDR; + else + offset = RSVD_00_ADDR; + + ret = i2c_smbus_write_byte_data(client, offset, 0x00); + if (ret < 0) + DRM_DEV_ERROR(dev, + "failed to access i2c id=%x\n:%x", + client->addr, offset); + + return ret; +} + +static int anx7625_reg_read(struct anx7625_data *ctx, + struct i2c_client *client, u8 reg_addr) +{ + int ret; + struct device *dev = &client->dev; + + i2c_access_workaround(ctx, client); + + ret = i2c_smbus_read_byte_data(client, reg_addr); + if (ret < 0) + DRM_DEV_ERROR(dev, "read i2c failed id=%x:%x\n", + client->addr, reg_addr); + + return ret; +} + +static int anx7625_reg_block_read(struct anx7625_data *ctx, + struct i2c_client *client, + u8 reg_addr, u8 len, u8 *buf) +{ + int ret; + str
[PATCH v2 1/2] dt-bindings: drm/bridge: anx7625: MIPI to DP transmitter binding
The ANX7625 is an ultra-low power 4K Mobile HD Transmitter designed for portable device. It converts MIPI to DisplayPort 1.3 4K. You can add support to your board with binding. Example: anx7625_bridge: encoder@58 { compatible = "analogix,anx7625"; reg = <0x58>; status = "okay"; panel-flags = <1>; enable-gpios = <&pio 45 GPIO_ACTIVE_HIGH>; reset-gpios = <&pio 73 GPIO_ACTIVE_HIGH>; #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; anx_1_in: endpoint { remote-endpoint = <&mipi_dsi>; }; }; port@3 { reg = <3>; anx_1_out: endpoint { remote-endpoint = <&panel_in>; }; }; }; Signed-off-by: Xin Ji --- .../bindings/display/bridge/anx7625.yaml | 96 ++ 1 file changed, 96 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/anx7625.yaml diff --git a/Documentation/devicetree/bindings/display/bridge/anx7625.yaml b/Documentation/devicetree/bindings/display/bridge/anx7625.yaml new file mode 100644 index 000..fc84683 --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/anx7625.yaml @@ -0,0 +1,96 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2019 Analogix Semiconductor, Inc. +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/display/bridge/anx7625.yaml#"; +$schema: "http://devicetree.org/meta-schemas/core.yaml#"; + +title: Analogix ANX7625 SlimPort (4K Mobile HD Transmitter) + +maintainers: + - Xin Ji + +description: | + The ANX7625 is an ultra-low power 4K Mobile HD Transmitter + designed for portable devices. + +properties: + "#address-cells": true + "#size-cells": true + + compatible: +items: + - const: analogix,anx7625 + + reg: +maxItems: 1 + + panel-flags: +description: indicate the panel is internal or external +maxItems: 1 + + interrupts: +maxItems: 1 + + enable-gpios: +description: used for power on chip control, POWER_EN pin D2. +maxItems: 1 + + reset-gpios: +description: used for reset chip control, RESET_N pin B7. +maxItems: 1 + + port@0: +type: object +description: + A port node pointing to MIPI DSI host port node. + + port@1: +type: object +description: + A port node pointing to MIPI DPI host port node. + + port@2: +type: object +description: + A port node pointing to external connector port node. + + port@3: +type: object +description: + A port node pointing to eDP port node. + +required: + - "#address-cells" + - "#size-cells" + - compatible + - reg + - port@0 + - port@3 + +example: + - | +anx7625_bridge: encoder@58 { +compatible = "analogix,anx7625"; +reg = <0x58>; +status = "okay"; +panel-flags = <1>; +enable-gpios = <&pio 45 GPIO_ACTIVE_HIGH>; +reset-gpios = <&pio 73 GPIO_ACTIVE_HIGH>; +#address-cells = <1>; +#size-cells = <0>; + +port@0 { + reg = <0>; + anx_1_in: endpoint { +remote-endpoint = <&mipi_dsi>; + }; +}; + +port@3 { + reg = <3>; + anx_1_out: endpoint { +remote-endpoint = <&panel_in>; + }; +}; +}; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: sm750fb: Potential uninitialized field in "pll"
On Wed, Oct 09, 2019 at 09:38:08PM -0700, Yizhuo wrote: > Inside function set_chip_clock(), struct pll is supposed to be > initialized in sm750_calc_pll_value(), if condition > "diff < mini_diff" in sm750_calc_pll_value() cannot be fulfilled, > then some field of pll will not be initialized but used in > function sm750_format_pll_reg(), which is potentially unsafe. > > Signed-off-by: Yizhuo The patch is correct, but it doesn't apply to linux-next any more. Can you re-write it on top of the most recent staging-next and resend? regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver
This code is *so* much nicer than before. I hope you feel good about the changes. It makes me happy to look at this code now. On Thu, Oct 10, 2019 at 09:34:19AM +, Xin Ji wrote: > +static int edid_read(struct anx7625_data *ctx, > + u8 offset, u8 *pblock_buf) > +{ > + int ret, cnt; > + struct device *dev = &ctx->client->dev; > + > + for (cnt = 0; cnt < EDID_TRY_CNT; cnt++) { > + sp_tx_aux_wr(ctx, offset); > + /* set I2C read com 0x01 mot = 0 and read 16 bytes */ > + ret = sp_tx_aux_rd(ctx, 0xf1); > + > + if (ret) { > + sp_tx_rst_aux(ctx); > + DRM_DEV_DEBUG_DRIVER(dev, "edid read failed, reset!\n"); > + cnt++; I don't think you should increment cnt. It's just a counter. > + } else { > + ret = anx7625_reg_block_read(ctx, ctx->i2c.rx_p0_client, > + AP_AUX_BUFF_START, > + MAX_DPCD_BUFFER_SIZE, > + pblock_buf); > + if (!ret) > + break; > + } > + } > + > + if (cnt == EDID_TRY_CNT) And it could mean that "cnt > EDID_TRY_CNT". > + return -EIO; > + > + return 0; > +} > + > +static int segments_edid_read(struct anx7625_data *ctx, > + u8 segment, u8 *buf, u8 offset) > +{ > + u8 cnt; > + int ret; > + struct device *dev = &ctx->client->dev; > + > + /* write address only */ > + ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, > + AP_AUX_ADDR_7_0, 0x30); > + ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, > + AP_AUX_COMMAND, 0x04); > + ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, > + AP_AUX_CTRL_STATUS, > + AP_AUX_CTRL_ADDRONLY | AP_AUX_CTRL_OP_EN); > + > + ret |= wait_aux_op_finish(ctx); > + /* write segment address */ > + ret |= sp_tx_aux_wr(ctx, segment); > + /* data read */ > + ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, > + AP_AUX_ADDR_7_0, 0x50); > + if (ret) { > + DRM_ERROR("IO error : aux initial failed.\n"); > + return ret; > + } > + > + for (cnt = 0; cnt < EDID_TRY_CNT; cnt++) { > + sp_tx_aux_wr(ctx, offset); > + /* set I2C read com 0x01 mot = 0 and read 16 bytes */ > + ret = sp_tx_aux_rd(ctx, 0xf1); > + > + if (ret) { > + ret = sp_tx_rst_aux(ctx); > + DRM_DEV_ERROR(dev, "segment read failed, reset!\n"); > + cnt++; Same. > + } else { > + ret = anx7625_reg_block_read(ctx, ctx->i2c.rx_p0_client, > + AP_AUX_BUFF_START, > + MAX_DPCD_BUFFER_SIZE, buf); > + if (!ret) > + break; > + } > + } > + > + if (cnt == EDID_TRY_CNT) > + return -EIO; > + > + return 0; > +} regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver
On Thu, Oct 10, 2019 at 12:53:15PM +0300, Dan Carpenter wrote: > This code is *so* much nicer than before. I hope you feel good about > the changes. It makes me happy to look at this code now. > > On Thu, Oct 10, 2019 at 09:34:19AM +, Xin Ji wrote: > > +static int edid_read(struct anx7625_data *ctx, > > +u8 offset, u8 *pblock_buf) > > +{ > > + int ret, cnt; > > + struct device *dev = &ctx->client->dev; > > + > > + for (cnt = 0; cnt < EDID_TRY_CNT; cnt++) { ^ > > + sp_tx_aux_wr(ctx, offset); > > + /* set I2C read com 0x01 mot = 0 and read 16 bytes */ > > + ret = sp_tx_aux_rd(ctx, 0xf1); > > + > > + if (ret) { > > + sp_tx_rst_aux(ctx); > > + DRM_DEV_DEBUG_DRIVER(dev, "edid read failed, reset!\n"); > > + cnt++; ^ I mean that it's incremented twice, yeah? regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH][next] staging: wfx: fix spelling mistake "non existant" -> "non-existent"
From: Colin Ian King There is a spelling mistake in a dev_warn message. Fix it. Signed-off-by: Colin Ian King --- drivers/staging/wfx/hif_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index 52db02d3aa41..36e171b27ae2 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -137,7 +137,7 @@ static int hif_receive_indication(struct wfx_dev *wdev, struct hif_msg *hif, voi struct hif_ind_rx *body = buf; if (!wvif) { - dev_warn(wdev->dev, "ignore rx data for non existant vif %d\n", hif->interface); + dev_warn(wdev->dev, "ignore rx data for non-existent vif %d\n", hif->interface); return 0; } skb_pull(skb, sizeof(struct hif_msg) + sizeof(struct hif_ind_rx)); -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 1/2] dmaengine: avalon: Intel Avalon-MM DMA Interface for PCIe
On Thu, Oct 10, 2019 at 10:51:45AM +0200, Alexander Gordeev wrote: > On Wed, Oct 09, 2019 at 09:53:23PM +0300, Dan Carpenter wrote: > > > > > + u32 *rd_flags = hw->dma_desc_table_rd.cpu_addr->flags; > > > > > + u32 *wr_flags = hw->dma_desc_table_wr.cpu_addr->flags; > > > > > + struct avalon_dma_desc *desc; > > > > > + struct virt_dma_desc *vdesc; > > > > > + bool rd_done; > > > > > + bool wr_done; > > > > > + > > > > > + spin_lock(lock); > > > > > + > > > > > + rd_done = (hw->h2d_last_id < 0); > > > > > + wr_done = (hw->d2h_last_id < 0); > > > > > + > > > > > + if (rd_done && wr_done) { > > > > > + spin_unlock(lock); > > > > > + return IRQ_NONE; > > > > > + } > > > > > + > > > > > + do { > > > > > + if (!rd_done && rd_flags[hw->h2d_last_id]) > > > > > + rd_done = true; > > > > > + > > > > > + if (!wr_done && wr_flags[hw->d2h_last_id]) > > > > > + wr_done = true; > > > > > + } while (!rd_done || !wr_done); > > > > > > > > This loop is very strange. It feels like the last_id indexes needs > > > > to atomic or protected from racing somehow so we don't do an out of > > > > bounds read. > > [...] > > > You're missing my point. When we set > > hw->d2h_last_id = 1; > [1] > > ... > > hw->d2h_last_id = 2; > [2] > > > There is a tiny moment where ->d2h_last_id is transitioning from 1 to 2 > > where its value is unknown. We're in a busy loop here so we have a > > decent chance of hitting that 1/1000,000th of a second. If we happen to > > hit it at exactly the right time then we're reading from a random > > address and it will cause an oops. > > > > We have to use atomic_t types or something to handle race conditions. > > Err.. I am still missing the point :( In your example I do see a chance > for a reader to read out 1 at point in time [2] - because of SMP race. > But what could it be other than 1 or 2? > The 1 to 2 transition was a poorly chosen example, but a -1 to 1 trasition is better. The cpu could write a byte at a time. So maybe it only wrote the two highest bytes so now it's 0x. It's not -1 and it's not 1 and it's not a valid index. > Anyways, all code paths dealing with h2d_last_id and d2h_last_id indexes > are protected with a spinlock. You have to protect both the writer and the reader. (That's why this bug is so easy to spot). https://lwn.net/Articles/793253/ regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 0/4] staging: rtl8723bs: Style clean-up in rtw_mlme.c
This patchset addresses multiple style and formatting issues reported by checkpatch.pl in drivers/staging/rtl8723bs/core/rtw_mlme.c PATCH v2 of the series corrects the "patchest" mispelling in the original cover letter and provides a clearer subject line. PATCH v3 of the series incorporates newer changes in rtw_mlme.c on staging-testing. Wambui Karuga (4): staging: rtl8723bs: Remove comparisons to NULL in conditionals staging: rtl8723bs: Remove unnecessary braces for single statements staging: rtl8723bs: Remove comparisons to booleans in conditionals. staging: rtl8723bs: Remove unnecessary blank lines drivers/staging/rtl8723bs/core/rtw_mlme.c | 161 +++--- 1 file changed, 50 insertions(+), 111 deletions(-) -- 2.23.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 3/4] staging: rtl8723bs: Remove comparisons to booleans in conditionals.
Remove comparisons to true and false in multiple if statements in drivers/staging/rtl8723bs/core/rtw_mlme.c Issues reported by checkpatch.pl as: CHECK: Using comparison to false is error prone CHECK: Using comparison to true is error prone Signed-off-by: Wambui Karuga --- drivers/staging/rtl8723bs/core/rtw_mlme.c | 29 +++ 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c index 52f490d5ebfb..7ec693a38396 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c @@ -187,7 +187,7 @@ void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwor if (!pnetwork) return; - if (pnetwork->fixed == true) + if (pnetwork->fixed) return; if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) || @@ -222,7 +222,7 @@ void _rtw_free_network_nolock(structmlme_priv *pmlmepriv, struct wlan_network * if (!pnetwork) return; - if (pnetwork->fixed == true) + if (pnetwork->fixed) return; /* spin_lock_irqsave(&free_queue->lock, irqL); */ @@ -480,7 +480,7 @@ struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue) pwlan = LIST_CONTAINOR(plist, struct wlan_network, list); - if (pwlan->fixed != true) { + if (!pwlan->fixed) { if (oldest == NULL || time_after(oldest->last_scanned, pwlan->last_scanned)) oldest = pwlan; } @@ -867,7 +867,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) rtw_set_signal_stat_timer(&adapter->recvpriv); - if (pmlmepriv->to_join == true) { + if (pmlmepriv->to_join) { if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) { if (check_fwstate(pmlmepriv, _FW_LINKED) == false) { set_fwstate(pmlmepriv, _FW_UNDER_LINKING); @@ -1368,7 +1368,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) { /* s1. find ptarget_wlan */ if (check_fwstate(pmlmepriv, _FW_LINKED)) { - if (the_same_macaddr == true) { + if (the_same_macaddr) { ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.MacAddress); } else { pcur_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.MacAddress); @@ -1843,7 +1843,7 @@ static void rtw_auto_scan_handler(struct adapter *padapter) goto exit; } - if (pmlmepriv->LinkDetectInfo.bBusyTraffic == true) { + if (pmlmepriv->LinkDetectInfo.bBusyTraffic) { DBG_871X(FUNC_ADPT_FMT" exit BusyTraffic\n", FUNC_ADPT_ARG(padapter)); goto exit; } @@ -1863,20 +1863,20 @@ void rtw_dynamic_check_timer_handler(struct adapter *adapter) if (!adapter) return; - if (adapter->hw_init_completed == false) + if (!adapter->hw_init_completed) return; - if ((adapter->bDriverStopped == true) || (adapter->bSurpriseRemoved == true)) + if (adapter->bDriverStopped || adapter->bSurpriseRemoved) return; - if (adapter->net_closed == true) + if (adapter->net_closed) return; if (is_primary_adapter(adapter)) DBG_871X("IsBtDisabled =%d, IsBtControlLps =%d\n", hal_btcoex_IsBtDisabled(adapter), hal_btcoex_IsBtControlLps(adapter)); - if ((adapter_to_pwrctl(adapter)->bFwCurrentInPSMode == true) - && (hal_btcoex_IsBtControlLps(adapter) == false) + if ((adapter_to_pwrctl(adapter)->bFwCurrentInPSMode) + && !(hal_btcoex_IsBtControlLps(adapter)) ) { u8 bEnterPS; @@ -2047,7 +2047,7 @@ static int rtw_check_join_candidate(struct mlme_priv *mlme /* check bssid, if needed */ - if (mlme->assoc_by_bssid == true) { + if (mlme->assoc_by_bssid) { if (memcmp(competitor->network.MacAddress, mlme->assoc_bssid, ETH_ALEN)) goto exit; } @@ -2805,7 +2805,6 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len, u8 channe struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); u8 cbw40_enable = 0; - if (!phtpriv->ht_option) return; @@ -2815,7 +2814,7 @@ void rtw_update_ht_cap(
[PATCH v3 1/4] staging: rtl8723bs: Remove comparisons to NULL in conditionals
Remove most comparisons to NULL in conditionals in drivers/staging/rtl8723bs/core/rtw_mlme.c Issues reported by checkpatch.pl as: CHECK: Comparison to NULL could be written Signed-off-by: Wambui Karuga --- drivers/staging/rtl8723bs/core/rtw_mlme.c | 50 +++ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c index a03cc005f053..b0018fe7bae3 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c @@ -40,7 +40,7 @@ int rtw_init_mlme_priv(struct adapter *padapter) pbuf = vzalloc(array_size(MAX_BSS_CNT, sizeof(struct wlan_network))); - if (pbuf == NULL) { + if (!pbuf) { res = _FAIL; goto exit; } @@ -185,7 +185,7 @@ void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwor /* _irqL irqL; */ struct __queue *free_queue = &(pmlmepriv->free_bss_pool); - if (pnetwork == NULL) + if (!pnetwork) return; if (pnetwork->fixed == true) @@ -220,7 +220,7 @@ void _rtw_free_network_nolock(structmlme_priv *pmlmepriv, struct wlan_network * struct __queue *free_queue = &(pmlmepriv->free_bss_pool); - if (pnetwork == NULL) + if (!pnetwork) return; if (pnetwork->fixed == true) @@ -633,7 +633,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t /* If there are no more slots, expire the oldest */ /* list_del_init(&oldest->list); */ pnetwork = oldest; - if (pnetwork == NULL) { + if (!pnetwork) { RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n\n\nsomething wrong here\n\n\n")); goto exit; } @@ -654,7 +654,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t pnetwork = rtw_alloc_network(pmlmepriv); /* will update scan_time */ - if (pnetwork == NULL) { + if (!pnetwork) { RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n\n\nsomething wrong here\n\n\n")); goto exit; } @@ -738,7 +738,7 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor privacy = pnetwork->network.Privacy; if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) { - if (rtw_get_wps_ie(pnetwork->network.IEs+_FIXED_IE_LENGTH_, pnetwork->network.IELength-_FIXED_IE_LENGTH_, NULL, &wps_ielen) != NULL) + if (rtw_get_wps_ie(pnetwork->network.IEs+_FIXED_IE_LENGTH_, pnetwork->network.IELength-_FIXED_IE_LENGTH_, NULL, &wps_ielen)) return true; else return false; @@ -1166,7 +1166,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; psta = rtw_get_stainfo(pstapriv, pnetwork->network.MacAddress); - if (psta == NULL) { + if (!psta) { psta = rtw_alloc_stainfo(pstapriv, pnetwork->network.MacAddress); } @@ -1413,7 +1413,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) /* s3. find ptarget_sta & update ptarget_sta after update cur_network only for station mode */ if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) { ptarget_sta = rtw_joinbss_update_stainfo(adapter, pnetwork); - if (ptarget_sta == NULL) { + if (!ptarget_sta) { RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Can't update stainfo when joinbss_event callback\n")); spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); goto ignore_joinbss_callback; @@ -1503,7 +1503,7 @@ void rtw_sta_media_status_rpt(struct adapter *adapter, struct sta_info *psta, u3 { u16 media_status_rpt; - if (psta == NULL) + if (!psta) return; media_status_rpt = (u16)((psta->mac_id<<8)|mstatus); /* MACID|OPMODE:1 connect */ @@ -1561,7 +1561,7 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf) /* for AD-HOC mode */ psta = rtw_get_stainfo(&adapter->stapriv, pstassoc->macaddr); - if (psta != NULL) { + if (psta) { /* the sta have been in sta_info_queue => do nothing */ RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Error: rtw_stassoc_event_callback: sta has been in sta_ha
[PATCH v3 2/4] staging: rtl8723bs: Remove unnecessary braces for single statements
Clean up multiple unnecessary braces around single statement blocks in drivers/staging/rtl8723bs/core/rtw_mlme.c Issues reported by checkpatch.pl as: WARNING: braces {} are not necessary for single statement blocks or WARNING: braces {} are not necessary for any arm of this statement Signed-off-by: Wambui Karuga --- drivers/staging/rtl8723bs/core/rtw_mlme.c | 37 --- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c index b0018fe7bae3..52f490d5ebfb 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c @@ -112,9 +112,8 @@ void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv) { if (pmlmepriv) { rtw_free_mlme_priv_ie_data(pmlmepriv); - if (pmlmepriv->free_bss_buf) { + if (pmlmepriv->free_bss_buf) vfree(pmlmepriv->free_bss_buf); - } } } @@ -753,11 +752,10 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) { p = rtw_get_ie(pnetwork->network.IEs + _BEACON_IE_OFFSET_, _RSN_IE_2_, &ie_len, (pnetwork->network.IELength - _BEACON_IE_OFFSET_)); - if (p && ie_len > 0) { + if (p && ie_len > 0) bselected = true; - } else { + else bselected = false; - } } } @@ -822,9 +820,8 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf) /* lock pmlmepriv->lock when you accessing network_q */ if ((check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) == false) { - if (pnetwork->Ssid.Ssid[0] == 0) { + if (pnetwork->Ssid.Ssid[0] == 0) pnetwork->Ssid.SsidLength = 0; - } rtw_add_network(adapter, pnetwork); } @@ -893,9 +890,8 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) pmlmepriv->fw_state = WIFI_ADHOC_MASTER_STATE; - if (rtw_createbss_cmd(adapter) != _SUCCESS) { - RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Error =>rtw_createbss_cmd status FAIL\n")); - } + if (rtw_createbss_cmd(adapter) != _SUCCESS) + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Error =>rtw_createbss_cmd status FAIL\n")); pmlmepriv->to_join = false; } @@ -1166,9 +1162,8 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; psta = rtw_get_stainfo(pstapriv, pnetwork->network.MacAddress); - if (!psta) { + if (!psta) psta = rtw_alloc_stainfo(pstapriv, pnetwork->network.MacAddress); - } if (psta) { /* update ptarget_sta */ @@ -1347,11 +1342,10 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) rtw_get_encrypt_decrypt_from_registrypriv(adapter); - if (pmlmepriv->assoc_ssid.SsidLength == 0) { + if (pmlmepriv->assoc_ssid.SsidLength == 0) RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("@ joinbss event call back for Any SSid\n")); - } else { + else RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("@ rtw_joinbss_event_callback for SSid:%s\n", pmlmepriv->assoc_ssid.Ssid)); - } the_same_macaddr = !memcmp(pnetwork->network.MacAddress, cur_network->network.MacAddress, ETH_ALEN); @@ -1723,13 +1717,8 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) _clr_fwstate_(pmlmepriv, WIFI_ADHOC_STATE); } - if (rtw_createbss_cmd(adapter) != _SUCCESS) { - + if (rtw_createbss_cmd(adapter) != _SUCCESS) RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("***Error =>stadel_event_callback: rtw_createbss_cmd status FAIL***\n ")); - - } - - } } @@ -1902,9 +1891,8 @@ void rtw_dynamic_check_timer_handler(struct adapter *adapter) } } else { - if (is_primary_adapter(adapter)) { + if (is_primary_adapter(adapter)) rtw_dynamic_chk_wk_cmd(adapter); - } } /* auto site survey */ @@ -2988,9 +2976,8 @@ void rtw_append_exented_cap(struct adapter *padapter, u8 *out_i
[PATCH v3 4/4] staging: rtl8723bs: Remove unnecessary blank lines
Remove multiple blank lines in drivers/staging/rtl8723bs/core/rtw_mlme.c. Issues reported by checkpatch.pl as: CHECK: Please don't use multiple blank lines Signed-off-by: Wambui Karuga --- drivers/staging/rtl8723bs/core/rtw_mlme.c | 47 --- 1 file changed, 47 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c index 7ec693a38396..3030ae5b6b6d 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c @@ -208,7 +208,6 @@ void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwor pmlmepriv->num_of_scanned--; - /* DBG_871X("_rtw_free_network:SSID =%s\n", pnetwork->network.Ssid.Ssid); */ spin_unlock_bh(&free_queue->lock); @@ -300,12 +299,8 @@ void rtw_free_network_queue(struct adapter *padapter, u8 isfreeall) spin_unlock_bh(&scanned_queue->lock); } - - - sint rtw_if_up(struct adapter *padapter) { - sint res; if (padapter->bDriverStopped || padapter->bSurpriseRemoved || @@ -317,7 +312,6 @@ sint rtw_if_up(struct adapter *padapter) return res; } - void rtw_generate_random_ibss(u8 *pibss) { unsigned long curtime = jiffies; @@ -335,7 +329,6 @@ u8 *rtw_get_capability_from_ie(u8 *ie) return ie + 8 + 2; } - u16 rtw_get_capability(struct wlan_bssid_ex *bss) { __le16 val; @@ -423,7 +416,6 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst, u8 fea memcpy((u8 *)&tmps, rtw_get_capability_from_ie(src->IEs), 2); memcpy((u8 *)&tmpd, rtw_get_capability_from_ie(dst->IEs), 2); - s_cap = le16_to_cpu(tmps); d_cap = le16_to_cpu(tmpd); @@ -465,7 +457,6 @@ struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue) { struct list_head*plist, *phead; - struct wlan_network*pwlan = NULL; struct wlan_network*oldest = NULL; @@ -577,12 +568,8 @@ static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex } } - /* - Caller must hold pmlmepriv->lock first. - - */ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *target) { @@ -623,7 +610,6 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t } - /* If we didn't find a match, then get a new network slot to initialize * with this beacon's information */ /* if (phead == plist) { */ @@ -759,7 +745,6 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor } } - if ((desired_encmode != Ndis802_11EncryptionDisabled) && (privacy == 0)) { DBG_871X("desired_encmode: %d, privacy: %d\n", desired_encmode, privacy); bselected = false; @@ -770,7 +755,6 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor bselected = false; } - return bselected; } @@ -780,7 +764,6 @@ void rtw_atimdone_event_callback(struct adapter *adapter, u8 *pbuf) RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("receive atimdone_event\n")); } - void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf) { u32 len; @@ -797,7 +780,6 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf) return; } - spin_lock_bh(&pmlmepriv->lock); /* update IBSS_network 's timestamp */ @@ -830,8 +812,6 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf) spin_unlock_bh(&pmlmepriv->lock); } - - void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) { u8 timer_cancelled = false; @@ -862,7 +842,6 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) if (timer_cancelled) _cancel_timer(&pmlmepriv->scan_to_timer, &timer_cancelled); - spin_lock_bh(&pmlmepriv->lock); rtw_set_signal_stat_timer(&adapter->recvpriv); @@ -1002,7 +981,6 @@ static void find_network(struct adapter *adapter) else RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("rtw_free_assoc_resources : pwlan == NULL\n\n")); - if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) && (adapter->stapriv.asoc_sta_count == 1)) rtw_free_network_nolock(adapter, pwlan); @@ -1181,7 +1159,6 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str psta->wireless_mode = pmlmeext->cur_wireless_mode; psta->raid = networktype_to_raid_ex(padapter, psta); - /* sta mode */ rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, true); @@ -1213,7 +1190,6 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
[PATCH] rtl8723bs: Remove comparison to NULL
Remove comparison to NULL in drivers/staging/rtl8723bs/core/rtw_ap.c:1449. Issue found by checkpatch.pl Signed-off-by: Wambui Karuga --- drivers/staging/rtl8723bs/core/rtw_ap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c index 80027ac765d0..7117d16a30f9 100644 --- a/drivers/staging/rtl8723bs/core/rtw_ap.c +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c @@ -1447,7 +1447,7 @@ u8 rtw_ap_set_pairwise_key(struct adapter *padapter, struct sta_info *psta) u8 res = _SUCCESS; ph2c = rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c == NULL) { + if (!ph2c) { res = _FAIL; goto exit; } -- 2.23.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH -next] staging: rtl8723bs: Remove unnecessary null check
Null check before kfree is redundant, so remove it. This is detected by coccinelle. Signed-off-by: YueHaibing --- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c index 5044f73..74b097a 100644 --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c @@ -1141,8 +1141,7 @@ void rtw_ndev_destructor(struct net_device *ndev) { DBG_871X(FUNC_NDEV_FMT "\n", FUNC_NDEV_ARG(ndev)); - if (ndev->ieee80211_ptr) - kfree(ndev->ieee80211_ptr); + kfree(ndev->ieee80211_ptr); } void rtw_dev_unload(struct adapter *padapter) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] PCI: PM: Move to D0 before calling pci_legacy_resume_early()
On 10/8/2019 9:56 PM, Bjorn Helgaas wrote: On Tue, Oct 08, 2019 at 07:32:27PM +0200, Rafael J. Wysocki wrote: On 10/7/2019 8:57 PM, Dexuan Cui wrote: -Original Message- From: Bjorn Helgaas Sent: Monday, October 7, 2019 6:24 AM To: Dexuan Cui Cc: lorenzo.pieral...@arm.com; linux-...@vger.kernel.org; Michael Kelley ; linux-hyp...@vger.kernel.org; linux-ker...@vger.kernel.org; driverdev-devel@linuxdriverproject.org; Sasha Levin ; Haiyang Zhang ; KY Srinivasan ; o...@aepfle.de; a...@canonical.com; jasow...@redhat.com; vkuznets ; marcelo.ce...@canonical.com; Stephen Hemminger ; ja...@mellanox.com Subject: Re: [PATCH v2] PCI: PM: Move to D0 before calling pci_legacy_resume_early() On Wed, Aug 14, 2019 at 01:06:55AM +, Dexuan Cui wrote: In pci_legacy_suspend_late(), the device state is moved to PCI_UNKNOWN. In pci_pm_thaw_noirq(), the state is supposed to be moved back to PCI_D0, but the current code misses the pci_legacy_resume_early() path, so the state remains in PCI_UNKNOWN in that path. As a result, in the resume phase of hibernation, this causes an error for the Mellanox VF driver, which fails to enable MSI-X because pci_msi_supported() is false due to dev->current_state != PCI_D0: mlx4_core a6d1:00:02.0: Detected virtual function - running in slave mode mlx4_core a6d1:00:02.0: Sending reset mlx4_core a6d1:00:02.0: Sending vhcr0 mlx4_core a6d1:00:02.0: HCA minimum page size:512 mlx4_core a6d1:00:02.0: Timestamping is not supported in slave mode mlx4_core a6d1:00:02.0: INTx is not supported in multi-function mode, aborting PM: dpm_run_callback(): pci_pm_thaw+0x0/0xd7 returns -95 PM: Device a6d1:00:02.0 failed to thaw: error -95 To be more accurate, the "resume" phase means the "thaw" callbacks which run before the system enters hibernation: when the user runs the command "echo disk > /sys/power/state" for hibernation, first the kernel "freezes" all the devices and creates a hibernation image, then the kernel "thaws" the devices including the disk/NIC, writes the memory to the disk, and powers down. This patch fixes the error message for the Mellanox VF driver in this phase. Wordsmithing nit: what the patch does is not "fix the error message"; what it does is fix the *problem*, i.e., the fact that we can't operate the device because we can't enable MSI-X. The message is only a symptom. IIUC the relevant part of the system hibernation sequence is: pci_pm_freeze_noirq pci_pm_thaw_noirq pci_pm_thaw And the execution flow is: pci_pm_freeze_noirq if (pci_has_legacy_pm_support(pci_dev)) # true for mlx4 pci_legacy_suspend_late(dev, PMSG_FREEZE) pci_pm_set_unknown_state dev->current_state = PCI_UNKNOWN # <--- pci_pm_thaw_noirq if (pci_has_legacy_pm_support(pci_dev)) # true pci_legacy_resume_early(dev) # noop; mlx4 doesn't implement pci_pm_thaw # returns -95 EOPNOTSUPP if (pci_has_legacy_pm_support(pci_dev)) # true pci_legacy_resume drv->resume mlx4_resume # mlx4_driver.resume (legacy) mlx4_load_one mlx4_enable_msi_x pci_enable_msix_range __pci_enable_msix_range __pci_enable_msix if (!pci_msi_supported()) if (dev->current_state != PCI_D0) # <--- return 0 return -EINVAL err = -EOPNOTSUPP "INTx is not supported ..." (These are just my notes; you don't need to put them all into the commit message. I'm just sharing them in case I'm not understanding correctly.) When the system starts again, a fresh kernel starts to run, and when the kernel detects that a hibernation image was saved, the kernel "quiesces" the devices, and then "restores" the devices from the saved image. In this path: device_resume_noirq() -> ... -> pci_pm_restore_noirq() -> pci_pm_default_resume_early() -> pci_power_up() moves the device states back to PCI_D0. This path is not broken and doesn't need my patch. The cc list suggests that this might be a fix for a user-reported problem. Is there a launchpad or similar link you could include here? Should this be marked for stable? Signed-off-by: Dexuan Cui This looks like a bugfix for 5839ee7389e8 ("PCI / PM: Force devices to D0 in pci_pm_thaw_noirq()") so maybe it should be marked for stable as 5839ee7389e8 was? Rafael, could you confirm? No, it is not a bug fix for that commit. The underlying issue would be there without that commit too. Oh, right, I dunno what I was thinking, sorry. --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -1074,15 +1074,16 @@ static int pci_pm_thaw_noirq(struct device *dev) return error; } - if (pci_has_legacy_pm_support(pci_dev)) - return pci_legacy_resume_early(dev); - /*
RE: [PATCH] KPC2000: kpc2000_spi.c: Fix style issues (line length)
>-Original Message- >From: devel On Behalf Of >Chandra Annamaneni >Sent: Wednesday, October 09, 2019 10:09 PM >To: gre...@linuxfoundation.org >Cc: de...@driverdev.osuosl.org; gneuk...@gmail.com; chandra...@gmail.com; >fabian.krue...@fau.de; linux- >ker...@vger.kernel.org; si...@nikanor.nu; dan.carpen...@oracle.com >Subject: [PATCH] KPC2000: kpc2000_spi.c: Fix style issues (line length) > >Resoved: "WARNING: line over 80 characters" from checkpatch.pl > >Signed-off-by: Chandra Annamaneni >--- > drivers/staging/kpc2000/kpc2000_spi.c | 20 ++-- > 1 file changed, 10 insertions(+), 10 deletions(-) > >diff --git a/drivers/staging/kpc2000/kpc2000_spi.c >b/drivers/staging/kpc2000/kpc2000_spi.c >index 3be33c4..ef78b6d 100644 >--- a/drivers/staging/kpc2000/kpc2000_spi.c >+++ b/drivers/staging/kpc2000/kpc2000_spi.c >@@ -30,19 +30,19 @@ > #include "kpc.h" > > static struct mtd_partition p2kr0_spi0_parts[] = { >- { .name = "SLOT_0", .size = 7798784,.offset = 0, > }, >- { .name = "SLOT_1", .size = 7798784,.offset = >MTDPART_OFS_NXTBLK}, >- { .name = "SLOT_2", .size = 7798784,.offset = >MTDPART_OFS_NXTBLK}, >- { .name = "SLOT_3", .size = 7798784,.offset = >MTDPART_OFS_NXTBLK}, >- { .name = "CS0_EXTRA", .size = MTDPART_SIZ_FULL, .offset = >MTDPART_OFS_NXTBLK}, >+ { .name = "SLOT_0", .size = 7798784, .offset = 0,}, >+ { .name = "SLOT_1", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, >+ { .name = "SLOT_2", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, >+ { .name = "SLOT_3", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, >+ { .name = "CS0_EXTRA", .size = MTDPART_SIZ_FULL, .offset = >MTDPART_OFS_NXTBLK}, > }; > > static struct mtd_partition p2kr0_spi1_parts[] = { >- { .name = "SLOT_4", .size = 7798784,.offset = 0, > }, >- { .name = "SLOT_5", .size = 7798784,.offset = >MTDPART_OFS_NXTBLK}, >- { .name = "SLOT_6", .size = 7798784,.offset = >MTDPART_OFS_NXTBLK}, >- { .name = "SLOT_7", .size = 7798784,.offset = >MTDPART_OFS_NXTBLK}, >- { .name = "CS1_EXTRA", .size = MTDPART_SIZ_FULL, .offset = >MTDPART_OFS_NXTBLK}, >+ { .name = "SLOT_4", .size = 7798784, .offset = 0,}, >+ { .name = "SLOT_5", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, >+ { .name = "SLOT_6", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, >+ { .name = "SLOT_7", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, >+ { .name = "CS1_EXTRA", .size = MTDPART_SIZ_FULL, .offset = >MTDPART_OFS_NXTBLK}, > }; > > static struct flash_platform_data p2kr0_spi0_pdata = { Is the line length limit a hard rule or can exceptions be made? I really feel that these data tables are more easily read when they're formatted like tables... ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: sm750fb: Potential uninitialized field in "pll"
Sorry about that, let me resend it . On Thu, Oct 10, 2019 at 2:53 AM Dan Carpenter wrote: > > On Wed, Oct 09, 2019 at 09:38:08PM -0700, Yizhuo wrote: > > Inside function set_chip_clock(), struct pll is supposed to be > > initialized in sm750_calc_pll_value(), if condition > > "diff < mini_diff" in sm750_calc_pll_value() cannot be fulfilled, > > then some field of pll will not be initialized but used in > > function sm750_format_pll_reg(), which is potentially unsafe. > > > > Signed-off-by: Yizhuo > > The patch is correct, but it doesn't apply to linux-next any more. Can > you re-write it on top of the most recent staging-next and resend? > > regards, > dan carpenter > -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student University of California, Riverside ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver
Hi Dan Carpenter, This is a bug, I'll fix it right now. The coding is much nicer than before, thanks for your comments, it is very helpful for me. Thanks, Xin On Thu, Oct 10, 2019 at 12:56:17PM +0300, Dan Carpenter wrote: > On Thu, Oct 10, 2019 at 12:53:15PM +0300, Dan Carpenter wrote: > > This code is *so* much nicer than before. I hope you feel good about > > the changes. It makes me happy to look at this code now. > > > > On Thu, Oct 10, 2019 at 09:34:19AM +, Xin Ji wrote: > > > +static int edid_read(struct anx7625_data *ctx, > > > + u8 offset, u8 *pblock_buf) > > > +{ > > > + int ret, cnt; > > > + struct device *dev = &ctx->client->dev; > > > + > > > + for (cnt = 0; cnt < EDID_TRY_CNT; cnt++) { > ^ > > > > + sp_tx_aux_wr(ctx, offset); > > > + /* set I2C read com 0x01 mot = 0 and read 16 bytes */ > > > + ret = sp_tx_aux_rd(ctx, 0xf1); > > > + > > > + if (ret) { > > > + sp_tx_rst_aux(ctx); > > > + DRM_DEV_DEBUG_DRIVER(dev, "edid read failed, reset!\n"); > > > + cnt++; > ^ > > I mean that it's incremented twice, yeah? > > regards, > dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 0/2] Add initial support for slimport anx7625
Hi all, The following series add initial support for the Slimport ANX7625 transmitter, a ultra-low power Full-HD 4K MIPI to DP transmitter designed for portable device. This is the initial version, any mistakes, please let me know, I will fix it in the next series. Thanks, Xin Xin Ji (2): dt-bindings: drm/bridge: anx7625: MIPI to DP transmitter binding drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver .../bindings/display/bridge/anx7625.yaml | 96 + drivers/gpu/drm/bridge/Makefile|2 +- drivers/gpu/drm/bridge/analogix/Kconfig|6 + drivers/gpu/drm/bridge/analogix/Makefile |1 + drivers/gpu/drm/bridge/analogix/anx7625.c | 2153 drivers/gpu/drm/bridge/analogix/anx7625.h | 406 6 files changed, 2663 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/display/bridge/anx7625.yaml create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.c create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.h -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver
The ANX7625 is an ultra-low power 4K Mobile HD Transmitter designed for portable device. It converts MIPI DSI/DPI to DisplayPort 1.3 4K. The ANX7625 can support both USB Type-C PD feature and MIPI DSI/DPI to DP feature. This driver only enabled MIPI DSI/DPI to DP feature. Signed-off-by: Xin Ji --- drivers/gpu/drm/bridge/Makefile |2 +- drivers/gpu/drm/bridge/analogix/Kconfig |6 + drivers/gpu/drm/bridge/analogix/Makefile |1 + drivers/gpu/drm/bridge/analogix/anx7625.c | 2153 + drivers/gpu/drm/bridge/analogix/anx7625.h | 406 ++ 5 files changed, 2567 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.c create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.h diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index 4934fcf..bcd388a 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -12,8 +12,8 @@ obj-$(CONFIG_DRM_SII9234) += sii9234.o obj-$(CONFIG_DRM_THINE_THC63LVD1024) += thc63lvd1024.o obj-$(CONFIG_DRM_TOSHIBA_TC358764) += tc358764.o obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o -obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/ obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/ obj-$(CONFIG_DRM_TI_SN65DSI86) += ti-sn65dsi86.o obj-$(CONFIG_DRM_TI_TFP410) += ti-tfp410.o +obj-y += analogix/ obj-y += synopsys/ diff --git a/drivers/gpu/drm/bridge/analogix/Kconfig b/drivers/gpu/drm/bridge/analogix/Kconfig index e930ff9..b2f127e 100644 --- a/drivers/gpu/drm/bridge/analogix/Kconfig +++ b/drivers/gpu/drm/bridge/analogix/Kconfig @@ -2,3 +2,9 @@ config DRM_ANALOGIX_DP tristate depends on DRM + +config ANALOGIX_ANX7625 + tristate "Analogix MIPI to DP interface support" + help + ANX7625 is an ultra-low power 4K mobile HD transmitter designed + for portable devices. It converts MIPI/DPI to DisplayPort1.3 4K. diff --git a/drivers/gpu/drm/bridge/analogix/Makefile b/drivers/gpu/drm/bridge/analogix/Makefile index fdbf3fd..8a52867 100644 --- a/drivers/gpu/drm/bridge/analogix/Makefile +++ b/drivers/gpu/drm/bridge/analogix/Makefile @@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only +obj-$(CONFIG_ANALOGIX_ANX7625) += anx7625.o analogix_dp-objs := analogix_dp_core.o analogix_dp_reg.o obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix_dp.o diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c new file mode 100644 index 000..96adf3b --- /dev/null +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -0,0 +1,2153 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright(c) 2016, Analogix Semiconductor. All rights reserved. + * + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "anx7625.h" + +/* + * there is a sync issue while access I2C register between AP(CPU) and + * internal firmware(OCM), to avoid the race condition, AP should access + * the reserved slave address before slave address occurs changes. + */ +static int i2c_access_workaround(struct anx7625_data *ctx, +struct i2c_client *client) +{ + u8 offset; + struct device *dev = &client->dev; + int ret; + + if (client == ctx->last_client) + return 0; + + ctx->last_client = client; + + if (client == ctx->i2c.tcpc_client) + offset = RSVD_00_ADDR; + else if (client == ctx->i2c.tx_p0_client) + offset = RSVD_D1_ADDR; + else if (client == ctx->i2c.tx_p1_client) + offset = RSVD_60_ADDR; + else if (client == ctx->i2c.rx_p0_client) + offset = RSVD_39_ADDR; + else if (client == ctx->i2c.rx_p1_client) + offset = RSVD_7F_ADDR; + else + offset = RSVD_00_ADDR; + + ret = i2c_smbus_write_byte_data(client, offset, 0x00); + if (ret < 0) + DRM_DEV_ERROR(dev, + "failed to access i2c id=%x\n:%x", + client->addr, offset); + + return ret; +} + +static int anx7625_reg_read(struct anx7625_data *ctx, + struct i2c_client *client, u8 reg_addr) +{ + int ret; + struct device *dev = &client->dev; + + i2c_access_workaround(ctx, client); + + ret = i2c_smbus_read_byte_data(client, reg_addr); + if (ret < 0) + DRM_DEV_ERROR(dev, "read i2c failed id=%x:%x\n", + client->addr, reg_addr); + + return ret; +} + +static int anx7625_reg_block_read(struct anx7625_data *ctx, + struct i2c_client *client, + u8 reg_addr, u8 len, u8 *buf) +{ + int ret; + str
[PATCH v2 1/2] dt-bindings: drm/bridge: anx7625: MIPI to DP transmitter binding
The ANX7625 is an ultra-low power 4K Mobile HD Transmitter designed for portable device. It converts MIPI to DisplayPort 1.3 4K. You can add support to your board with binding. Example: anx7625_bridge: encoder@58 { compatible = "analogix,anx7625"; reg = <0x58>; status = "okay"; panel-flags = <1>; enable-gpios = <&pio 45 GPIO_ACTIVE_HIGH>; reset-gpios = <&pio 73 GPIO_ACTIVE_HIGH>; #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; anx_1_in: endpoint { remote-endpoint = <&mipi_dsi>; }; }; port@3 { reg = <3>; anx_1_out: endpoint { remote-endpoint = <&panel_in>; }; }; }; Signed-off-by: Xin Ji --- .../bindings/display/bridge/anx7625.yaml | 96 ++ 1 file changed, 96 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/anx7625.yaml diff --git a/Documentation/devicetree/bindings/display/bridge/anx7625.yaml b/Documentation/devicetree/bindings/display/bridge/anx7625.yaml new file mode 100644 index 000..fc84683 --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/anx7625.yaml @@ -0,0 +1,96 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2019 Analogix Semiconductor, Inc. +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/display/bridge/anx7625.yaml#"; +$schema: "http://devicetree.org/meta-schemas/core.yaml#"; + +title: Analogix ANX7625 SlimPort (4K Mobile HD Transmitter) + +maintainers: + - Xin Ji + +description: | + The ANX7625 is an ultra-low power 4K Mobile HD Transmitter + designed for portable devices. + +properties: + "#address-cells": true + "#size-cells": true + + compatible: +items: + - const: analogix,anx7625 + + reg: +maxItems: 1 + + panel-flags: +description: indicate the panel is internal or external +maxItems: 1 + + interrupts: +maxItems: 1 + + enable-gpios: +description: used for power on chip control, POWER_EN pin D2. +maxItems: 1 + + reset-gpios: +description: used for reset chip control, RESET_N pin B7. +maxItems: 1 + + port@0: +type: object +description: + A port node pointing to MIPI DSI host port node. + + port@1: +type: object +description: + A port node pointing to MIPI DPI host port node. + + port@2: +type: object +description: + A port node pointing to external connector port node. + + port@3: +type: object +description: + A port node pointing to eDP port node. + +required: + - "#address-cells" + - "#size-cells" + - compatible + - reg + - port@0 + - port@3 + +example: + - | +anx7625_bridge: encoder@58 { +compatible = "analogix,anx7625"; +reg = <0x58>; +status = "okay"; +panel-flags = <1>; +enable-gpios = <&pio 45 GPIO_ACTIVE_HIGH>; +reset-gpios = <&pio 73 GPIO_ACTIVE_HIGH>; +#address-cells = <1>; +#size-cells = <0>; + +port@0 { + reg = <0>; + anx_1_in: endpoint { +remote-endpoint = <&mipi_dsi>; + }; +}; + +port@3 { + reg = <3>; + anx_1_out: endpoint { +remote-endpoint = <&panel_in>; + }; +}; +}; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/5] KPC2000: kpc2000_spi.c: Fix style issues (missing blank line)
Resolved: "CHECK: Please use a blank line after.." from checkpatch.pl Signed-off-by: Chandra Annamaneni --- drivers/staging/kpc2000/kpc2000_spi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c index 81d79b116ce0..d1f7360cd179 100644 --- a/drivers/staging/kpc2000/kpc2000_spi.c +++ b/drivers/staging/kpc2000/kpc2000_spi.c @@ -50,6 +50,7 @@ static struct flash_platform_data p2kr0_spi0_pdata = { .nr_parts = ARRAY_SIZE(p2kr0_spi0_parts), .parts =p2kr0_spi0_parts, }; + static struct flash_platform_data p2kr0_spi1_pdata = { .name = "SPI1", .nr_parts = ARRAY_SIZE(p2kr0_spi1_parts), -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/5] KPC2000: kpc2000_spi.c: Fix style issues (Unnecessary parenthesis)
Resolved: CHECK: Unnecessary parentheses around table[i] Signed-off-by: Chandra Annamaneni --- drivers/staging/kpc2000/kpc2000_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c index 26e1e8466fb2..8cd6936eda17 100644 --- a/drivers/staging/kpc2000/kpc2000_spi.c +++ b/drivers/staging/kpc2000/kpc2000_spi.c @@ -478,7 +478,7 @@ kp_spi_probe(struct platform_device *pldev) /* register the slave boards */ #define NEW_SPI_DEVICE_FROM_BOARD_INFO_TABLE(table) \ for (i = 0 ; i < ARRAY_SIZE(table) ; i++) { \ - spi_new_device(master, &(table[i])); \ + spi_new_device(master, &table[i]); \ } switch ((drvdata->card_id & 0x) >> 16) { -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/5] KPC2000: kpc2000_spi.c: Fix style issues (alignment)
Resolved: "CHECK: Alignment should match open parenthesis" from checkpatch Signed-off-by: Chandra Annamaneni --- drivers/staging/kpc2000/kpc2000_spi.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c index 66cfa5202690..26e1e8466fb2 100644 --- a/drivers/staging/kpc2000/kpc2000_spi.c +++ b/drivers/staging/kpc2000/kpc2000_spi.c @@ -315,19 +315,19 @@ kp_spi_transfer_one_message(struct spi_master *master, struct spi_message *m) if (transfer->speed_hz > KP_SPI_CLK || (len && !(rx_buf || tx_buf))) { dev_dbg(kpspi->dev, " transfer: %d Hz, %d %s%s, %d bpw\n", - transfer->speed_hz, - len, - tx_buf ? "tx" : "", - rx_buf ? "rx" : "", - transfer->bits_per_word); + transfer->speed_hz, + len, + tx_buf ? "tx" : "", + rx_buf ? "rx" : "", + transfer->bits_per_word); dev_dbg(kpspi->dev, " transfer -EINVAL\n"); return -EINVAL; } if (transfer->speed_hz && transfer->speed_hz < (KP_SPI_CLK >> 15)) { dev_dbg(kpspi->dev, "speed_hz %d below minimum %d Hz\n", - transfer->speed_hz, - KP_SPI_CLK >> 15); + transfer->speed_hz, + KP_SPI_CLK >> 15); dev_dbg(kpspi->dev, " speed_hz -EINVAL\n"); return -EINVAL; } -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/5] KPC2000: kpc2000_spi.c: Fix style issues (misaligned brace)
Resolved: ERROR: else should follow close brace '}' Signed-off-by: Chandra Annamaneni --- drivers/staging/kpc2000/kpc2000_spi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c index d1f7360cd179..66cfa5202690 100644 --- a/drivers/staging/kpc2000/kpc2000_spi.c +++ b/drivers/staging/kpc2000/kpc2000_spi.c @@ -228,8 +228,7 @@ kp_spi_txrx_pio(struct spi_device *spidev, struct spi_transfer *transfer) kp_spi_write_reg(cs, KP_SPI_REG_TXDATA, val); processed++; } - } - else if (rx) { + } else if (rx) { for (i = 0 ; i < c ; i++) { char test = 0; -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/5] KPC2000: kpc2000_spi.c: Fix style issues (line length)
Resoved: "WARNING: line over 80 characters" from checkpatch.pl Signed-off-by: Chandra Annamaneni --- drivers/staging/kpc2000/kpc2000_spi.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c index 3be33c450cab..81d79b116ce0 100644 --- a/drivers/staging/kpc2000/kpc2000_spi.c +++ b/drivers/staging/kpc2000/kpc2000_spi.c @@ -30,19 +30,19 @@ #include "kpc.h" static struct mtd_partition p2kr0_spi0_parts[] = { - { .name = "SLOT_0", .size = 7798784,.offset = 0, }, - { .name = "SLOT_1", .size = 7798784,.offset = MTDPART_OFS_NXTBLK}, - { .name = "SLOT_2", .size = 7798784,.offset = MTDPART_OFS_NXTBLK}, - { .name = "SLOT_3", .size = 7798784,.offset = MTDPART_OFS_NXTBLK}, - { .name = "CS0_EXTRA", .size = MTDPART_SIZ_FULL, .offset = MTDPART_OFS_NXTBLK}, + { .name = "SLOT_0", .size = 7798784, .offset = 0,}, + { .name = "SLOT_1", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, + { .name = "SLOT_2", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, + { .name = "SLOT_3", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, + { .name = "CS0_EXTRA", .size = MTDPART_SIZ_FULL, .offset = MTDPART_OFS_NXTBLK}, }; static struct mtd_partition p2kr0_spi1_parts[] = { - { .name = "SLOT_4", .size = 7798784,.offset = 0, }, - { .name = "SLOT_5", .size = 7798784,.offset = MTDPART_OFS_NXTBLK}, - { .name = "SLOT_6", .size = 7798784,.offset = MTDPART_OFS_NXTBLK}, - { .name = "SLOT_7", .size = 7798784,.offset = MTDPART_OFS_NXTBLK}, - { .name = "CS1_EXTRA", .size = MTDPART_SIZ_FULL, .offset = MTDPART_OFS_NXTBLK}, + { .name = "SLOT_4", .size = 7798784, .offset = 0,}, + { .name = "SLOT_5", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, + { .name = "SLOT_6", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, + { .name = "SLOT_7", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, + { .name = "CS1_EXTRA", .size = MTDPART_SIZ_FULL, .offset = MTDPART_OFS_NXTBLK}, }; static struct flash_platform_data p2kr0_spi0_pdata = { -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/5] staging: octeon: remove typedef declaration for cvmx_wqe_t
Remove typedef declaration from struct cvmx_wqe_t in drivers/staging/octeon/octeon-stubs.h. Also replace its previous uses with new struct declaration. Issue found by checkpatch.pl Signed-off-by: Wambui Karuga --- drivers/staging/octeon/ethernet-rx.c | 6 +++--- drivers/staging/octeon/ethernet-tx.c | 2 +- drivers/staging/octeon/ethernet.c | 2 +- drivers/staging/octeon/octeon-stubs.h | 22 +++--- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c index 0e65955c746b..63e15a70f3e7 100644 --- a/drivers/staging/octeon/ethernet-rx.c +++ b/drivers/staging/octeon/ethernet-rx.c @@ -60,7 +60,7 @@ static irqreturn_t cvm_oct_do_interrupt(int irq, void *napi_id) * * Returns Non-zero if the packet can be dropped, zero otherwise. */ -static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work) +static inline int cvm_oct_check_rcv_error(struct cvmx_wqe_t *work) { int port; @@ -135,7 +135,7 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work) return 0; } -static void copy_segments_to_skb(cvmx_wqe_t *work, struct sk_buff *skb) +static void copy_segments_to_skb(struct cvmx_wqe_t *work, struct sk_buff *skb) { int segments = work->word2.s.bufs; union cvmx_buf_ptr segment_ptr = work->packet_ptr; @@ -215,7 +215,7 @@ static int cvm_oct_poll(struct oct_rx_group *rx_group, int budget) struct sk_buff *skb = NULL; struct sk_buff **pskb = NULL; int skb_in_hw; - cvmx_wqe_t *work; + struct cvmx_wqe_t *work; int port; if (USE_ASYNC_IOBDMA && did_work_request) diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c index c64728fc21f2..7ececfac0701 100644 --- a/drivers/staging/octeon/ethernet-tx.c +++ b/drivers/staging/octeon/ethernet-tx.c @@ -515,7 +515,7 @@ int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev) void *copy_location; /* Get a work queue entry */ - cvmx_wqe_t *work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL); + struct cvmx_wqe_t *work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL); if (unlikely(!work)) { printk_ratelimited("%s: Failed to allocate a work queue entry\n", diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c index cf8e9a23ebf9..3de209b7d0ec 100644 --- a/drivers/staging/octeon/ethernet.c +++ b/drivers/staging/octeon/ethernet.c @@ -172,7 +172,7 @@ static void cvm_oct_configure_common_hw(void) */ int cvm_oct_free_work(void *work_queue_entry) { - cvmx_wqe_t *work = work_queue_entry; + struct cvmx_wqe_t *work = work_queue_entry; int segments = work->word2.s.bufs; union cvmx_buf_ptr segment_ptr = work->packet_ptr; diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h index b2e3c72205dd..fd7522f70f7e 100644 --- a/drivers/staging/octeon/octeon-stubs.h +++ b/drivers/staging/octeon/octeon-stubs.h @@ -183,13 +183,13 @@ union cvmx_buf_ptr { } s; }; -typedef struct { +struct cvmx_wqe_t { union cvmx_wqe_word0 word0; union cvmx_wqe_word1 word1; union cvmx_pip_wqe_word2 word2; union cvmx_buf_ptr packet_ptr; uint8_t packet_data[96]; -} cvmx_wqe_t; +}; typedef union { uint64_t u64; @@ -1198,7 +1198,7 @@ static inline uint64_t cvmx_scratch_read64(uint64_t address) static inline void cvmx_scratch_write64(uint64_t address, uint64_t value) { } -static inline int cvmx_wqe_get_grp(cvmx_wqe_t *work) +static inline int cvmx_wqe_get_grp(struct cvmx_wqe_t *work) { return 0; } @@ -1345,14 +1345,14 @@ static inline void cvmx_pow_work_request_async(int scr_addr, cvmx_pow_wait_t wait) { } -static inline cvmx_wqe_t *cvmx_pow_work_response_async(int scr_addr) +static inline struct cvmx_wqe_t *cvmx_pow_work_response_async(int scr_addr) { - cvmx_wqe_t *wqe = (void *)(unsigned long)scr_addr; + struct cvmx_wqe_t *wqe = (void *)(unsigned long)scr_addr; return wqe; } -static inline cvmx_wqe_t *cvmx_pow_work_request_sync(cvmx_pow_wait_t wait) +static inline struct cvmx_wqe_t *cvmx_pow_work_request_sync(cvmx_pow_wait_t wait) { return (void *)(unsigned long)wait; } @@ -1390,21 +1390,21 @@ static inline cvmx_pko_status_t cvmx_pko_send_packet_finish(uint64_t port, return ret; } -static inline void cvmx_wqe_set_port(cvmx_wqe_t *work, int port) +static inline void cvmx_wqe_set_port(struct cvmx_wqe_t *work, int port) { } -static inline void cvmx_wqe_set_qos(cvmx_wqe_t *work, int qos) +static inline void cvmx_wqe_set_qos(struct cvmx_wqe_t *work, int qos) { } -static inline int cvmx_wqe_get_qos(cvmx_wqe_t *work) +static inline int cvmx_wqe_get_qos(struct cvmx_wqe_t *work) { return 0; } -static in
[PATCH 0/5] Remove declarations of new typedef in
This patchset removes various typedef declarations of new data types in drivers/staging/octeon/octeon-stubs.h. The series also changes their old uses with the new declaration format. Wambui Karuga (5): staging: octeon: remove typedef declaration for cvmx_wqe_t staging: octeon: remove typedef declaration for cvmx_helper_link_info_t staging: octeon: remove typedef declaration for cvmx_fau_reg_32_t staging: octeon: remove typedef declartion for cvmx_pko_command_word0_t staging: octeon: remove typedef declaration for cvmx_fau_op_size_t drivers/staging/octeon/ethernet-mdio.c | 6 +-- drivers/staging/octeon/ethernet-rgmii.c | 4 +- drivers/staging/octeon/ethernet-rx.c | 6 +-- drivers/staging/octeon/ethernet-tx.c | 4 +- drivers/staging/octeon/ethernet.c| 6 +-- drivers/staging/octeon/octeon-ethernet.h | 2 +- drivers/staging/octeon/octeon-stubs.h| 56 7 files changed, 43 insertions(+), 41 deletions(-) -- 2.23.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/5] staging: octeon: remove typedef declartion for cvmx_pko_command_word0_t
Removes addition of new typedef declaration for cvmx_pko_command_word0_t in drivers/staging/octeon/octeon-stubs.h. Also replace previous instances with new union declaration. Signed-off-by: Wambui Karuga --- drivers/staging/octeon/ethernet-tx.c | 2 +- drivers/staging/octeon/octeon-stubs.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c index 7ececfac0701..f88d8e6f5292 100644 --- a/drivers/staging/octeon/ethernet-tx.c +++ b/drivers/staging/octeon/ethernet-tx.c @@ -127,7 +127,7 @@ static void cvm_oct_free_tx_skbs(struct net_device *dev) */ int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev) { - cvmx_pko_command_word0_t pko_command; + union cvmx_pko_command_word0_t pko_command; union cvmx_buf_ptr hw_buffer; u64 old_scratch; u64 old_scratch2; diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h index 1725d54523de..06e6a0223416 100644 --- a/drivers/staging/octeon/octeon-stubs.h +++ b/drivers/staging/octeon/octeon-stubs.h @@ -1137,7 +1137,7 @@ union cvmx_npi_rsl_int_blocks { } cn50xx; }; -typedef union { +union cvmx_pko_command_word0_t { uint64_t u64; struct { uint64_t total_bytes:16; @@ -1157,7 +1157,7 @@ typedef union { uint64_t size0:2; uint64_t size1:2; } s; -} cvmx_pko_command_word0_t; +}; union cvmx_ciu_timx { uint64_t u64; @@ -1384,7 +1384,7 @@ static inline void cvmx_pko_send_packet_prepare(uint64_t port, uint64_t queue, { } static inline cvmx_pko_status_t cvmx_pko_send_packet_finish(uint64_t port, - uint64_t queue, cvmx_pko_command_word0_t pko_command, + uint64_t queue, union cvmx_pko_command_word0_t pko_command, union cvmx_buf_ptr packet, cvmx_pko_lock_t use_locking) { cvmx_pko_status_t ret = 0; -- 2.23.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/5] staging: octeon: remove typedef declaration for cvmx_fau_reg_32_t
Remove typedef declaration for enum cvmx_fau_reg_32_t in drivers/staging/octeon/octeon-stubs.h. Also replace its previous uses with new declaration format. Issue found by checkpatch.pl Signed-off-by: Wambui Karuga --- drivers/staging/octeon/octeon-stubs.h | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h index 78f42597cee5..1725d54523de 100644 --- a/drivers/staging/octeon/octeon-stubs.h +++ b/drivers/staging/octeon/octeon-stubs.h @@ -201,9 +201,9 @@ union cvmx_helper_link_info_t { } s; }; -typedef enum { +enum cvmx_fau_reg_32_t { CVMX_FAU_REG_32_START = 0, -} cvmx_fau_reg_32_t; +}; typedef enum { CVMX_FAU_OP_SIZE_8 = 0, @@ -1178,16 +1178,18 @@ union cvmx_gmxx_rxx_rx_inbnd { } s; }; -static inline int32_t cvmx_fau_fetch_and_add32(cvmx_fau_reg_32_t reg, +static inline int32_t cvmx_fau_fetch_and_add32(enum cvmx_fau_reg_32_t reg, int32_t value) { return value; } -static inline void cvmx_fau_atomic_add32(cvmx_fau_reg_32_t reg, int32_t value) +static inline void cvmx_fau_atomic_add32(enum cvmx_fau_reg_32_t reg, +int32_t value) { } -static inline void cvmx_fau_atomic_write32(cvmx_fau_reg_32_t reg, int32_t value) +static inline void cvmx_fau_atomic_write32(enum cvmx_fau_reg_32_t reg, + int32_t value) { } static inline uint64_t cvmx_scratch_read64(uint64_t address) @@ -1364,7 +1366,7 @@ static inline int cvmx_spi_restart_interface(int interface, } static inline void cvmx_fau_async_fetch_and_add32(uint64_t scraddr, - cvmx_fau_reg_32_t reg, + enum cvmx_fau_reg_32_t reg, int32_t value) { } -- 2.23.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/5] staging: octeon: remove typedef declaration for cvmx_fau_op_size_t
Remove addition of new typedef for enum cvmx_fau_op_size_t in drivers/staging/octeon/octeon-stubs.h. Issue found by checkpatch.pl Signed-off-by: Wambui Karuga --- drivers/staging/octeon/octeon-stubs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h index 06e6a0223416..a0aa99e7b757 100644 --- a/drivers/staging/octeon/octeon-stubs.h +++ b/drivers/staging/octeon/octeon-stubs.h @@ -205,12 +205,12 @@ enum cvmx_fau_reg_32_t { CVMX_FAU_REG_32_START = 0, }; -typedef enum { +enum cvmx_fau_op_size_t { CVMX_FAU_OP_SIZE_8 = 0, CVMX_FAU_OP_SIZE_16 = 1, CVMX_FAU_OP_SIZE_32 = 2, CVMX_FAU_OP_SIZE_64 = 3 -} cvmx_fau_op_size_t; +}; typedef enum { CVMX_SPI_MODE_UNKNOWN = 0, -- 2.23.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/5] staging: octeon: remove typedef declaration for cvmx_helper_link_info_t
Remove declaration of union cvmx_helper_link_info_t as typedef in drivers/staging/octeon/octeon-stubs.h. Also replace its previous uses with new union declaration. Issue found by checkpatch.pl Signed-off-by: Wambui Karuga --- drivers/staging/octeon/ethernet-mdio.c | 6 +++--- drivers/staging/octeon/ethernet-rgmii.c | 4 ++-- drivers/staging/octeon/ethernet.c| 4 ++-- drivers/staging/octeon/octeon-ethernet.h | 2 +- drivers/staging/octeon/octeon-stubs.h| 10 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/octeon/ethernet-mdio.c b/drivers/staging/octeon/ethernet-mdio.c index ffac0c4b3f5c..847081549373 100644 --- a/drivers/staging/octeon/ethernet-mdio.c +++ b/drivers/staging/octeon/ethernet-mdio.c @@ -65,7 +65,7 @@ int cvm_oct_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) } void cvm_oct_note_carrier(struct octeon_ethernet *priv, - cvmx_helper_link_info_t li) + union cvmx_helper_link_info_t li) { if (li.s.link_up) { pr_notice_ratelimited("%s: %u Mbps %s duplex, port %d, queue %d\n", @@ -81,7 +81,7 @@ void cvm_oct_note_carrier(struct octeon_ethernet *priv, void cvm_oct_adjust_link(struct net_device *dev) { struct octeon_ethernet *priv = netdev_priv(dev); - cvmx_helper_link_info_t link_info; + union cvmx_helper_link_info_t link_info; link_info.u64 = 0; link_info.s.link_up = dev->phydev->link ? 1 : 0; @@ -106,7 +106,7 @@ int cvm_oct_common_stop(struct net_device *dev) { struct octeon_ethernet *priv = netdev_priv(dev); int interface = INTERFACE(priv->port); - cvmx_helper_link_info_t link_info; + union cvmx_helper_link_info_t link_info; union cvmx_gmxx_prtx_cfg gmx_cfg; int index = INDEX(priv->port); diff --git a/drivers/staging/octeon/ethernet-rgmii.c b/drivers/staging/octeon/ethernet-rgmii.c index d91fd5ce9e68..f815be830ce0 100644 --- a/drivers/staging/octeon/ethernet-rgmii.c +++ b/drivers/staging/octeon/ethernet-rgmii.c @@ -53,7 +53,7 @@ static void cvm_oct_set_hw_preamble(struct octeon_ethernet *priv, bool enable) static void cvm_oct_check_preamble_errors(struct net_device *dev) { struct octeon_ethernet *priv = netdev_priv(dev); - cvmx_helper_link_info_t link_info; + union cvmx_helper_link_info_t link_info; unsigned long flags; link_info.u64 = priv->link_info; @@ -103,7 +103,7 @@ static void cvm_oct_check_preamble_errors(struct net_device *dev) static void cvm_oct_rgmii_poll(struct net_device *dev) { struct octeon_ethernet *priv = netdev_priv(dev); - cvmx_helper_link_info_t link_info; + union cvmx_helper_link_info_t link_info; bool status_change; link_info = cvmx_helper_link_get(priv->port); diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c index 3de209b7d0ec..1f7a7ebe1a60 100644 --- a/drivers/staging/octeon/ethernet.c +++ b/drivers/staging/octeon/ethernet.c @@ -460,7 +460,7 @@ int cvm_oct_common_open(struct net_device *dev, struct octeon_ethernet *priv = netdev_priv(dev); int interface = INTERFACE(priv->port); int index = INDEX(priv->port); - cvmx_helper_link_info_t link_info; + union cvmx_helper_link_info_t link_info; int rv; rv = cvm_oct_phy_setup_device(dev); @@ -496,7 +496,7 @@ int cvm_oct_common_open(struct net_device *dev, void cvm_oct_link_poll(struct net_device *dev) { struct octeon_ethernet *priv = netdev_priv(dev); - cvmx_helper_link_info_t link_info; + union cvmx_helper_link_info_t link_info; link_info = cvmx_helper_link_get(priv->port); if (link_info.u64 == priv->link_info) diff --git a/drivers/staging/octeon/octeon-ethernet.h b/drivers/staging/octeon/octeon-ethernet.h index 042220d86d33..5a0d754b0c70 100644 --- a/drivers/staging/octeon/octeon-ethernet.h +++ b/drivers/staging/octeon/octeon-ethernet.h @@ -91,7 +91,7 @@ int cvm_oct_common_stop(struct net_device *dev); int cvm_oct_common_open(struct net_device *dev, void (*link_poll)(struct net_device *)); void cvm_oct_note_carrier(struct octeon_ethernet *priv, - cvmx_helper_link_info_t li); + union cvmx_helper_link_info_t li); void cvm_oct_link_poll(struct net_device *dev); extern int always_use_pow; diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h index fd7522f70f7e..78f42597cee5 100644 --- a/drivers/staging/octeon/octeon-stubs.h +++ b/drivers/staging/octeon/octeon-stubs.h @@ -191,7 +191,7 @@ struct cvmx_wqe_t { uint8_t packet_data[96]; }; -typedef union { +union cvmx_helper_link_info_t { uint64_t u64; struct { uint64_t reserved_20_63:44; @@ -199,7 +199,7 @@ typedef union { uint64_t full_duplex:1; /**< 1 if
Re: [PATCH v2 0/2] Add initial support for slimport anx7625
On 11.10.2019 04:20, Xin Ji wrote: > Hi all, > > The following series add initial support for the Slimport ANX7625 > transmitter, a > ultra-low power Full-HD 4K MIPI to DP transmitter designed for portable > device. > > This is the initial version, any mistakes, please let me know, I will fix it > in > the next series. > > Thanks, > Xin Next time please increment patchset version number - this is third iteration of v2. Regards Andrzej > > > Xin Ji (2): > dt-bindings: drm/bridge: anx7625: MIPI to DP transmitter binding > drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver > > .../bindings/display/bridge/anx7625.yaml | 96 + > drivers/gpu/drm/bridge/Makefile|2 +- > drivers/gpu/drm/bridge/analogix/Kconfig|6 + > drivers/gpu/drm/bridge/analogix/Makefile |1 + > drivers/gpu/drm/bridge/analogix/anx7625.c | 2153 > > drivers/gpu/drm/bridge/analogix/anx7625.h | 406 > 6 files changed, 2663 insertions(+), 1 deletion(-) > create mode 100644 > Documentation/devicetree/bindings/display/bridge/anx7625.yaml > create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.c > create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.h > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Outreachy kernel] [PATCH 1/5] staging: octeon: remove typedef declaration for cvmx_wqe_t
On Fri, 11 Oct 2019, Wambui Karuga wrote: > Remove typedef declaration from struct cvmx_wqe_t in You can remove the _t from the name as well. > drivers/staging/octeon/octeon-stubs.h. It's not really necessary to give the name of the file in the log message, as it can easily be seen below. julia > Also replace its previous uses with new struct declaration. > Issue found by checkpatch.pl > > Signed-off-by: Wambui Karuga > --- > drivers/staging/octeon/ethernet-rx.c | 6 +++--- > drivers/staging/octeon/ethernet-tx.c | 2 +- > drivers/staging/octeon/ethernet.c | 2 +- > drivers/staging/octeon/octeon-stubs.h | 22 +++--- > 4 files changed, 16 insertions(+), 16 deletions(-) > > diff --git a/drivers/staging/octeon/ethernet-rx.c > b/drivers/staging/octeon/ethernet-rx.c > index 0e65955c746b..63e15a70f3e7 100644 > --- a/drivers/staging/octeon/ethernet-rx.c > +++ b/drivers/staging/octeon/ethernet-rx.c > @@ -60,7 +60,7 @@ static irqreturn_t cvm_oct_do_interrupt(int irq, void > *napi_id) > * > * Returns Non-zero if the packet can be dropped, zero otherwise. > */ > -static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work) > +static inline int cvm_oct_check_rcv_error(struct cvmx_wqe_t *work) > { > int port; > > @@ -135,7 +135,7 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t > *work) > return 0; > } > > -static void copy_segments_to_skb(cvmx_wqe_t *work, struct sk_buff *skb) > +static void copy_segments_to_skb(struct cvmx_wqe_t *work, struct sk_buff > *skb) > { > int segments = work->word2.s.bufs; > union cvmx_buf_ptr segment_ptr = work->packet_ptr; > @@ -215,7 +215,7 @@ static int cvm_oct_poll(struct oct_rx_group *rx_group, > int budget) > struct sk_buff *skb = NULL; > struct sk_buff **pskb = NULL; > int skb_in_hw; > - cvmx_wqe_t *work; > + struct cvmx_wqe_t *work; > int port; > > if (USE_ASYNC_IOBDMA && did_work_request) > diff --git a/drivers/staging/octeon/ethernet-tx.c > b/drivers/staging/octeon/ethernet-tx.c > index c64728fc21f2..7ececfac0701 100644 > --- a/drivers/staging/octeon/ethernet-tx.c > +++ b/drivers/staging/octeon/ethernet-tx.c > @@ -515,7 +515,7 @@ int cvm_oct_xmit_pow(struct sk_buff *skb, struct > net_device *dev) > void *copy_location; > > /* Get a work queue entry */ > - cvmx_wqe_t *work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL); > + struct cvmx_wqe_t *work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL); > > if (unlikely(!work)) { > printk_ratelimited("%s: Failed to allocate a work queue > entry\n", > diff --git a/drivers/staging/octeon/ethernet.c > b/drivers/staging/octeon/ethernet.c > index cf8e9a23ebf9..3de209b7d0ec 100644 > --- a/drivers/staging/octeon/ethernet.c > +++ b/drivers/staging/octeon/ethernet.c > @@ -172,7 +172,7 @@ static void cvm_oct_configure_common_hw(void) > */ > int cvm_oct_free_work(void *work_queue_entry) > { > - cvmx_wqe_t *work = work_queue_entry; > + struct cvmx_wqe_t *work = work_queue_entry; > > int segments = work->word2.s.bufs; > union cvmx_buf_ptr segment_ptr = work->packet_ptr; > diff --git a/drivers/staging/octeon/octeon-stubs.h > b/drivers/staging/octeon/octeon-stubs.h > index b2e3c72205dd..fd7522f70f7e 100644 > --- a/drivers/staging/octeon/octeon-stubs.h > +++ b/drivers/staging/octeon/octeon-stubs.h > @@ -183,13 +183,13 @@ union cvmx_buf_ptr { > } s; > }; > > -typedef struct { > +struct cvmx_wqe_t { > union cvmx_wqe_word0 word0; > union cvmx_wqe_word1 word1; > union cvmx_pip_wqe_word2 word2; > union cvmx_buf_ptr packet_ptr; > uint8_t packet_data[96]; > -} cvmx_wqe_t; > +}; > > typedef union { > uint64_t u64; > @@ -1198,7 +1198,7 @@ static inline uint64_t cvmx_scratch_read64(uint64_t > address) > static inline void cvmx_scratch_write64(uint64_t address, uint64_t value) > { } > > -static inline int cvmx_wqe_get_grp(cvmx_wqe_t *work) > +static inline int cvmx_wqe_get_grp(struct cvmx_wqe_t *work) > { > return 0; > } > @@ -1345,14 +1345,14 @@ static inline void cvmx_pow_work_request_async(int > scr_addr, > cvmx_pow_wait_t wait) > { } > > -static inline cvmx_wqe_t *cvmx_pow_work_response_async(int scr_addr) > +static inline struct cvmx_wqe_t *cvmx_pow_work_response_async(int scr_addr) > { > - cvmx_wqe_t *wqe = (void *)(unsigned long)scr_addr; > + struct cvmx_wqe_t *wqe = (void *)(unsigned long)scr_addr; > > return wqe; > } > > -static inline cvmx_wqe_t *cvmx_pow_work_request_sync(cvmx_pow_wait_t wait) > +static inline struct cvmx_wqe_t *cvmx_pow_work_request_sync(cvmx_pow_wait_t > wait) > { > return (void *)(unsigned long)wait; > } > @@ -1390,21 +1390,21 @@ static inline cvmx_pko_status_t > cvmx_pko_send_packet_finish(uint64_t port, > return ret; > } > > -static inline void cvmx_wqe_set_port(cvmx_wqe_t *work
Re: [PATCH 1/5] KPC2000: kpc2000_spi.c: Fix style issues (line length)
On Thu, Oct 10, 2019 at 10:51:51PM -0700, Chandra Annamaneni wrote: > Resoved: "WARNING: line over 80 characters" from checkpatch.pl Please put "staging:" in your subject line, makes it easier to sort and handle. It should look something like: staging: kpc2000_spi: fix line length issues Looks a lot cleaner, right? > > Signed-off-by: Chandra Annamaneni > --- > drivers/staging/kpc2000/kpc2000_spi.c | 20 ++-- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/drivers/staging/kpc2000/kpc2000_spi.c > b/drivers/staging/kpc2000/kpc2000_spi.c > index 3be33c450cab..81d79b116ce0 100644 > --- a/drivers/staging/kpc2000/kpc2000_spi.c > +++ b/drivers/staging/kpc2000/kpc2000_spi.c > @@ -30,19 +30,19 @@ > #include "kpc.h" > > static struct mtd_partition p2kr0_spi0_parts[] = { > - { .name = "SLOT_0", .size = 7798784,.offset = 0, > }, > - { .name = "SLOT_1", .size = 7798784,.offset = > MTDPART_OFS_NXTBLK}, > - { .name = "SLOT_2", .size = 7798784,.offset = > MTDPART_OFS_NXTBLK}, > - { .name = "SLOT_3", .size = 7798784,.offset = > MTDPART_OFS_NXTBLK}, > - { .name = "CS0_EXTRA", .size = MTDPART_SIZ_FULL, .offset = > MTDPART_OFS_NXTBLK}, > + { .name = "SLOT_0", .size = 7798784, .offset = 0,}, > + { .name = "SLOT_1", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, > + { .name = "SLOT_2", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, > + { .name = "SLOT_3", .size = 7798784, .offset = MTDPART_OFS_NXTBLK}, > + { .name = "CS0_EXTRA", .size = MTDPART_SIZ_FULL, .offset = > MTDPART_OFS_NXTBLK}, Why did you pick 2 spaces here as a random choice of padding? That's very odd, please don't. Either leave this alone (as it lines everything up nicely), or only use one space. I would suggest just leaving it alone. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/5] KPC2000: kpc2000_spi.c: Fix style issues (missing blank line)
On Thu, Oct 10, 2019 at 10:51:52PM -0700, Chandra Annamaneni wrote: > Resolved: "CHECK: Please use a blank line after.." from checkpatch.pl > > Signed-off-by: Chandra Annamaneni Please fix the subject lines for all of these patches and resend. Also, this is a second set of patches, right? What changed from the first ones? You should properly version your patches and explain under the --- line what changed as the documentation states to. Please do that for when you resend these. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel