Skip to content

[TEST] SoundWire: fix FIELD_PREP usage - #2442

Closed
plbossart wants to merge 2 commits into
thesofproject:topic/sof-devfrom
plbossart:sdw/fix-FIELD_PREP
Closed

[TEST] SoundWire: fix FIELD_PREP usage#2442
plbossart wants to merge 2 commits into
thesofproject:topic/sof-devfrom
plbossart:sdw/fix-FIELD_PREP

Conversation

@plbossart

Copy link
Copy Markdown
Member

CI check on @vinodkoul's fix

@plbossart

Copy link
Copy Markdown
MemberAuthor

Looks ok to me, I didn't find any other examples of read-modify-write.
@bardliao can you double-check and provide a Tested-by when you are done?

FIELD_PREP() does not replace the bits so it is not apt in case where we
modify a register.
Use u32p_replace_bits() instead.
Fixes: 3cf25d6 ("soundwire: cadence: use FIELD_{GET|PREP}")
Signed-off-by: Vinod Koul <vkoul@kernel.org>
FIELD_PREP() does not replace the bits so it is not apt in case where we
modify a register.
Use u32_replace_bits() or u16_replace_bits() instead.
Fixes: 3b4979c ("soundwire: intel: use FIELD_{GET|PREP}")
Signed-off-by: Vinod Koul <vkoul@kernel.org>
@plbossart

Copy link
Copy Markdown
MemberAuthor

v2 of patches forced-pushed

@bardliao

Copy link
Copy Markdown
Collaborator

@plbossart I will get build error if #2298 is applied.

file included from ./include/linux/soundwire/sdw.h:8:0,
from sound/soc/codecs/rt1316-sdw.h:12,
from sound/soc/codecs/rt1316-sdw.c:19:
./include/linux/bitfield.h:93:2: error: braced-group within expression allowed only inside a function
({ \
^
./include/linux/soundwire/sdw_registers.h:334:2: note: in expansion of macro ‘FIELD_PREP’
FIELD_PREP(GENMASK(24, 22), FIELD_GET(GENMASK(2, 0), (fun))) | \
^~~~~~~~~~
sound/soc/codecs/rt1316-sdw.h:102:4: note: in expansion of macro ‘SDW_SDCA_CTL’
{ SDW_SDCA_CTL(FUN_SMART_AMP, RT1316_SDCA_ENT_UDMPU21, RT1316_SDCA_CTL_UDMPU_CLUSTER, 0), 0x00 },
^~~~~~~~~~~~
./include/linux/bitfield.h:93:2: error: braced-group within expression allowed only inside a function
({ \
^

@bardliao

Copy link
Copy Markdown
Collaborator

Sorry, I thought the fix is for sdca codecs but obviously not. Verified it on TGL-U laptop.

@plbossart

Copy link
Copy Markdown
MemberAuthor

ok, this is upstream so closing

IulianOlaru249 pushed a commit to IulianOlaru249/linux that referenced this pull request Mar 16, 2022
As noted in Sphinx thesofproject#2442 new CSS added by extensions are rendered
innefective if html_context its changed. So, instead, use add_stylesheet
to add theme_overridesc.css
Signed-off-by: Octavian Purdila <tavi@cs.pub.ro>
oder-chiou pushed a commit to oder-chiou/linux-soundwire that referenced this pull request May 5, 2026
…arations)
Fix checkpatch code style warnings:
WARNING: Missing a blank line after declarations
thesofproject#761: FILE: net/core/pktgen.c:761:
+ char c;
+ if (get_user(c, &user_buffer[i]))
WARNING: Missing a blank line after declarations
thesofproject#780: FILE: net/core/pktgen.c:780:
+ char c;
+ if (get_user(c, &user_buffer[i]))
WARNING: Missing a blank line after declarations
thesofproject#806: FILE: net/core/pktgen.c:806:
+ char c;
+ if (get_user(c, &user_buffer[i]))
WARNING: Missing a blank line after declarations
thesofproject#823: FILE: net/core/pktgen.c:823:
+ char c;
+ if (get_user(c, &user_buffer[i]))
WARNING: Missing a blank line after declarations
thesofproject#1968: FILE: net/core/pktgen.c:1968:
+ char f[32];
+ memset(f, 0, 32);
WARNING: Missing a blank line after declarations
thesofproject#2410: FILE: net/core/pktgen.c:2410:
+ struct pktgen_net *pn = net_generic(dev_net(pkt_dev->odev), pg_net_id);
+ if (!x) {
WARNING: Missing a blank line after declarations
thesofproject#2442: FILE: net/core/pktgen.c:2442:
+ __u16 t;
+ if (pkt_dev->flags & F_QUEUE_MAP_RND) {
WARNING: Missing a blank line after declarations
thesofproject#2523: FILE: net/core/pktgen.c:2523:
+ unsigned int i;
+ for (i = 0; i < pkt_dev->nr_labels; i++)
WARNING: Missing a blank line after declarations
thesofproject#2567: FILE: net/core/pktgen.c:2567:
+ __u32 t;
+ if (pkt_dev->flags & F_IPSRC_RND)
WARNING: Missing a blank line after declarations
thesofproject#2587: FILE: net/core/pktgen.c:2587:
+ __be32 s;
+ if (pkt_dev->flags & F_IPDST_RND) {
WARNING: Missing a blank line after declarations
thesofproject#2634: FILE: net/core/pktgen.c:2634:
+ __u32 t;
+ if (pkt_dev->flags & F_TXSIZE_RND) {
WARNING: Missing a blank line after declarations
thesofproject#2736: FILE: net/core/pktgen.c:2736:
+ int i;
+ for (i = 0; i < pkt_dev->cflows; i++) {
WARNING: Missing a blank line after declarations
thesofproject#2738: FILE: net/core/pktgen.c:2738:
+ struct xfrm_state *x = pkt_dev->flows[i].x;
+ if (x) {
WARNING: Missing a blank line after declarations
thesofproject#2752: FILE: net/core/pktgen.c:2752:
+ int nhead = 0;
+ if (x) {
WARNING: Missing a blank line after declarations
thesofproject#2795: FILE: net/core/pktgen.c:2795:
+ unsigned int i;
+ for (i = 0; i < pkt_dev->nr_labels; i++)
WARNING: Missing a blank line after declarations
thesofproject#3480: FILE: net/core/pktgen.c:3480:
+ ktime_t idle_start = ktime_get();
+ schedule();
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@plbossart@bardliao@kv2019i@vinodkoul