summaryrefslogtreecommitdiff
path: root/lib/mpi/mpi-bit.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2020-04-29 21:02:03 +0200
committerTakashi Iwai <tiwai@suse.de>2020-04-30 08:11:42 +0200
commit5ce00760a84848d008554c693ceb6286f4d9c509 (patch)
tree833685091fb86e6dcc5a5626f6bdee0edcf66b6a /lib/mpi/mpi-bit.c
parenta2f647240998aa49632fb09b01388fdf2b87acfc (diff)
ALSA: opti9xx: shut up gcc-10 range warning
gcc-10 points out a few instances of suspicious integer arithmetic leading to value truncation: sound/isa/opti9xx/opti92x-ad1848.c: In function 'snd_opti9xx_configure': sound/isa/opti9xx/opti92x-ad1848.c:322:43: error: overflow in conversion from 'int' to 'unsigned char' changes value from '(int)snd_opti9xx_read(chip, 3) & -256 | 240' to '240' [-Werror=overflow] 322 | (snd_opti9xx_read(chip, reg) & ~(mask)) | ((value) & (mask))) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ sound/isa/opti9xx/opti92x-ad1848.c:351:3: note: in expansion of macro 'snd_opti9xx_write_mask' 351 | snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(3), 0xf0, 0xff); | ^~~~~~~~~~~~~~~~~~~~~~ sound/isa/opti9xx/miro.c: In function 'snd_miro_configure': sound/isa/opti9xx/miro.c:873:40: error: overflow in conversion from 'int' to 'unsigned char' changes value from '(int)snd_miro_read(chip, 3) & -256 | 240' to '240' [-Werror=overflow] 873 | (snd_miro_read(chip, reg) & ~(mask)) | ((value) & (mask))) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ sound/isa/opti9xx/miro.c:1010:3: note: in expansion of macro 'snd_miro_write_mask' 1010 | snd_miro_write_mask(chip, OPTi9XX_MC_REG(3), 0xf0, 0xff); | ^~~~~~~~~~~~~~~~~~~ These are all harmless here as only the low 8 bit are passed down anyway. Change the macros to inline functions to make the code more readable and also avoid the warning. Strictly speaking those functions also need locking to make the read/write pair atomic, but it seems unlikely that anyone would still run into that issue. Fixes: 1841f613fd2e ("[ALSA] Add snd-miro driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20200429190216.85919-1-arnd@arndb.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'lib/mpi/mpi-bit.c')
0 files changed, 0 insertions, 0 deletions
x-net-next.git/commit/net?id=958a93c15466c69e2ec531332e67011f549943bd'>tcp, ulp: Pass lockdep expression to RCU listsAmol Grover 2020-02-24devlink: add ACL generic packet trapsJiri Pirko 2020-02-24net: Remove unneeded export of a couple of xdp generic functionsDavid Ahern 2020-02-24mac80211: Add api to support configuring TID specific configurationTamizh chelvam 2020-02-24nl80211: Add support to configure TID specific RTSCTS configurationTamizh chelvam 2020-02-24nl80211: Add support to configure TID specific AMPDU configurationTamizh chelvam 2020-02-24nl80211: Add support to configure TID specific retry configurationTamizh chelvam 2020-02-24nl80211: modify TID-config APIJohannes Berg 2020-02-24nl80211: Add NL command to support TID speicific configurationsTamizh chelvam 2020-02-24mac80211: Beacon protection using the new BIGTK (STA)Jouni Malinen 2020-02-24mac80211: Beacon protection using the new BIGTK (AP)Jouni Malinen 2020-02-24mac80211: Update BIP to support Beacon framesJouni Malinen 2020-02-24mac80211: Support BIGTK configuration for Beacon protectionJouni Malinen 2020-02-24cfg80211: Support key configuration for Beacon protection (BIGTK)Jouni Malinen 2020-02-24cfg80211: More error messages for key addition failuresJouni Malinen 2020-02-24Revert "nl80211: add src and dst addr attributes for control port tx/rx"Johannes Berg 2020-02-24Revert "mac80211: support NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211_MAC_A...Johannes Berg 2020-02-23igmp: remove unused macro IGMP_Vx_UNSOLICITED_REPORT_INTERVALLi RongQing 2020-02-21Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-nextDavid S. Miller