lkml.org 
[lkml]   [2021]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 5.4 14/52] ALSA: sb8: Add a comment note regarding an unused pointer
    Date
    From: Atul Gopinathan <atulgopinathan@gmail.com>

    [ Upstream commit a28591f61b60fac820c6de59826ffa710e5e314e ]

    The field "fm_res" of "struct snd_sb8" is never used/dereferenced
    throughout the sb8.c code. Therefore there is no need for any null value
    check after the "request_region()".

    Add a comment note to make developers know about this and prevent any
    "NULL check" patches on this part of code.

    Cc: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Atul Gopinathan <atulgopinathan@gmail.com>
    Link: https://lore.kernel.org/r/20210503115736.2104747-36-gregkh@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    sound/isa/sb/sb8.c | 6 +++++-
    1 file changed, 5 insertions(+), 1 deletion(-)

    diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
    index d67eae3988bd..77bedfe33eea 100644
    --- a/sound/isa/sb/sb8.c
    +++ b/sound/isa/sb/sb8.c
    @@ -94,7 +94,11 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev)
    acard = card->private_data;
    card->private_free = snd_sb8_free;

    - /* block the 0x388 port to avoid PnP conflicts */
    + /*
    + * Block the 0x388 port to avoid PnP conflicts.
    + * No need to check this value after request_region,
    + * as we never do anything with it.
    + */
    acard->fm_res = request_region(0x388, 4, "SoundBlaster FM");
    if (!acard->fm_res) {
    err = -EBUSY;
    --
    2.30.2
    \
     
     \ /
      Last update: 2021-05-24 17:03    [W:2.159 / U:0.140 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site