Skip to content

Commit

Permalink
usb/gadget: Fix clang -Wbitfield-constant-conversion
Browse files Browse the repository at this point in the history
../drivers/usb/gadget/function/f_accessory.c:270:20: warning: implicit truncation from 'int' to bit-field changes value from 1 to -1 [-Wbitfield-constant-conversion]
        dev->disconnected = 1;
                          ^ ~
../drivers/usb/gadget/function/f_accessory.c:773:25: warning: implicit truncation from 'int' to bit-field changes value from 1 to -1 [-Wbitfield-constant-conversion]
        _acc_dev->disconnected = 1;
                               ^ ~
  AR      drivers/soc/qcom/qmi_helpers.o
../drivers/usb/gadget/function/f_accessory.c:1178:14: warning: implicit truncation from 'int' to bit-field changes value from 1 to -1 [-Wbitfield-constant-conversion]
        dev->online = 1;
                    ^ ~

Change-Id: I862d37481335eeb0d636d504355081c87e39a591
Signed-off-by: Angga <[email protected]>
  • Loading branch information
AnggaR96s authored and Codecity001 committed Oct 23, 2022
1 parent e8fcc0f commit 9fb506f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/gadget/function/f_accessory.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ struct acc_dev {
/* online indicates state of function_set_alt & function_unbind
* set to 1 when we connect
*/
int online:1;
unsigned int online:1;

/* disconnected indicates state of open & release
* Set to 1 when we disconnect.
* Not cleared until our file is closed.
*/
int disconnected:1;
unsigned int disconnected:1;

/* strings sent by the host */
char manufacturer[ACC_STRING_SIZE];
Expand Down

0 comments on commit 9fb506f

Please sign in to comment.