<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/sound/i2c, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/sound/i2c?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/sound/i2c?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2021-06-12T07:32:14Z</updated>
<entry>
<title>ALSA: i2c: tea6330t: Remove redundant initialization of variable err</title>
<updated>2021-06-12T07:32:14Z</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2021-06-11T16:52:23Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e094b22c8d519e5d5417a57d6f6ddc1b5f0aefaf'/>
<id>urn:sha1:e094b22c8d519e5d5417a57d6f6ddc1b5f0aefaf</id>
<content type='text'>
The variable err is being initialized with a value that is never read,
it is being updated later on. The assignment is redundant and can be
removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Link: https://lore.kernel.org/r/20210611165223.38983-1-colin.king@canonical.com
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: i2c: Fix assignment in if condition</title>
<updated>2021-06-09T15:30:37Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2021-06-08T14:05:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=dd1431e53515e5760c03975a0a35aef75924a66d'/>
<id>urn:sha1:dd1431e53515e5760c03975a0a35aef75924a66d</id>
<content type='text'>
ALSA I2C helper drivers contain a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-66-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: Convert strlcpy to strscpy when return value is unused</title>
<updated>2021-01-08T08:30:05Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2021-01-04T17:17:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=75b1a8f9d62e50f05d0e4e9f3c8bcde32527ffc1'/>
<id>urn:sha1:75b1a8f9d62e50f05d0e4e9f3c8bcde32527ffc1</id>
<content type='text'>
strlcpy is deprecated.  see: Documentation/process/deprecated.rst

Change the calls that do not use the strlcpy return value to the
preferred strscpy.

Done with cocci script:

@@
expression e1, e2, e3;
@@

-	strlcpy(
+	strscpy(
	e1, e2, e3);

This cocci script leaves the instances where the return value is
used unchanged.

After this patch, sound/ has 3 uses of strlcpy() that need to be
manually inspected for conversion and changed one day.

$ git grep -w strlcpy sound/
sound/usb/card.c:               len = strlcpy(card-&gt;longname, s, sizeof(card-&gt;longname));
sound/usb/mixer.c:      return strlcpy(buf, p-&gt;name, buflen);
sound/usb/mixer.c:                      return strlcpy(buf, p-&gt;names[index], buflen);

Miscellenea:

o Remove trailing whitespace in conversion of sound/core/hwdep.c

Link: https://lore.kernel.org/lkml/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Acked-by: Mark Brown &lt;broonie@kernel.org&gt;
Link: https://lore.kernel.org/r/22b393d1790bb268769d0bab7bacf0866dcb0c14.camel@perches.com
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: i2c: Constify snd_kcontrol_new items</title>
<updated>2020-01-03T08:24:24Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2020-01-03T08:16:50Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=0da2c47a951c27f1be34cb9221d77b0ed2db6cee'/>
<id>urn:sha1:0da2c47a951c27f1be34cb9221d77b0ed2db6cee</id>
<content type='text'>
Most of snd_kcontrol_new definitions are read-only and passed as-is.
Let's declare them as const for further optimization.

There should be no functional changes by this patch.

Link: https://lore.kernel.org/r/20200103081714.9560-35-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: i2c: Constify snd_device_ops definitions</title>
<updated>2020-01-03T08:23:53Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2020-01-03T08:16:22Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=d23015c12144736bbea6dbd0fdd8dcae3d1e47c5'/>
<id>urn:sha1:d23015c12144736bbea6dbd0fdd8dcae3d1e47c5</id>
<content type='text'>
Now we may declare const for snd_device_ops definitions, so let's do
it for optimization.

There should be no functional changes by this patch.

Link: https://lore.kernel.org/r/20200103081714.9560-7-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: i2c: ak4xxx-adda: Fix a possible null pointer dereference in build_adc_controls()</title>
<updated>2019-07-26T12:25:37Z</updated>
<author>
<name>Jia-Ju Bai</name>
<email>baijiaju1990@gmail.com</email>
</author>
<published>2019-07-26T02:14:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2127c01b7f63b06a21559f56a8c81a3c6535bd1a'/>
<id>urn:sha1:2127c01b7f63b06a21559f56a8c81a3c6535bd1a</id>
<content type='text'>
In build_adc_controls(), there is an if statement on line 773 to check
whether ak-&gt;adc_info is NULL:
    if (! ak-&gt;adc_info ||
        ! ak-&gt;adc_info[mixer_ch].switch_name)

When ak-&gt;adc_info is NULL, it is used on line 792:
    knew.name = ak-&gt;adc_info[mixer_ch].selector_name;

Thus, a possible null-pointer dereference may occur.

To fix this bug, referring to lines 773 and 774, ak-&gt;adc_info
and ak-&gt;adc_info[mixer_ch].selector_name are checked before being used.

This bug is found by a static analysis tool STCheck written by us.

Signed-off-by: Jia-Ju Bai &lt;baijiaju1990@gmail.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156</title>
<updated>2019-05-30T18:26:35Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-05-27T06:55:05Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=1a59d1b8e05ea6ab45f7e18897de1ef0e6bc3da6'/>
<id>urn:sha1:1a59d1b8e05ea6ab45f7e18897de1ef0e6bc3da6</id>
<content type='text'>
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license as published by
  the free software foundation either version 2 of the license or at
  your option any later version this program is distributed in the
  hope that it will be useful but without any warranty without even
  the implied warranty of merchantability or fitness for a particular
  purpose see the gnu general public license for more details you
  should have received a copy of the gnu general public license along
  with this program if not write to the free software foundation inc
  59 temple place suite 330 boston ma 02111 1307 usa

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 1334 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Reviewed-by: Richard Fontana &lt;rfontana@redhat.com&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ALSA: i2c: Clean up with new procfs helpers</title>
<updated>2019-02-06T17:11:56Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2019-02-04T15:00:54Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=5a170e9e4c74bc7f9aa57861c90e5813d63bfdab'/>
<id>urn:sha1:5a170e9e4c74bc7f9aa57861c90e5813d63bfdab</id>
<content type='text'>
Simplify the proc fs creation code with new helper functions,
snd_card_ro_proc_new() and snd_card_rw_proc_new().
Just a code refactoring and no functional changes.

Reviewed-by: Jaroslav Kysela &lt;perex@perex.cz&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: i2c/cs8427: Fix int to char conversion</title>
<updated>2018-10-18T13:44:08Z</updated>
<author>
<name>Philipp Klocke</name>
<email>philipp97kl@gmail.com</email>
</author>
<published>2018-10-18T10:33:02Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=eb7ebfa3c1989aa8e59d5e68ab3cddd7df1bfb27'/>
<id>urn:sha1:eb7ebfa3c1989aa8e59d5e68ab3cddd7df1bfb27</id>
<content type='text'>
Compiling with clang yields the following warning:

sound/i2c/cs8427.c:140:31: warning: implicit conversion from 'int'
to 'char' changes value from 160 to -96 [-Wconstant-conversion]
    data[0] = CS8427_REG_AUTOINC | CS8427_REG_CORU_DATABUF;
            ~ ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

Because CS8427_REG_AUTOINC is defined as 128, it is too big for a
char field.
So change data from char to unsigned char, that it can hold the value.

This patch does not change the generated code.

Signed-off-by: Philipp Klocke &lt;philipp97kl@gmail.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: i2c: Remove empty init and exit</title>
<updated>2018-08-03T14:11:43Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2018-08-03T13:48:26Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=3b23dc52da90c340c51273414f4e2d13e07e594c'/>
<id>urn:sha1:3b23dc52da90c340c51273414f4e2d13e07e594c</id>
<content type='text'>
For a sake of code simplification, remove the init and the exit
entries that do nothing.

Notes for readers: actually it's OK to remove *both* init and exit,
but not OK to remove the exit entry.  By removing only the exit while
keeping init, the module becomes permanently loaded; i.e. you cannot
unload it any longer!

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
</feed>
