Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate strange variable derefence pattern #2726

Closed
LudwigKnuepfer opened this issue Mar 27, 2015 · 9 comments
Closed

Investigate strange variable derefence pattern #2726

LudwigKnuepfer opened this issue Mar 27, 2015 · 9 comments
Assignees
Labels
Community: good first issue This issue is good for newcomers to RIOT to be addressed / implemented Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Comments

@LudwigKnuepfer
Copy link
Member

There are several occurrences like this:

 (&GPIO_3_DEV)->OUTTGL.reg = 1 << GPIO_3_PIN;

Figure out if this is necessary for some strange reason (look at the assembler).

Find all the places where this is done with git grep -E '\(&[^)]*\)->' and fix them.

@LudwigKnuepfer LudwigKnuepfer added Newbie-Task-Candidate Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation labels Mar 27, 2015
@kushalsingh007
Copy link
Member

I have started working on this issue :)

@OlegHahm OlegHahm modified the milestone: Release 2015.06 May 28, 2015
@PeterKietzmann
Copy link
Member

@kushalsingh007 are you still working on this? The occurrences may have changed after #3095. Didn't look for it, just came to my mind...

@kushalsingh007
Copy link
Member

Currently I have stopped working on it due to some other stuff that I am working on .. But once I get free I'll have a look at it again. Meanwhile, if someone else wants have a look .:+1:

@mayman99
Copy link
Contributor

hello guys, i'm new to RIOT,
i'll start working on this ... hope it wont be hard for a newbie like me.

@PeterKietzmann
Copy link
Member

Hi @MohmadAyman and welcome :-) ! Nice that you're planning to start working on this issue. If you have any problems, just ask on the developers mailing list or directly in here. If there is progress you may want to open a PR according to our developement procedures. Good luck!

@OlegHahm OlegHahm removed this from the Release 2015.09 milestone Sep 2, 2015
@miri64
Copy link
Member

miri64 commented Oct 17, 2016

So… what are the results of this?

@OlegHahm
Copy link
Member

@LudwigKnuepfer ?

@smlng
Copy link
Member

smlng commented Jul 6, 2017

I think this can be closed, latest output for git grep -E '\(&[^)]*\)->' in RIOT:

cpu/lpc11u34/periph/spi.c:        *((volatile uint8_t *)(&dev(bus)->DR)) = tmp;
cpu/lpc11u34/periph/spi.c:        tmp = *((volatile uint8_t *)(&dev(bus)->DR));
cpu/msp430_common/include/stdatomic.h:    __atomic_compare_exchange_n(&(object)->__val, expected,     \
cpu/msp430_common/include/stdatomic.h:    __atomic_compare_exchange_n(&(object)->__val, expected,     \
cpu/msp430_common/include/stdatomic.h:    __atomic_exchange_n(&(object)->__val, desired, order)
cpu/msp430_common/include/stdatomic.h:    __atomic_fetch_add(&(object)->__val, operand, order)
cpu/msp430_common/include/stdatomic.h:    __atomic_fetch_and(&(object)->__val, operand, order)
cpu/msp430_common/include/stdatomic.h:    __atomic_fetch_or(&(object)->__val, operand, order)
cpu/msp430_common/include/stdatomic.h:    __atomic_fetch_sub(&(object)->__val, operand, order)
cpu/msp430_common/include/stdatomic.h:    __atomic_fetch_xor(&(object)->__val, operand, order)
cpu/msp430_common/include/stdatomic.h:    __atomic_load_n(&(object)->__val, order)
cpu/msp430_common/include/stdatomic.h:    __atomic_store_n(&(object)->__val, desired, order)
cpu/msp430_common/include/stdatomic.h:    (_Bool)((*__ep = __sync_val_compare_and_swap(&(object)->__val,  \
cpu/msp430_common/include/stdatomic.h:    __sync_swap(&(object)->__val, desired)
cpu/msp430_common/include/stdatomic.h:    __sync_lock_test_and_set(&(__o)->__val, __d);           \
cpu/msp430_common/include/stdatomic.h:    __sync_fetch_and_add(&(object)->__val,      \
cpu/msp430_common/include/stdatomic.h:    __sync_fetch_and_and(&(object)->__val, operand)
cpu/msp430_common/include/stdatomic.h:    __sync_fetch_and_or(&(object)->__val, operand)
cpu/msp430_common/include/stdatomic.h:    __sync_fetch_and_sub(&(object)->__val,      \
cpu/msp430_common/include/stdatomic.h:    __sync_fetch_and_xor(&(object)->__val, operand)
cpu/msp430_common/include/stdatomic.h:    __sync_fetch_and_add(&(object)->__val, 0)
pkg/lwip/contrib/sock/lwip_sock.c:                    return ip_2_ip4(&netif->ip_addr)->addr == ip_2_ip4(addr)->addr;
Binary file pkg/oonf_api/patches/0012-isolate-oonf-list-implementation-of-riot-s-implement.patch matches
sys/net/gnrc/link_layer/slip/gnrc_slip.c:        msg_send_int(&msg, _SLIP_DEV(arg)->slip_pid);
sys/net/gnrc/link_layer/slip/gnrc_slip.c:                if (ringbuffer_add_one(&_SLIP_DEV(arg)->in_buf, _SLIP_END) < 0) {
sys/net/gnrc/link_layer/slip/gnrc_slip.c:                if (ringbuffer_add_one(&_SLIP_DEV(arg)->in_buf, _SLIP_ESC) < 0) {
sys/net/gnrc/link_layer/slip/gnrc_slip.c:        if (ringbuffer_add_one(&_SLIP_DEV(arg)->in_buf, data) < 0) {

@kaspar030
Copy link
Contributor

I think this can be closed, latest output for git grep -E '(&[^)]*)->' in RIOT:

Confirmed. I'll close.

@miri64 miri64 added the Community: good first issue This issue is good for newcomers to RIOT to be addressed / implemented label Sep 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community: good first issue This issue is good for newcomers to RIOT to be addressed / implemented Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

No branches or pull requests

8 participants