Ian McKellen was Gandalf in "LOTR"; Ian McEwan wrote the novel on which this 2007 Keira Knightley film was based
... McEwan - 
Enduring Love Captivating, disturbing, beautifully written ..... Atonement (2007) 
Starring Keira Knightly and James McAvoy ...... Sir Ian McKellen - 'Gandalf'.