summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/Documentation/generic_buffer.c
diff options
context:
space:
mode:
authorAya Mahfouz2015-02-26 10:45:26 +0100
committerGreg Kroah-Hartman2015-02-27 00:24:16 +0100
commit1525ecfce19b56e8c26b52d15f7b4617c9f503ba (patch)
tree79ea34bdf24c281a279df8454f06472142a2ac22 /drivers/staging/iio/Documentation/generic_buffer.c
parentstaging: lustre: libcfs: rewrite the right hand side of an assignment (diff)
downloadkernel-qcow2-linux-1525ecfce19b56e8c26b52d15f7b4617c9f503ba.tar.gz
kernel-qcow2-linux-1525ecfce19b56e8c26b52d15f7b4617c9f503ba.tar.xz
kernel-qcow2-linux-1525ecfce19b56e8c26b52d15f7b4617c9f503ba.zip
staging: iio: Documentation: rewrite the right hand side of an assignment
This patch rewrites the right hand side of an assignment for expressions of the form: a = (a <op> b); to be: a <op>= b; where <op> = << | >>. This issue was detected and resolved using the following coccinelle script: @@ identifier i; expression e; @@ -i = (i >> e); +i >>= e; @@ identifier i; expression e; @@ -i = (i << e); +i <<= e; Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/iio/Documentation/generic_buffer.c')
-rw-r--r--drivers/staging/iio/Documentation/generic_buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/iio/Documentation/generic_buffer.c b/drivers/staging/iio/Documentation/generic_buffer.c
index de4647e2495e..59b250545d4c 100644
--- a/drivers/staging/iio/Documentation/generic_buffer.c
+++ b/drivers/staging/iio/Documentation/generic_buffer.c
@@ -72,7 +72,7 @@ void print2byte(int input, struct iio_channel_info *info)
* Shift before conversion to avoid sign extension
* of left aligned data
*/
- input = input >> info->shift;
+ input >>= info->shift;
if (info->is_signed) {
int16_t val = input;