Skip to contentSkip to conversation

Staging: comedi: adl_pci9118.c : fixed code style issue

PATCH In review Fabian Baumanis 3 participants 3 messages Nov 18, 2017 – Nov 24, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: comedi: adl_pci9118.c : fixed code style issue

Removed uneccessary parantheses which were sorrounding two if-statements.

---
 drivers/staging/comedi/drivers/adl_pci9118.c | 3 +--

 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/comedi/drivers/adl_pci9118.c +0 -0
index 1cc9b7e..c77b994 100644
@@ -946,8 +946,7 @@ static int pci9118_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)

        devpriv->ai_add_back = 0;
        if (devpriv->master) {
                devpriv->usedma = 1;
-               if ((cmd->flags & CMDF_WAKE_EOS) &&
-                   (cmd->scan_end_arg == 1)) {
+               if (cmd->flags & CMDF_WAKE_EOS && cmd->scan_end_arg == 1) { if (cmd->convert_src == TRIG_NOW) devpriv->ai_add_back = 1;
                        if (cmd->convert_src == TRIG_TIMER) {

Signature · 1 line
2.7.4
#1 lore raw
Quoted 2 lines · Fabian Baumanis

Removed uneccessary parantheses which were sorrounding two if-statements.

There is only one 'if' statement changed by the patch. Apart from that (and the typos in the patch description), the patch is fine as far as it goes. However, the checkpatch script identifies several similar "unnecessary parentheses" issues in this file, and it would be better to take care of them all with a single patch rather than patching them one at a time.

Quoted 21 lines
---
  drivers/staging/comedi/drivers/adl_pci9118.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/comedi/drivers/adl_pci9118.c +1 -2
index 1cc9b7e..c77b994 100644
@@ -946,8 +946,7 @@ static int pci9118_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
         devpriv->ai_add_back = 0;
         if (devpriv->master) {
                 devpriv->usedma = 1;
-               if ((cmd->flags & CMDF_WAKE_EOS) &&
-                   (cmd->scan_end_arg == 1)) {
+               if (cmd->flags & CMDF_WAKE_EOS && cmd->scan_end_arg == 1) {
                         if (cmd->convert_src == TRIG_NOW)
                                 devpriv->ai_add_back = 1;
                         if (cmd->convert_src == TRIG_TIMER) {
Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
maintainer
#2 lore raw
In reply to Fabian Baumanis
Quoted 13 lines · Fabian Baumanis

Removed uneccessary parantheses which were sorrounding two if-statements.

---
 drivers/staging/comedi/drivers/adl_pci9118.c | 3 +--

 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/comedi/drivers/adl_pci9118.c +0 -0
index 1cc9b7e..c77b994 100644

drivers/staging/comedi/drivers/adl_pci9118.c static int pci9118_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) · line 949

Quoted 6 lines
drivers/staging/comedi/drivers/adl_pci9118.c +1 -2
@@ -946,8 +946,7 @@ static int pci9118_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
         devpriv->ai_add_back = 0;
         if (devpriv->master) {
                 devpriv->usedma = 1;
-               if ((cmd->flags & CMDF_WAKE_EOS) &&
-                   (cmd->scan_end_arg == 1)) {
+               if (cmd->flags & CMDF_WAKE_EOS && cmd->scan_end_arg == 1) {

Ick, no, now I need to remember which has higher precedence, "&" or "&&". It's "&" right? I should not have to go look it up.

The code as-is is just fine.

thanks,

greg k-h