28 Jun, 2019

1 commit

  • Shifting the integer value 1 is evaluated using 32-bit
    arithmetic and then used in an expression that expects a 64-bit
    value, so there is potentially an integer overflow. Fix this
    by using the BIT_ULL macro to perform the shift.

    [ Note: as of the time being, no actual integer overflow hits because
    all values are less than 32bit, not including the extended 3-byte or
    DSD formats. But this is the right fix for future usage, of
    course. -- tiwai ]

    Addresses-Coverity: ("Unintentional integer overflow")
    Signed-off-by: Colin Ian King
    Signed-off-by: Takashi Iwai

    Colin Ian King
     

04 Apr, 2019

1 commit


19 Dec, 2018

1 commit


20 Sep, 2018

1 commit


27 Jul, 2018

1 commit

  • The open codes with the bit shift in xen_snd_front_alsa.c give sparse
    warnings as the PCM format type is with __bitwise.
    There is already a standard macro to get the format bits, so let's use
    it instead.

    This fixes sparse warnings like:
    sound/xen/xen_snd_front_alsa.c:191:47: warning: restricted snd_pcm_format_t degrades to integer

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

28 May, 2018

1 commit

  • The negative error return from the call to to_sndif_format is being
    assigned to an unsigned 8 bit integer and hence the check for a negative
    value is always going to be false. Fix this by using ret as the error
    return and hence the negative error can be detected and assign
    the u8 sndif_format to ret if there is no error.

    Detected by CoverityScan, CID#1469385 ("Unsigned compared against 0")

    Signed-off-by: Colin Ian King
    Reviewed-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Colin Ian King
     

16 May, 2018

1 commit

  • Implement essential initialization of the sound driver:
    - introduce required data structures
    - handle driver registration
    - handle sound card registration
    - register sound driver on backend connection
    - remove sound driver on backend disconnect

    Initialize virtual sound card with streams according to the
    Xen store configuration.

    Implement ALSA driver operations including:
    - manage frontend/backend shared buffers
    - manage Xen bus event channel states

    Implement requests from front to back for ALSA
    PCM operations.
    - report ALSA period elapsed event: handle XENSND_EVT_CUR_POS
    notifications from the backend when stream position advances
    during playback/capture. The event carries a value of how
    many octets were played/captured at the time of the event.
    - implement explicit stream parameter negotiation between
    backend and frontend: handle XENSND_OP_HW_PARAM_QUERY request
    to read/update configuration space for the parameter given:
    request passes desired parameter interval and the response to
    this request returns min/max interval for the parameter to be used.

    Signed-off-by: Oleksandr Andrushchenko
    Signed-off-by: Takashi Iwai

    Oleksandr Andrushchenko