usb: typec: Fix fast_role_swap_current show function
Subsystems (2)
PATCH 1/1 usb: typec: Fix fast_role_swap_current show function
The current implementation mistakenly performs a & operation on the output of sysfs_emit. This patch performs the & operation before calling sysfs_emit.
Series-to: LKML <[email protected]>
--- drivers/usb/typec/pd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/pd.c +1 -1
@@ -95,7 +95,7 @@ peak_current_show(struct device *dev, struct device_attribute *attr, char *buf)static ssize_t fast_role_swap_current_show (struct device *dev,struct device_attribute *attr,char *buf) { -return sysfs_emit (buf,"%u\n" ,to_pdo (dev)->pdo >>PDO_FIXED_FRS_CURR_SHIFT ) &3 ; +return sysfs_emit (buf,"%u\n" , (to_pdo (dev)->pdo >>PDO_FIXED_FRS_CURR_SHIFT ) &3 ); }static DEVICE_ATTR_RO (fast_role_swap_current);
Signature · 1 line
2.41.0.rc0.172.g3f132b7071-goog
Hi Pavan,
Quoted 7 lines · Pavan Holla
The current implementation mistakenly performs a & operation on the output of
sysfs_emit. This patch performs the & operation before callingsysfs_emit.Series-to: LKML <[email protected]>
Signed-off-by Pavan Holla <[email protected]>
Thanks!
Benson
Quoted 20 lines
--- drivers/usb/typec/pd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/typec/pd.c +1
-2@@ -95,7 +95,7 @@ peak_current_show(struct device *dev, struct device_attribute *attr, char *buf)static ssize_t fast_role_swap_current_show (struct device *dev,struct device_attribute *attr,char *buf) { -return sysfs_emit (buf,"%u\n" ,to_pdo (dev)->pdo >>PDO_FIXED_FRS_CURR_SHIFT ) &3 ; +return sysfs_emit (buf,"%u\n" , (to_pdo (dev)->pdo >>PDO_FIXED_FRS_CURR_SHIFT ) &3 ); }static DEVICE_ATTR_RO (fast_role_swap_current); --2.41.0.rc0.172.g3f132b7071-goog
Signature · 7 lines
Benson Leung Staff Software Engineer Chrome OS Kernel Google Inc. [email protected] Chromium OS Project [email protected]
Greg Kroah-Hartman
maintainerQuoted 5 lines · Pavan Holla
The current implementation mistakenly performs a & operation on the output of
sysfs_emit. This patch performs the & operation before callingsysfs_emit.Series-to: LKML <[email protected]>
What is this line for?
What commit id does this fix?
thanks,
greg k-h
Quoted 10 lines · Greg Kroah-Hartman
Quoted 5 lines · Pavan Holla
The current implementation mistakenly performs a & operation on the output of
sysfs_emit. This patch performs the & operation before callingsysfs_emit.Series-to: LKML <[email protected]>
What is this line for?
Sorry, this was intended for a tool that simplifies git send-email. I ended up not using the tool, but forgot to delete the tag.
Quoted 2 lines
What commit id does this fix?
Quoted 3 lines
thanks,
greg k-h
Please look out for V2 of this patch.
Thanks,
Pavan
PATCH v2 1/1 usb: typec: Fix fast_role_swap_current show function
In reply to Greg Kroah-HartmanThe current implementation mistakenly performs a & operation on the output of sysfs_emit. This patch performs the & operation before calling sysfs_emit.
--- drivers/usb/typec/pd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/pd.c +1 -1
@@ -95,7 +95,7 @@ peak_current_show(struct device *dev, struct device_attribute *attr, char *buf)static ssize_t fast_role_swap_current_show (struct device *dev,struct device_attribute *attr,char *buf) { -return sysfs_emit (buf,"%u\n" ,to_pdo (dev)->pdo >>PDO_FIXED_FRS_CURR_SHIFT ) &3 ; +return sysfs_emit (buf,"%u\n" , (to_pdo (dev)->pdo >>PDO_FIXED_FRS_CURR_SHIFT ) &3 ); }static DEVICE_ATTR_RO (fast_role_swap_current);
Signature · 1 line
2.41.0.rc0.172.g3f132b7071-goog
Quoted 7 lines · Pavan Holla
The current implementation mistakenly performs a & operation on the output of
sysfs_emit. This patch performs the & operation before callingsysfs_emit.Fixes 662a60102c12 ("usb: typec: Separate USB Power Delivery from USB Type-C")Reported-by Benson Leung <[email protected]>Signed-off-by Pavan Holla <[email protected]>
Quoted 19 lines
--- drivers/usb/typec/pd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/typec/pd.c +1
-1@@ -95,7 +95,7 @@ peak_current_show(struct device *dev, struct device_attribute *attr, char *buf)static ssize_t fast_role_swap_current_show (struct device *dev,struct device_attribute *attr,char *buf) { -return sysfs_emit (buf,"%u\n" ,to_pdo (dev)->pdo >>PDO_FIXED_FRS_CURR_SHIFT ) &3 ; +return sysfs_emit (buf,"%u\n" , (to_pdo (dev)->pdo >>PDO_FIXED_FRS_CURR_SHIFT ) &3 ); }static DEVICE_ATTR_RO (fast_role_swap_current);Signature · 1 line
2.41.0.rc0.172.g3f132b7071-goog
Signature · 1 line
heikki
Hi Pavan,
Quoted 8 lines · Pavan Holla
The current implementation mistakenly performs a & operation on the output of
sysfs_emit. This patch performs the & operation before callingsysfs_emit.Fixes 662a60102c12 ("usb: typec: Separate USB Power Delivery from USB Type-C")Reported-by Benson Leung <[email protected]>Signed-off-by Pavan Holla <[email protected]>
Quoted 20 lines
--- drivers/usb/typec/pd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/typec/pd.c +1
-2@@ -95,7 +95,7 @@ peak_current_show(struct device *dev, struct device_attribute *attr, char *buf)static ssize_t fast_role_swap_current_show (struct device *dev,struct device_attribute *attr,char *buf) { -return sysfs_emit (buf,"%u\n" ,to_pdo (dev)->pdo >>PDO_FIXED_FRS_CURR_SHIFT ) &3 ; +return sysfs_emit (buf,"%u\n" , (to_pdo (dev)->pdo >>PDO_FIXED_FRS_CURR_SHIFT ) &3 ); }static DEVICE_ATTR_RO (fast_role_swap_current); --2.41.0.rc0.172.g3f132b7071-goog
Signature · 7 lines
Benson Leung Staff Software Engineer Chrome OS Kernel Google Inc. [email protected] Chromium OS Project [email protected]
Quoted 8 lines · Pavan Holla
The current implementation mistakenly performs a & operation on the output of
sysfs_emit. This patch performs the & operation before callingsysfs_emit.Fixes 662a60102c12 ("usb: typec: Separate USB Power Delivery from USB Type-C")Reported-by Benson Leung <[email protected]>Signed-off-by Pavan Holla <[email protected]>