[alsa-devel] [PATCH 7/8] ALSA: Add comments and descriptions to functions
Takashi Iwai
tiwai at suse.de
Fri Sep 14 10:59:02 CEST 2012
At Thu, 13 Sep 2012 18:15:57 -0700,
Ian Minett wrote:
>
> From: Ian Minett <ian_minett at creativelabs.com>
>
> Signed-off-by: Ian Minett <ian_minett at creativelabs.com>
>
> diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
> index ef66817..936e161 100644
> --- a/sound/pci/hda/patch_ca0132.c
> +++ b/sound/pci/hda/patch_ca0132.c
> @@ -460,8 +460,12 @@ static int chipio_send(struct hda_codec *codec,
> static int chipio_write_address(struct hda_codec *codec,
> unsigned int chip_addx)
> {
> + struct ca0132_spec *spec = codec->spec;
> int res;
>
> + if (spec->curr_chip_addx == chip_addx)
> + return 0;
> +
So, here you do more than what the patch subject says.
It shouldn't be mixed up. If any real code changes are needed,
implement in another patch and describe properly what the patch does
and why needed.
> /* send low 16 bits of the address */
> res = chipio_send(codec, VENDOR_CHIPIO_ADDRESS_LOW,
> chip_addx & 0xffff);
> @@ -472,37 +476,14 @@ static int chipio_write_address(struct hda_codec *codec,
> chip_addx >> 16);
> }
>
> + spec->curr_chip_addx = (res < 0) ? ~0UL : chip_addx;
> +
> return res;
> }
>
> -static int chipio_write_addx(struct hda_codec *codec, u32 chip_addx)
> -{
> - struct ca0132_spec *spec = codec->spec;
> - int status;
> -
> - if (spec->curr_chip_addx == chip_addx)
> - return 0;
> -
> - /* send low 16 bits of the address */
> - status = chipio_send(codec, VENDOR_CHIPIO_ADDRESS_LOW,
> - chip_addx & 0xffff);
> -
> - if (status < 0)
> - return status;
> -
> - /* send high 16 bits of the address */
> - status = chipio_send(codec, VENDOR_CHIPIO_ADDRESS_HIGH,
> - chip_addx >> 16);
> -
> - spec->curr_chip_addx = (status < 0) ? ~0UL : chip_addx;
> -
> - return status;
> -}
> -
Ditto.
So in this patch, there should be only additions and corrections of
comments. Nothing more than that.
Takashi
More information about the Alsa-devel
mailing list