All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: LCID Fire <lcid-fire@gmx.net>
Cc: Alsa-devel <alsa-devel@alsa-project.org>
Subject: Re: [PATCH] serato phono patch
Date: Tue, 13 Jan 2009 08:14:46 +0100	[thread overview]
Message-ID: <s5hbpub3cex.wl%tiwai@suse.de> (raw)
In-Reply-To: <496B94EA.8080109@gmx.net>

At Mon, 12 Jan 2009 20:07:22 +0100,
LCID Fire wrote:
> 
> Add serato input phono switch

Thank you for the patch.

Could you give a more detailed patch description?
Also, don't forget to give your sign-off.  Otherwise I can't merge
it to the upstream for such an amount of patch.

Also, the patch embedded in your post seems broken due to line breaks
likely by your MUA.  Please fix MUA setting or use an attachment if
difficult to fix.

Some quick review comments below...

> diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
> index b8cfb7c..66fc115 100644
> --- a/sound/usb/usbaudio.c
> +++ b/sound/usb/usbaudio.c
> @@ -2859,7 +2859,7 @@ static int snd_usb_create_streams(struct 
> snd_usb_audio *chip, int ctrlif)
>      /* find audiocontrol interface */
>      host_iface = &usb_ifnum_to_if(dev, ctrlif)->altsetting[0];
>      if (!(p1 = snd_usb_find_csint_desc(host_iface->extra, 
> host_iface->extralen, NULL, HEADER))) {
> -        snd_printk(KERN_ERR "cannot find HEADER\n");
> +        snd_printk(KERN_ERR "cannot find HEADER for %d in %s\n", 
> ctrlif, host_iface->extra);

Is host_iface->extra really NULL-terminated, i.e. safe to use as a
string?

> diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
> index 89c63d0..8e936d1 100644
> --- a/sound/usb/usbmixer.c
> +++ b/sound/usb/usbmixer.c
> @@ -2012,6 +2012,233 @@ static void snd_audigy2nx_proc_read(struct 
> snd_info_entry *entry,
>      }
>  }
>  
> +void snd_usb_cleanup_interrupt_urb(struct urb* pUrb)

Make it static.

> +{
> +    if(pUrb->transfer_buffer_length > 0)
> +        kfree(pUrb->transfer_buffer);
> +   
> +    if(pUrb->context)
> +        kfree(pUrb->context);

No need of a NULL-check for kfree.

> +
> +    usb_free_urb(pUrb);
> +}
> +
> +/* Wrapper for setting and submitting the interrupt urb().*/
> +int snd_usb_interrupt_trans(struct usb_device *dev, unsigned int pipe, 
> void *data,
> +             __u16 size, usb_complete_t callback)

Make it static.

> +{
> +    int err;
> +    void *buf = NULL;
> +    struct urb* pUrb = NULL;

No need to initialize this.

> +
> +    if (size > 0) {
> +        buf = kmemdup(data, size, GFP_KERNEL);
> +        if (!buf)
> +            return -ENOMEM;
> +    }
> +
> +    pUrb = usb_alloc_urb(1/*int iso packets*/, GFP_KERNEL);

Missing NULL check.

> +    /*TODO: Remove hardcoded 4*/
> +    usb_fill_int_urb(pUrb, dev, pipe, buf, size, callback, NULL, 4);
> +
> +    err = usb_submit_urb(pUrb, GFP_KERNEL);
> +   
> +    return err;

Possible memory leak when error?

> +static int snd_sl_phono_put(struct snd_kcontrol *kcontrol, struct 
> snd_ctl_elem_value *ucontrol)
(snip)
> +
> +    err = snd_usb_interrupt_trans(mixer->chip->dev,
> +                usb_rcvbulkpipe(mixer->chip->dev, 0x83),
> +                buffer, bufferSize, snd_sl_phono_receive);

No error check?

Also, there are a few coding-style issues.
I'd suggest you to run scripts/checkpatch.pl once.


thanks,

Takashi

  reply	other threads:[~2009-01-13  7:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-12 16:54 [PATCH] sscape: fix incorrect timeout after microcode upload Krzysztof Helt
2009-01-12 17:01 ` Takashi Iwai
2009-01-12 19:07   ` [PATCH] serato phono patch LCID Fire
2009-01-13  7:14     ` Takashi Iwai [this message]
2009-01-17 15:57       ` LCID Fire
2009-01-17 16:01         ` LCID Fire
2009-01-12 20:25   ` [PATCH] sscape: fix incorrect timeout after microcode upload Krzysztof Helt
2009-01-13  6:53     ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hbpub3cex.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=lcid-fire@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.