Re: [PATCH] staging: rtl8192u: fix coding style

2013-04-01 Thread Dan Carpenter
this up and send it as several patches. [patch 1/3] Staging: rtl8192u: r8192U_dm.h: use c99 comments [patch 2/3] Staging: rtl8192u: r8192U_dm.h: use proper white space [patch 3/3] Staging: rtl8192u: r8192U_dm.h: reposition the braces regards, dan carpenter -- To unsubscribe from this lis

[patch] [SCSI] bfa: Use GFP_ATOMIC under spin_lock

2013-03-08 Thread Dan Carpenter
This is always called with spinlocks held so it should use GFP_ATOMIC. The call tree is: -> bfad_drv_start() Takes spin_lock_irqsave(&bfad->bfad_lock, flags); -> bfa_fcs_pbc_vport_init() -> bfa_fcb_pbc_vport_create() Signed-off-by: Dan Carpenter diff --git a/

[patch] [SCSI] scsi_transport_sas: check for allocation failure

2013-03-08 Thread Dan Carpenter
Static checkers complain that this allocation isn't checked. We should return zero if the allocation fails. Signed-off-by: Dan Carpenter diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index 1b68142..a022997 100644 --- a/drivers/scsi/scsi_transport_

Re: [patch] [SCSI] scsi_transport_sas: check for allocation failure

2013-03-08 Thread Dan Carpenter
On Fri, Mar 08, 2013 at 12:57:12PM -0500, Douglas Gilbert wrote: > On 13-03-08 07:02 AM, Dan Carpenter wrote: > > For 32 bytes, why not use the stack? > It's a good point. I'll resend on Monday. regards, dan carpenter -- To unsubscribe from this list: send the line &qu

Re: Suggestion for fixing the variable length array used in the kernel.

2013-03-08 Thread Dan Carpenter
o some kind of guideline how to handle > > this. > > Roughly how many instances of this are there kernel-wide? > Around 150 on x86 allmodconfig. They are pretty well audited. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kerne

Re: Suggestion for fixing the variable length array used in the kernel.

2013-03-09 Thread Dan Carpenter
On Sat, Mar 09, 2013 at 10:10:08AM -0800, Christopher Li wrote: > On Fri, Mar 8, 2013 at 9:39 PM, Dan Carpenter > wrote: > > On Fri, Mar 08, 2013 at 04:29:22PM -0800, Andrew Morton wrote: > >> Roughly how many instances of this are there kernel-wide? > >> > >

Re: Suggestion for fixing the variable length array used in the kernel.

2013-03-10 Thread Dan Carpenter
On Sat, Mar 09, 2013 at 03:00:54PM -0800, Christopher Li wrote: > On Sat, Mar 9, 2013 at 2:34 PM, Dan Carpenter > wrote: > > The problems is if we go over the 8k stack. So big arrays are bad. > > Also if the dynamically sized array is inside a loop then normally > >

[patch] [SCSI] mpt3sas: move dereference under check

2013-03-11 Thread Dan Carpenter
pci_pool_free() dereferences "ioc->sense_dma_pool" but we check it for NULL on the following line. Signed-off-by: Dan Carpenter diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 1836003..06a84ef 100644 --- a/drivers/scsi/mpt3sas/mpt3sas

Re: [patch] [SCSI] scsi_transport_sas: check for allocation failure

2013-03-11 Thread Dan Carpenter
On Fri, Mar 08, 2013 at 10:50:19PM +, James Bottomley wrote: > On Fri, 2013-03-08 at 12:57 -0500, Douglas Gilbert wrote: > > On 13-03-08 07:02 AM, Dan Carpenter wrote: > > > Static checkers complain that this allocation isn't checked. We > > > should ret

Re: [PATCH 4/4] drivers: android: binder: Fix compiler warning

2013-03-11 Thread Dan Carpenter
laration section. Really the "int i" should go at the start of the function and the page_addr should go inside the for loop. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org

Re: [PATCH 1/4] drivers: android: binder: Move the node release code to a separate function

2013-03-11 Thread Dan Carpenter
ctive_transactions, page_count; > + int threads, nodes, incoming_refs, outgoing_refs, nd_refs, > + buffers, active_transactions, page_count; Don't introduce the new "nd_refs" variable. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubs

Re: [PATCH 2/4] drivers: android: binder: Fix code style

2013-03-11 Thread Dan Carpenter
+ struct binder_node *node = rb_entry(n, > + struct binder_node, > + rb_node); > Same thing again. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH v3 0/4] Cosmetic changes to the android binder proc release code

2013-03-12 Thread Dan Carpenter
llowing Dan Carpenter's review) Actually that was Joe. Looks good. Reviewed-by: Dan Carpenter regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger

Re: [PATCH] isdnloop: fix and simplify isdnloop_init()

2012-08-02 Thread Dan Carpenter
On Thu, Aug 02, 2012 at 06:44:56PM +0800, Fengguang Wu wrote: > [Add more CC] > That's not helpful... Resend the patch to netdev in a way that applies. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body o

Re: [PATCH 5/5] drivers/video/msm/mddi_client_nt35399.c: use devm_ functions

2012-08-06 Thread Dan Carpenter
; > return 0; > } > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in It's weird. This patch doesn't apply for me unless I add a blank line between the "}" and the "--". I'm not sure if that line is getting remov

Re: [PATCH 1/5] staging/csr: clean coding style in uf_start_thread

2012-08-06 Thread Dan Carpenter
ot worth resending if this is the only complaint, but actually the original had that braces correct. If either side of the if else statement gets uses curly braces then both sides should use them. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kern

Re: [PATCH 2/6] drivers/mfd: drop frees of devm allocated data

2012-08-06 Thread Dan Carpenter
^^^ The ret = PTR_ERR(map); is still needed for the error message. > - goto err_regmap_init; > + return PTR_ERR(map); > } regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the bo

Re: [PATCH] staging: sm7xxfb: copy name of the device before calling smtc_alloc_fb_info

2012-08-06 Thread Dan Carpenter
); > > + sfb->chip_id = ent->device; > + > if (!sfb) { Thanks for fixing this, and well done for spotting the bug. There is a dereference before the check here, but I see you resent this in another thread. Next time could you respond to the original with a message

Re: [PATCH] drivers/media/video/mx2_emmaprp.c: use devm_kzalloc and devm_clk_get

2012-08-06 Thread Dan Carpenter
oremap(&pdev->dev, res_emma); > if (!pcdev->base_emma) > goto rel_vdev; This was in the original code, but there is a "ret = -ENOMEM;" missing here, and again a couple lines down in the original code. regards, dan carpenter -- To unsubscribe from t

Re: [PATCH] drivers/media/video/mx2_emmaprp.c: use devm_kzalloc and devm_clk_get

2012-08-06 Thread Dan Carpenter
On Mon, Aug 06, 2012 at 05:23:23PM +0300, Dan Carpenter wrote: > On Sat, Aug 04, 2012 at 08:23:27PM +0200, Julia Lawall wrote: > > @@ -922,12 +920,7 @@ static int emmaprp_probe(struct platform_device *pdev) > > > > platform_set_drvdata(pdev, pcdev); > > > >

Re: [PATCH] staging: sm7xxfb: copy name of the device before calling smtc_alloc_fb_info

2012-08-06 Thread Dan Carpenter
On Mon, Aug 06, 2012 at 09:57:52PM +0545, Devendra Naga wrote: > On Mon, Aug 6, 2012 at 7:57 PM, Dan Carpenter > wrote: > > On Sat, Aug 04, 2012 at 11:06:12PM +0545, Devendra Naga wrote: > >> as we do a strcpy(smdrv_ptr->fb_struct->fix->id, name), and the name here

Re: [PATCH 1/2] Revert "xattr: mark variable as uninitialized to make both gcc and smatch happy"

2012-09-15 Thread Dan Carpenter
Argh... Sorry for that. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

[static analysis] memory corruption in tty/synclink.c on 64bit

2012-09-17 Thread Dan Carpenter
/* buffer size/data count */ volatile u16 status;/* Control/status field */ volatile u16 rcc; /* character count field */ u16 reserved; /* padding required by 16C32 */ This was there in the original code when it was merged in 2.2.5pre1. regards, dan carpenter -- To unsubscr

[patch] [SCSI] lpfc: fix an '&&' vs '&' typo

2012-09-17 Thread Dan Carpenter
The intent here was clearly to do a bitwise AND similar to the others in this file. The current condition is never true. Signed-off-by: Dan Carpenter --- Only needed in linux-next. diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index 7ffabb7..65f9fb6 100644 --- a

Re: [PATCH] staging: usbip: stub_dev: Fixed oops during removal of usbip_host

2012-09-18 Thread Dan Carpenter
a new problem of a resource leak. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] staging: usbip: vhci_hcd: Fixed oops during removal of vhci_hcd

2012-09-18 Thread Dan Carpenter
t variables except kernel thread pointers. > > so, at the time of vhci_hcd removal vhci_shoutdown_connection tries to kill > kernel threads > which are already killed. > Obviously, the same question would apply here. Why don't you do this in the shutdown function? regards, da

Re: [PATCH] staging: usbip: stub_dev: Fixed oops during removal of usbip_host

2012-09-18 Thread Dan Carpenter
On Tue, Sep 18, 2012 at 03:02:15PM +0530, navin patidar wrote: > On Tue, Sep 18, 2012 at 1:10 PM, Dan Carpenter > wrote: > > On Tue, Sep 18, 2012 at 09:30:06AM +0530, navin patidar wrote: > >> stub_device_reset should set kernel thread pointers to NULL. > >> so

Re: [PATCH] staging: usbip: stub_dev: Fixed oops during removal of usbip_host

2012-09-18 Thread Dan Carpenter
he patch, I immediately thought *resource leak*. I'm sorry that to take your time up, but it shouldn't be that complicated that I have to go tracking through the whole driver to understand this. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linu

Re: [PATCH v2] staging: usbip: vhci_hcd: Fixed oops during removal of vhci_hcd

2012-09-19 Thread Dan Carpenter
Acked-by: Dan Carpenter regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH v2] staging: usbip: stub_dev: Fixed oops during removal of usbip_host

2012-09-19 Thread Dan Carpenter
Acked-by: Dan Carpenter regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] Staging: panel: Fixed a macro coding style issue

2012-09-20 Thread Dan Carpenter
linux-3.6-rc6 cat raw_email.txt | git am use `git log -p` to review the commit log. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/ma

Re: [SCSI] qla4xxx: support iscsiadm session mgmt

2012-08-08 Thread Dan Carpenter
I never heard back on this. This buffer overflow is still present in the current code. regards, dan carpenter On Thu, Jun 14, 2012 at 09:27:45PM +0300, Dan Carpenter wrote: > Hi Manish, > > The patch b3a271a94d00: "[SCSI] qla4xxx: support iscsiadm session > mgmt" from

Re: [SCSI] qla4xxx: support iscsiadm session mgmt

2012-08-08 Thread Dan Carpenter
On Wed, Aug 08, 2012 at 10:35:44AM -0500, Mike Christie wrote: > On 08/08/2012 10:00 AM, Dan Carpenter wrote: > > I never heard back on this. This buffer overflow is still present > > in the current code. > > > > Qlogic just sent a patch yesterday. > ht

Re: [PATCH v2] staging: gdm72xx: fix reference counting in gdm_wimax_event_init

2012-08-09 Thread Dan Carpenter
Ben, I'm confused. Do you have a way to test this, or are you just doing manual review? regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://

Re: [PATCH 1/2] drivers/mfd: Add realtek pcie card reader driver

2012-08-12 Thread Dan Carpenter
cmd(pcr, 100); > + if (err < 0) > + return err; > + > + ptr = rtsx_pci_get_cmd_data(pcr); > + data = ((u16)ptr[1] << 8) || ptr[0]; ^^^^^^^^ Looks like bitwise OR was intended here. > + > + if (val) > +

Re: [PATCH 1/2] drivers/mfd: Add realtek pcie card reader driver

2012-08-13 Thread Dan Carpenter
On Mon, Aug 13, 2012 at 03:10:50PM +0800, wwang wrote: > 于 2012年08月13日 14:40, Dan Carpenter 写道: > > Looks like bitwise OR was intended here. > Hi Dan: > > Thank you. I will resend the patches. > It's always best to hold off a day on resending, in case there are oth

[bug report] [SCSI] mvumi: GFP_KERNEL under spin lock

2012-08-14 Thread Dan Carpenter
;- GFP_KERNEL The IRQ handler does print a warning before calling mvumi_handshake() so it seems like this path doesn't get exercised very much. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majo

Re: [PATCH] SubmittingPatches: clarify SOB tag usage when evolving submissions

2012-08-15 Thread Dan Carpenter
would be: Signed-off-by: The patch went through you. Legal responsibility. Acked-by: You know what you are talking about and approve. Reviewed-by: You reviewed the patch and approve. Contributor: You noticed or fixed a bug in the patch. regards, dan carpenter -- To unsubscribe from this list:

[patch] [SCSI] mvsas: fix a && vs & bug

2012-08-16 Thread Dan Carpenter
The "1 << (slot_idx % 32)" condition is always true. The intent was to test a bit field here using bitwise AND. We do the test correctly a few lines later in the do while loop. Signed-off-by: Dan Carpenter --- Static checker fix. Untested. Would apply to the -stable kerne

[patch] TTY: tty_alloc_driver() returns error pointers

2012-08-16 Thread Dan Carpenter
We changed these from alloc_tty_driver() to tty_alloc_driver() so the error handling needs to modified to check for IS_ERR() instead of NULL. Signed-off-by: Dan Carpenter --- Only needed on linux-next. diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index f5a27c6..2bace84 100644 --- a

Re: [PATCH 1/2] Staging: slicoss: Clean up tabs vs spaces in slic.h

2012-07-23 Thread Dan Carpenter
006/03/27 15:10:37" > +#define OASIS_UCODE_HOSTIF_ID 3 No. The original was far better. Looking through the rest of the patch, some of these changes are ok, and some are nonsense. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in t

Re: [PATCH 2/2] Staging: slicoss: Clean up spaces vs tabs in slicoss.c

2012-07-23 Thread Dan Carpenter
__func__, cpuid, curr_pid); The original was actually the correct way here, lining is up is preferred. I don't care about this one line, but just so you are aware. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body

Re: [PATCH 2/2 v5][resend] tmpfs: interleave the starting node of /dev/shmem

2012-07-23 Thread Dan Carpenter
interleave’: mm/shmem.c:1341:9: warning: assignment makes integer from pointer without a cast [enabled by default] > + > + offset += ((addr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff; > + > + return offset; > +} > #endif regards, dan carpenter -- To

Re: [PATCH 1/3] drivers/misc: Add realtek card reader core driver

2012-07-23 Thread Dan Carpenter
((u32)((ptr)[2]) << 8) | (ptr)[3]) > + This will break on big endian systems. Use be32_to_cpu(). Use Sparse to check your work: http://lwn.net/Articles/205624/ regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the

Re: [PATCH] staging: gdm72xx: fix reference counting in gdm_wimax_event_init

2012-07-23 Thread Dan Carpenter
mishandles the reference counting of wm_event. > regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH 2/5] staging/vme: fix checkpatch warning

2012-08-17 Thread Dan Carpenter
It's not a huge deal, it just seems like there was some confusion on how to break patches up. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.

Re: [PATCH 1/1] staging: iio: Integration gyroscope itg3200

2012-08-17 Thread Dan Carpenter
; + > + iio_device_unregister(indio_dev); > + > + /* > + ret = itg3200_stop_device(indio_dev); > + if (ret) > + goto err_ret; Remove these commented out bits before submitting. > + */ > + > + if (client->irq && gpio_is_valid(irq_to_gpio(client->irq)) > 0)

[patch] [SCSI] bnx2fc: zero out sense buffer properly

2012-08-18 Thread Dan Carpenter
->sense_buffer used to be an array but it changed to pointer in de25deb180 "[SCSI] use dynamically allocated sense buffer". This call to memset() needs to be updated as well. Signed-off-by: Dan Carpenter diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2

Re: [PATCH 09/20] staging: comedi: adv_pci1723: fix initial dio subdevice state and io_bits

2012-08-20 Thread Dan Carpenter
all at once. If we fix only one line, then at least one line will be readable and that is one more than before so *improvement*. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org M

Re: [PATCH 0/3] staging: bcm: Cleanup bcm driver

2012-07-10 Thread Dan Carpenter
atchset looks good! > > > > Thanks for the answer Kevin!! > > > > So, do I have your ack? > Yes, I ack. The normal format is: Acked-by: Your Name Some maintainers have scripts which pick Acked-by tags automatically or even if they don't they can copy and paste

Re: [PATCH 0/3] staging: bcm: Cleanup bcm driver

2012-07-10 Thread Dan Carpenter
On Tue, Jul 10, 2012 at 09:24:23AM -0400, Kevin McKinney wrote: > On Tue, Jul 10, 2012 at 8:51 AM, Dan Carpenter > wrote: > > On Tue, Jul 10, 2012 at 08:38:41AM -0400, Kevin McKinney wrote: > >> On Mon, Jul 09, 2012 at 11:48:09PM -0300, Marcos Souza wrote: > >

[patch] tracing: check for allocation failure

2012-07-10 Thread Dan Carpenter
Clean up and return -ENOMEM on if the kzalloc() fails. Signed-off-by: Dan Carpenter diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 814ff30..a120f98 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -2390,6 +2390,9 @@ __tracing_open(struct inode *inode, struct file

[patch] Extcon: Arizona: unlock on an error in arizona_micdet()

2012-07-10 Thread Dan Carpenter
Smatch complains about this. I don't have a way to test this, but it does look like we should unlock on error here. Signed-off-by: Dan Carpenter diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index b068bc9..4782884 100644 --- a/drivers/extcon/extcon-ariz

[patch] tty: double unlock on error in ptmx_open()

2012-07-10 Thread Dan Carpenter
The problem here is that we called mutex_unlock(&devpts_mutex) on the error path when we weren't holding the lock. Signed-off-by: Dan Carpenter diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index d855883..a0ca083 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -618,1

Re: [PATCH 2/2] staging/et131x: remove memset for the TCB

2012-07-12 Thread Dan Carpenter
gelog I was expecting the kcalloc() to be in the same function but it wasn't. So then I have to redo all your work and check every code path. You could have said what the code paths were in your description so I don't have to grovel through it all myself. regards, dan carpenter -- To unsub

Re: [PATCH 2/5] staging: zcache: rename ramster to zcache

2013-01-19 Thread Dan Carpenter
On Fri, Jan 18, 2013 at 01:24:24PM -0800, Dan Magenheimer wrote: > [V2: no code changes, patchset now generated via git format-patch -M] If you put these comments below the --- cut off line (together with the diffstat) then "git am" won't add them to the commit log. rega

[patch] f2fs: use _safe() version of list_for_each

2013-01-20 Thread Dan Carpenter
This is calling list_del() inside a loop which is a problem when we try move to the next item on the list. I've converted it to use the _safe version. And also, as a cleanup, I've converted it to use list_for_each_entry instead of list_for_each. Signed-off-by: Dan Carpenter --- Stati

[patch v3] b43: N-PHY: fix gain in b43_nphy_get_gain_ctl_workaround_ent()

2013-01-20 Thread Dan Carpenter
There were no break statements in this switch statement so everything used the default settings. Per Walter Harms's suggestion, I've replaced the switch statement and done a little cleanup. Signed-off-by: Dan Carpenter --- v2: Make additional style fixes as well while we're m

Re: [patch] f2fs: use _safe() version of list_for_each

2013-01-21 Thread Dan Carpenter
On Mon, Jan 21, 2013 at 09:39:43AM +0900, Namjae Jeon wrote: > 2013/1/21, Dan Carpenter : > > This is calling list_del() inside a loop which is a problem when we try > > move to the next item on the list. I've converted it to use the _safe > > version. And also, as a

Re: [patch] module: potential deadlock in error path

2013-01-21 Thread Dan Carpenter
Rusty, you have this right? I like Linus's version. Could you give me a Reported-by tag? regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://

Re: [patch] f2fs: use _safe() version of list_for_each

2013-01-21 Thread Dan Carpenter
I sometimes write little user space programs to help me check my work. I've attached one. gcc test.c ./a.out regards, dan carpenter #ifndef _LINUX_LIST_H #define _LINUX_LIST_H #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) /** * container_of - cast a member of a s

Re: [RFC PATCH linux-next] et131x: Promote staging et131x driver to drivers/net

2013-01-21 Thread Dan Carpenter
On Mon, Jan 21, 2013 at 11:44:55PM +, Mark Einon wrote: > On 19 January 2013 11:03, Dan Carpenter wrote: > > > > > et131x_get_regs() has endian bugs calling et131x_mii_read(). > > > > > Hi Dan, > > Could you be a bit more descriptive about the issues

Re: [PATCH] staging/iio: Use correct argument for sizeof

2013-01-21 Thread Dan Carpenter
e array is a NULL. > The semantic patch that makes this output is available > in scripts/coccinelle/misc/noderef.cocci. > > More information about semantic patching is available at > http://coccinelle.lip6.fr/ Can you remove those two boiler plate lines? We all have google

Re: [PATCH] staging/iio: Use correct argument for sizeof

2013-01-21 Thread Dan Carpenter
These two lines are what I meant. Not the other stuff before. > > More information about semantic patching is available at > > http://coccinelle.lip6.fr/ regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body

[patch] ntb: off by one sanity checks

2013-01-21 Thread Dan Carpenter
These tests are off by one. If "mw" is equal to NTB_NUM_MW then we would go beyond the end of the ndev->mw[] array. Signed-off-by: Dan Carpenter diff --git a/drivers/ntb/ntb_hw.c b/drivers/ntb/ntb_hw.c index 4c71b17..5bf54f3 100644 --- a/drivers/ntb/ntb_hw.c +++ b/drivers

Re: [PATCH] staging/iio: Use correct argument for sizeof

2013-01-22 Thread Dan Carpenter
On Tue, Jan 22, 2013 at 09:02:05AM +0100, Lars-Peter Clausen wrote: > On 01/22/2013 07:43 AM, Dan Carpenter wrote: > > On Mon, Jan 21, 2013 at 10:14:02PM +0100, Peter Huewe wrote: > >> found with coccicheck > >> sizeof when applied to a pointer typed expression gives t

Re: [PATCH v4 0/8] rtsx patchset for MFD and MMC tree

2013-01-22 Thread Dan Carpenter
the 3.9 merge window. The merge window is for Samuel => Linus, it's not for you => Samuel. If your code has not reached Samuel's tree before 3.8 has been released then it's too late and it will be delayed for another few months. regards, dan carpenter -- To unsubscribe from th

Re: [RFC PATCH v2 linux-next] et131x: Promote staging et131x driver to drivers/net

2013-01-23 Thread Dan Carpenter
ip all > + the questions about Atheros devices. If you say Y, you will be asked ^^^ Agere? > + for your specific card in the following questions. > + I think you should just leave this block out entirely. It doesn't save time for anyone. regards, dan c

[patch] NTB: fix pointer math issues

2013-01-23 Thread Dan Carpenter
->remote_rx_info and ->rx_info are struct ntb_rx_info pointers. If we add sizeof(struct ntb_rx_info) then it goes too far. Signed-off-by: Dan Carpenter --- diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c index e0bdfd7..676ee16 100644 --- a/drivers/ntb/ntb_trans

Re: [PATCH] MAINTAINERS: Remove Jarod Wilson and orphan LIRC drivers

2013-02-12 Thread Dan Carpenter
On Tue, Feb 12, 2013 at 01:20:36PM -0800, Joe Perches wrote: > His email bounces and he hasn't done work on > these sections in a couple of years. > I've added him to the CC list. Can we just update MAINTAINERS with the correct email address? It's been useful to CC him

Re: [PATCH] staging/comedi: Fix undefined array subscript

2013-02-12 Thread Dan Carpenter
x_buf[reg] &= ~data[0]; Or maybe data[0] == 0 needs to be handled differently. Ian would know for sure. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [PATCH] staging/comedi: Fix undefined array subscript

2013-02-13 Thread Dan Carpenter
l == VMK8061_MODEL) { - reg = VMK8061_DO_REG; tx_buf[0] = VMK8061_CMD_RD_DO; regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/maj

Re: [PATCH v2] staging/comedi: Fix undefined array subscript

2013-02-13 Thread Dan Carpenter
Looks great. :) Thanks for fixing this bug. regards, dan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org

[patch] generic-adc-battery: forever loop in gab_remove()

2013-02-13 Thread Dan Carpenter
ts of the adc_bat->channel[chan] array to be an ERR_PTR(). I've changed them to be NULL instead. We're still not allowed to pass NULLs to iio_channel_release() so I've added a check. Finally, I removed an unused "chan = ARRAY_SIZE(gab_chan_name);" statement as a small cl

Re: [PATCH 1/7] staging/ozwpan: Fix sparse warning Using plain integer as NULL pointer

2013-02-15 Thread Dan Carpenter
; skb = alloc_skb(f->total_size + OZ_ALLOCATED_SPACE(dev), GFP_ATOMIC); > - if (skb == 0) > - return 0; > + if (skb == NULL) > + return NULL; regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel"

Re: [PATCH 3/7 v2] staging/ozwpan: Fix NULL vs zero in ozeltbuf.c (sparse warning)

2013-02-15 Thread Dan Carpenter
f->stream_list was empty. I don't if that can happen, but I still consider it a bug fix. Good job, but next time you mention it in the changelog. You've fixed a couple of these uninitialized variable bugs recently. Is this is a clang warning? GCC doesn't catch it. regards, dan

Re: [PATCH 1/7 v2] staging/ozwpan: Fix NULL vs zero in ozpd.c (sparse warning)

2013-02-15 Thread Dan Carpenter
Looks great. Reviewed-by: Dan Carpenter regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FA

Re: Clang Analyzer was Re: [PATCH 3/7 v2] staging/ozwpan: Fix NULL vs zero in ozeltbuf.c (sparse warning)

2013-02-15 Thread Dan Carpenter
Are you using this version of clang?: http://git.linuxfoundation.org/llvmlinux.git/ regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org

Re: [PATCH 5/5] staging/xgifb: Remove duplicated code in loops.

2013-02-18 Thread Dan Carpenter
. Perhaps the "+ 1" was supposed to be a "+ i". There is no way to know really. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [PATCH 3/5] staging/xgifb: Remove code without effect

2013-02-18 Thread Dan Carpenter
support in 34c13ee2b "staging: xgifb: drop code for legacy VGA modes". I don't know if the inb() is still needed. Aaro? regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org

[patch] gpio-timberdale: fix a potential wrapping issue

2012-10-10 Thread Dan Carpenter
->last_ier is an unsigned long but the high bits can't be used int the original code because the shift wraps. Signed-off-by: Dan Carpenter diff --git a/drivers/gpio/gpio-timberdale.c b/drivers/gpio/gpio-timberdale.c index 031c6ad..1a3e2b9 100644 --- a/drivers/gpio/gpio-timberdale

[patch] [SCSI] bfa: unlock on error in bfad_iocmd_cfg_trunk()

2012-10-10 Thread Dan Carpenter
We added a new return but forgot to drop the lock first. Signed-off-by: Dan Carpenter --- Bug introduced in e353546e "[SCSI] bfa: Add diagnostic port (D-Port) support". diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c index 555e7db..91465b2 100644 --- a/driver

[patch] [SCSI] bfa: cleanup a memcpy()

2012-10-11 Thread Dan Carpenter
Smatch complains that we are writing more data than ->srlid_base member can hold. In fact, we are over writing the whole struct. I've re-written it to be a bit more clear and to silence the static checker warning. Signed-off-by: Dan Carpenter diff --git a/drivers/scsi/bfa/bfa_ioc.c b

[patch] irq: potential integer wrapping __setup_irq()

2012-10-11 Thread Dan Carpenter
"thread_mask" is an unsigned long. It's better to use 1UL here so we can take advantage of the high bits as well. Signed-off-by: Dan Carpenter diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 4c69326..cfe1283 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/mana

Re: [patch] x86, UV: integer wrap bug in uv_hub_ipi_value()

2012-11-20 Thread Dan Carpenter
into an int (32 bit). I don't think that > was your intent. Wait what? I only did int => long casts, not the other way around. It occured to me to use u64 but this code is only compiled on x86_64 and I wrote my patch to match the surrounding context. regards, dan carpenter -- To un

Re: [PATCH 8/8] staging: wlags49_h2: ap_h2.c: fixes inconsistent spacing around *

2012-11-21 Thread Dan Carpenter
casting is a high precedence operation. More readable: (char *)p + 1; Less readable: (char *) p + 1; In the first line it's obvious that we cast first and then add 1. So this should be: (hcf_8 *)fw_image_1_data, regards, dan carpenter -- To unsubscribe from this list:

Re: [PATCH 10/10] staging: cxt1e1: sbecrc.c: fixes 80+ char line length issue

2012-11-21 Thread Dan Carpenter
You will have to use spaces since it's not exactly on a tab stop. But really it's better to just get rid of the call to OS_kmalloc(). tbl = kmalloc(CRC_TABLE_ENTRIES * sizeof(*tbl), GFP_KERNEL); OS_kmalloc() adds a GFP_DMA flag and a memset() but it's not needed

Re: [PATCH 06/10] staging: cxt1e1: musycc.c: fixes placement of parentheses

2012-11-21 Thread Dan Carpenter
On Tue, Nov 20, 2012 at 07:28:48PM +0200, Johan Meiring wrote: > This commit fixes several incorrect placements of parantheses, as > identified by the checkpatch.pl tool. > This patch is fine, and all. Acked-by: Dan Carpenter But you could go beyond fixing just checkpatch.pl

Re: [V2 PATCH 1/3] staging: ozwpan: Remove redundant null check before kfree in ozpd.c

2012-11-21 Thread Dan Carpenter
not a good idea to get too control freaky over this code which is all going to have to be replaced before this can graduate out of staging. You're just going to discourage people from contributing if you redo all their patches. Linaro people are the real deal and you should let them help

Re: [PATCH] Staging: rtl8187se: bugfix in r8180_wx.c

2012-11-21 Thread Dan Carpenter
op stub where it checked if IW_ENCODE_DISABLED and did nothing. Then in a cleanup patch we accidentally turned the check on. That was: de171bd6ff "Staging: rtl8187se: r8180_wx: fixed a lot of checkpatch.pl issues". The check should just be removed. --- regards, dan carpenter -- To un

Re: [V2 PATCH 1/3] staging: ozwpan: Remove redundant null check before kfree in ozpd.c

2012-11-21 Thread Dan Carpenter
trivial patches that are going to be re-written anyway. :P regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] staging: zram: Prevent use of unmapped buffer

2012-11-22 Thread Dan Carpenter
On Fri, Nov 23, 2012 at 09:17:09AM +0900, Minchan Kim wrote: > Hi Nitin, > > Current next-20121115(I don't know why linux-next stay at the version. Is > there > any problem on the tree? or Stephen go to holiday?) Yep. He'll be back on Monday. regards, dan carpente

[patch] ibft: add a missing break statement

2013-01-10 Thread Dan Carpenter
The code works the same with or without the break. It just looks a bit cleaner to not fall through. Signed-off-by: Dan Carpenter diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c index 3ee852c..c4b187c 100644 --- a/drivers/firmware/iscsi_ibft.c +++ b/drivers/firmware

[patch] dac960: return success instead of -ENOTTY

2013-01-10 Thread Dan Carpenter
There is a missing break statement here. This used to return directly but we re-worked it in 2008 to add locking as part of the BKL push down. Signed-off-by: Dan Carpenter diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index 9a13e88..0d3ffc5 100644 --- a/drivers/block/DAC960.c

Re: [PATCH 5/5] spi: fix return value check in hspi_probe().

2013-01-11 Thread Dan Carpenter
On Fri, Jan 11, 2013 at 03:02:02PM +, Grant Likely wrote: > On Thu, 3 Jan 2013 19:04:55 +0300, Dan Carpenter > wrote: > > On Sat, Dec 22, 2012 at 09:56:20AM +, Grant Likely wrote: > > > On Wed, 19 Dec 2012 19:39:14 +0300, Dan Carpenter > > > wrote: > &g

Re: [PATCH] drivers: nouveau: Bool tests don't need comparison

2012-12-13 Thread Dan Carpenter
t is available > in scripts/coccinelle/misc/boolinit.cocci. > > More information about semantic patching is available at > http://coccinelle.lip6.fr/ > For some reason the commit message is indented by one space. Don't do whatever caused that. regards, dan carpenter --

Re: [PATCH 1/1] Drivers: hv: balloon: Fix a memory leak

2012-12-13 Thread Dan Carpenter
used labels that describe what the code does instead of GW-BASIC labels then you wouldn't need to rename them. err_stop_thread: kthread_stop(dm_device.thread); err_close_vmbus: vmbus_close(dev->channel); err_free_send_buf: kfree(send_buffer); regards, dan carpenter

Re: [PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-13 Thread Dan Carpenter
On Wed, Dec 12, 2012 at 01:25:56AM +0400, Evgeniy Polyakov wrote: > I suppose mdev will be automatically freed, but who will release > mdev->clk and other private members of mdev structure? + mdev->clk = devm_clk_get(&pdev->dev, NULL); ->clk is now a devm pointer

Re: [PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-13 Thread Dan Carpenter
On Thu, Dec 13, 2012 at 11:18:53AM +0100, Julia Lawall wrote: > On Thu, 13 Dec 2012, Dan Carpenter wrote: > > > On Wed, Dec 12, 2012 at 01:25:56AM +0400, Evgeniy Polyakov wrote: > > > I suppose mdev will be automatically freed, but who will release > > > mdev->

Re: [PATCH 0/6] staging:rtl8192u: begin cleanup of some checkpatch errors

2012-12-14 Thread Dan Carpenter
ould be happy to further improve the > patches as necessary. The merge window is open. Nothing is going to happen until after New Years. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kerne

<    1   2   3   4   5   6   7   8   9   10   >